The package rpms/rust-libspa.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-libspa.git/commit/?id=74f1e7....
Change:
+%ifarch %{ix86}
Thanks.
Full change:
============
commit 74f1e753dfce9e6a95f145227c060d88c3995b9a
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Wed Apr 20 14:39:10 2022 -0700
Apply proposed upstream fix for tests
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/libspa-0.4.1-skip-failing-tests.patch
b/libspa-0.4.1-skip-failing-tests.patch
deleted file mode 100644
index 43f917d..0000000
--- a/libspa-0.4.1-skip-failing-tests.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-diff -ruN libspa-0.4.1/src/dict.rs libspa-0.4.1-skip-failing-tests/src/dict.rs
---- libspa-0.4.1/src/dict.rs 1973-11-29 13:33:09.000000000 -0800
-+++ libspa-0.4.1-skip-failing-tests/src/dict.rs 2022-01-31 21:55:38.214797913 -0800
-@@ -88,27 +88,6 @@
- /// `Some(Err(ParseValueError))` is returned.
- ///
- /// See [`ParsableValue#foreign-impls`] for all the types which can be produced by
this method.
-- ///
-- /// # Examples
-- /// ```
-- /// use libspa::prelude::*;
-- /// use libspa::{StaticDict, static_dict};
-- ///
-- /// static DICT: StaticDict = static_dict! {
-- /// "true" => "true",
-- /// "ten" => "10",
-- /// "pi" => "3.14159265359",
-- /// "pointer" => "pointer:0xdeadbeef"
-- /// };
-- ///
-- /// assert_eq!(DICT.parse("true"), Some(Ok(true)));
-- /// assert_eq!(DICT.parse("ten"), Some(Ok(10)));
-- /// assert_eq!(DICT.parse("ten"), Some(Ok(10.0)));
-- /// assert_eq!(DICT.parse("pi"), Some(Ok(3.14159265359)));
-- ///
-- /// let ptr = DICT.parse::<*const
i32>("pointer").unwrap().unwrap();
-- /// assert!(!ptr.is_null());
-- /// ```
- fn parse<T: ParsableValue>(&self, key: &str) ->
Option<Result<T, ParseValueError>> {
- self.iter()
- .find(|(k, _)| *k == key)
-@@ -355,21 +334,6 @@
- }
-
- /// A collection of static key/value pairs.
--///
--/// # Examples
--/// Create a `StaticDict` and access the stored values by key:
--/// ```rust
--/// use libspa::prelude::*;
--/// use libspa::{StaticDict, static_dict};
--///
--/// static DICT: StaticDict = static_dict!{
--/// "Key" => "Value",
--/// "OtherKey" => "OtherValue"
--/// };
--///
--/// assert_eq!(Some("Value"), DICT.get("Key"));
--/// assert_eq!(Some("OtherValue"), DICT.get("OtherKey"));
--/// ```
- pub struct StaticDict {
- ptr: ptr::NonNull<spa_sys::spa_dict>,
- }
-@@ -389,17 +353,6 @@
- /// A macro for creating a new [`StaticDict`] with predefined key-value pairs.
- ///
- /// The macro accepts a list of static `Key => Value` pairs, seperated by commas.
--///
--/// # Examples:
--/// Create a `StaticDict`.
--/// ```rust
--/// use libspa::{StaticDict, static_dict};
--///
--/// static PROPS: StaticDict = static_dict!{
--/// "Key1" => "Value1",
--/// "Key2" => "Value2",
--/// };
--/// ```
- #[macro_export]
- macro_rules! static_dict {
- {$($k:expr => $v:expr),+ $(,)?} => {{
-@@ -465,6 +418,7 @@
- iter.for_each(|_| panic!("Iterated over non-existing item"));
- }
-
-+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
- #[test]
- fn test_iter_cstr() {
- let dict = static_dict! {
-@@ -490,6 +444,7 @@
- assert_eq!(None, iter.next());
- }
-
-+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
- #[test]
- fn test_iterators() {
- let dict = static_dict! {
-@@ -513,6 +468,7 @@
- assert_eq!(None, val_iter.next());
- }
-
-+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
- #[test]
- fn test_get() {
- let dict = static_dict! {
-@@ -522,6 +478,7 @@
- assert_eq!(Some("V0"), dict.get("K0"));
- }
-
-+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
- #[test]
- fn test_debug() {
- let dict = static_dict! {
-@@ -547,6 +504,7 @@
- );
- }
-
-+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
- #[test]
- fn static_dict() {
- static DICT: StaticDict = static_dict! {
-@@ -559,6 +517,7 @@
- assert_eq!(DICT.get("K1"), Some("V1"));
- }
-
-+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
- #[test]
- fn parse() {
- use super::ParseValueError;
-diff -ruN libspa-0.4.1/src/result.rs libspa-0.4.1-skip-failing-tests/src/result.rs
---- libspa-0.4.1/src/result.rs 1973-11-29 13:33:09.000000000 -0800
-+++ libspa-0.4.1-skip-failing-tests/src/result.rs 2022-01-31 21:17:55.153088803 -0800
-@@ -184,6 +184,7 @@
-
- #[should_panic]
- #[test]
-+ #[ignore]
- fn async_seq_panic() {
- // raw value does not have the SPA_ASYNC_BIT set
- AsyncSeq::from_raw(1);
-diff -ruN libspa-0.4.1/tests/pod.rs libspa-0.4.1-skip-failing-tests/tests/pod.rs
---- libspa-0.4.1/tests/pod.rs 1973-11-29 13:33:09.000000000 -0800
-+++ libspa-0.4.1-skip-failing-tests/tests/pod.rs 2022-01-31 21:39:03.783908894 -0800
-@@ -2103,6 +2103,7 @@
- );
- }
-
-+#[cfg(target_pointer_width = "64")]
- #[test]
- #[cfg_attr(miri, ignore)]
- fn pointer() {
diff --git a/libspa-use_platform_indep_c_char.patch
b/libspa-use_platform_indep_c_char.patch
new file mode 100644
index 0000000..9d72947
--- /dev/null
+++ b/libspa-use_platform_indep_c_char.patch
@@ -0,0 +1,31 @@
+From d60e8fcb887c73dfe2c1b6aec60b4c539f8043d8 Mon Sep 17 00:00:00 2001
+From: "Tom A. Wagner" <tom.a.wagner(a)protonmail.com>
+Date: Wed, 20 Apr 2022 11:42:00 +0200
+Subject: [PATCH] libspa: static dict: Fix incorrect use of platform-specific
+ `i8` type for a C char.
+
+This could lead to compilation failures on other platforms, where a C `char` is not
defined as a `i8`.
+
+The platform-independent `std::os::raw::c_char` is now used instead.
+---
+ libspa/src/dict.rs | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libspa/src/dict.rs b/libspa/src/dict.rs
+index d2a7188..6499be7 100644
+--- a/libspa/src/dict.rs
++++ b/libspa/src/dict.rs
+@@ -409,8 +409,8 @@ macro_rules! static_dict {
+ const ITEMS: &[spa_dict_item] = &[
+ $(
+ spa_dict_item {
+- key: concat!($k, "\0").as_ptr() as *const i8,
+- value: concat!($v, "\0").as_ptr() as *const i8
++ key: concat!($k, "\0").as_ptr() as *const
std::os::raw::c_char,
++ value: concat!($v, "\0").as_ptr() as *const
std::os::raw::c_char
+ },
+ )+
+ ];
+--
+GitLab
+
diff --git a/rust-libspa.spec b/rust-libspa.spec
index 8da1c63..ec19f1a 100644
--- a/rust-libspa.spec
+++ b/rust-libspa.spec
@@ -18,7 +18,7 @@ Source1:
https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/raw/v%{ver
# * work around architecture-specific test failures:
#
https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/issues/35
-Patch: libspa-0.4.1-skip-failing-tests.patch
+Patch:
https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/merge_requests/122....
ExclusiveArch: %{rust_arches}
@@ -56,7 +56,7 @@ use the "default" feature of the "%{crate}" crate.
%ghost %{crate_instdir}/Cargo.toml
%prep
-%autosetup -n %{crate}-%{version_no_tilde} -p1
+%autosetup -n %{crate}-%{version_no_tilde} -p2
cp %{SOURCE1} .
%cargo_prep
@@ -71,7 +71,11 @@ cp %{SOURCE1} .
%if %{with check}
%check
-%cargo_test
+%ifarch %{ix86}
+%cargo_test -- -- --skip 'result::tests::async_seq_panic' --skip
'pointer'
+%else
+%cargo_test -- -- --skip 'result::tests::async_seq_panic'
+%endif
%endif
%changelog