public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-zvariant] epel10: Backport fix for tests on big-endian architectures
@ 2026-09-23 23:37 Fabio Valentini
0 siblings, 0 replies; only message in thread
From: Fabio Valentini @ 2026-09-23 23:37 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rust-zvariant
Branch : epel10
Commit : ef676cd8acb500b604639bda7e5c23d99681a5d1
Author : Fabio Valentini <decathorpe@gmail.com>
Date : 2026-09-24T01:36:11+02:00
Stats : +52/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rust-zvariant/c/ef676cd8acb500b604639bda7e5c23d99681a5d1?branch=epel10
Log:
Backport fix for tests on big-endian architectures
---
diff --git a/0001-backport-zv-Don-t-assume-little-endian-host-in-dict_.patch b/0001-backport-zv-Don-t-assume-little-endian-host-in-dict_.patch
new file mode 100644
index 0000000..85b3788
--- /dev/null
+++ b/0001-backport-zv-Don-t-assume-little-endian-host-in-dict_.patch
@@ -0,0 +1,50 @@
+From 7798676c131b1b18a2ca1070b7df50cfee5ce567 Mon Sep 17 00:00:00 2001
+From: Fabio Valentini <decathorpe@gmail.com>
+Date: Thu, 24 Sep 2026 01:17:46 +0200
+Subject: [PATCH] backport: zv: Don't assume little-endian host in dict_value
+ test
+
+Backport of upstream commit:
+https://github.com/z-galaxy/zbus/commit/5f32837
+---
+ tests/dict_value.rs | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/tests/dict_value.rs b/tests/dict_value.rs
+index fbc2914..65b37bf 100644
+--- a/tests/dict_value.rs
++++ b/tests/dict_value.rs
+@@ -4,8 +4,8 @@ use std::collections::{BTreeMap, HashMap};
+
+ use endi::NATIVE_ENDIAN;
+ use zvariant::{
+- DeserializeDict, Dict, OwnedObjectPath, SerializeDict, Str, Type, Value, as_value::optional,
+- serialized::Context, to_bytes,
++ DeserializeDict, Dict, LE, OwnedObjectPath, SerializeDict, Str, Type, Value,
++ as_value::optional, serialized::Context, to_bytes,
+ };
+
+ #[macro_use]
+@@ -119,7 +119,8 @@ fn dict_value() {
+ // Dict<u32, u8>
+ let mut map: HashMap<u32, u8> = HashMap::new();
+ map.insert(1, 2);
+- let encoded = to_bytes(ctxt, &map).unwrap();
++ // The byte order is explicit since the encoding is compared against hardcoded bytes.
++ let encoded = to_bytes(Context::new_dbus(LE, 0), &map).unwrap();
+ assert_eq!(
+ encoded.bytes(),
+ [
+@@ -132,7 +133,8 @@ fn dict_value() {
+ // GVariant format now
+ #[cfg(feature = "gvariant")]
+ {
+- let ctxt = Context::new_gvariant(NATIVE_ENDIAN, 0);
++ // Explicit byte order here too, for the same reason.
++ let ctxt = Context::new_gvariant(LE, 0);
+ let encoded = to_bytes(ctxt, &map).unwrap();
+ assert_eq!(
+ encoded.bytes(),
+--
+2.55.0
+
diff --git a/rust-zvariant.spec b/rust-zvariant.spec
index 57ade4a..1942194 100644
--- a/rust-zvariant.spec
+++ b/rust-zvariant.spec
@@ -15,6 +15,8 @@ Source: %{crates_source}
# Manually created patch for downstream crate metadata changes
# * drop unused, benchmark-only codspeed-criterion-compat dev-dependency
Patch: zvariant-fix-metadata.diff
+# * https://github.com/z-galaxy/zbus/commit/5f32837
+Patch: 0001-backport-zv-Don-t-assume-little-endian-host-in-dict_.patch
BuildRequires: cargo-rpm-macros >= 24
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-23 23:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 23:37 [rpms/rust-zvariant] epel10: Backport fix for tests on big-endian architectures Fabio Valentini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox