public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-time] f44: Reenable tests with the fix sent to upstream
@ 2026-09-02 20:28 Michel Lind
  0 siblings, 0 replies; only message in thread
From: Michel Lind @ 2026-09-02 20:28 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rust-time
            Branch : f44
            Commit : 16af7c2a2c2abcd5e5b4cd97b4bd8ce8cbbe419e
            Author : Michel Lind <salimma@fedoraproject.org>
            Date   : 2026-09-02T19:27:35+01:00
            Stats  : +79/-28 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/rust-time/c/16af7c2a2c2abcd5e5b4cd97b4bd8ce8cbbe419e?branch=f44

            Log:
            Reenable tests with the fix sent to upstream

Signed-off-by: Michel Lind <salimma@fedoraproject.org>

---
diff --git a/rust-time.spec b/rust-time.spec
index 41dea48..36d9686 100644
--- a/rust-time.spec
+++ b/rust-time.spec
@@ -17,6 +17,9 @@ Patch:          time-fix-metadata-auto.diff
 # Manually created patch for downstream crate metadata changes
 # * remove WASM-specific features
 Patch:          time-fix-metadata.diff
+# * Fix alignment tests on 32-bit architectures:
+# * https://github.com/time-rs/time/pull/809
+Patch10:        time-fix-alignment-tests-on-32bit.patch
 
 BuildRequires:  cargo-rpm-macros >= 24
 
@@ -248,18 +251,7 @@ use the "std" feature of the "%{crate}" crate.
 
 %if %{with check}
 %check
-# * skip tests that encode 64-bit memory layout assumptions
-%{cargo_test -a -- -- --exact %{shrink:
-    --skip meta::alignment::case_02
-    --skip meta::alignment::case_08
-    --skip meta::alignment::case_37
-    --skip meta::alignment::case_38
-    --skip meta::alignment::case_39
-    --skip meta::alignment::case_40
-    --skip meta::alignment::case_41
-    --skip meta::alignment::case_42
-    --skip meta::alignment::case_44
-}}
+%cargo_test -a
 %endif
 
 %changelog

diff --git a/rust2rpm.toml b/rust2rpm.toml
index fc9060a..4c6f243 100644
--- a/rust2rpm.toml
+++ b/rust2rpm.toml
@@ -3,22 +3,14 @@ cargo-toml-patch-comments = [
     "remove WASM-specific features",
 ]
 
+[[package.extra-patches]]
+number = 10
+file = "time-fix-alignment-tests-on-32bit.patch"
+comments = [
+  "Fix alignment tests on 32-bit architectures:",
+  "https://github.com/time-rs/time/pull/809",
+]
+
 [features]
 enable-all = true
 
-[tests]
-skip = [
-  "meta::alignment::case_02",
-  "meta::alignment::case_08",
-  "meta::alignment::case_37",
-  "meta::alignment::case_38",
-  "meta::alignment::case_39",
-  "meta::alignment::case_40",
-  "meta::alignment::case_41",
-  "meta::alignment::case_42",
-  "meta::alignment::case_44",
-
-]
-skip-exact = true
-comments = ["skip tests that encode 64-bit memory layout assumptions"]
-

diff --git a/time-fix-alignment-tests-on-32bit.patch b/time-fix-alignment-tests-on-32bit.patch
new file mode 100644
index 0000000..ec011d3
--- /dev/null
+++ b/time-fix-alignment-tests-on-32bit.patch
@@ -0,0 +1,67 @@
+From fe417f35df556aadfee673e2e6e28416717b050c Mon Sep 17 00:00:00 2001
+From: Michel Lind <salimma@fedoraproject.org>
+Date: Wed, 2 Sep 2026 19:22:56 +0100
+Subject: [PATCH] Fix alignment tests on 32-bit architectures
+
+On i686, for instance, 64-bit integers are 32-bit aligned
+
+See
+
+https://koji.fedoraproject.org/koji/taskinfo?taskID=149783770
+https://kojipkgs.fedoraproject.org//work/tasks/4350/149784350/build.log
+
+```
+---- meta::alignment::case_02 stdout ----
+thread 'meta::alignment::case_02' (3516) panicked at tests/integration/meta.rs:91:5:
+assertion `left == right` failed: alignment of `time::signed_duration::SignedDuration` was 8
+  left: 4
+ right: 8
+```
+
+Signed-off-by: Michel Lind <salimma@fedoraproject.org>
+---
+ time/tests/integration/meta.rs | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/time/tests/integration/meta.rs b/time/tests/integration/meta.rs
+index 94cd82e6d..b7efa2167 100644
+--- a/tests/integration/meta.rs
++++ b/tests/integration/meta.rs
+@@ -29,13 +29,13 @@ use time::{
+ 
+ #[rstest]
+ #[case(PhantomData::<Date>, 4)]
+-#[case(PhantomData::<SignedDuration>, 8)]
++#[case(PhantomData::<SignedDuration>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
+ #[case(PhantomData::<OffsetDateTime>, 4)]
+ #[case(PhantomData::<PlainDateTime>, 4)]
+ #[case(PhantomData::<UtcDateTime>, 4)]
+ #[case(PhantomData::<Time>, 4)]
+ #[case(PhantomData::<UtcOffset>, 1)]
+-#[case(PhantomData::<error::ComponentRange>, 8)]
++#[case(PhantomData::<error::ComponentRange>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
+ #[case(PhantomData::<error::ConversionRange>, 1)]
+ #[case(PhantomData::<error::DifferentVariant>, 1)]
+ #[case(PhantomData::<error::IndeterminateOffset>, 1)]
+@@ -69,14 +69,14 @@ use time::{
+ #[case(PhantomData::<Parsed>, align_of::<u128>())]
+ #[case(PhantomData::<Month>, 1)]
+ #[case(PhantomData::<Weekday>, 1)]
+-#[case(PhantomData::<Error>, 8)]
+-#[case(PhantomData::<error::Format>, 8)]
+-#[case(PhantomData::<error::InvalidFormatDescription>, 8)]
+-#[case(PhantomData::<error::Parse>, 8)]
+-#[case(PhantomData::<error::ParseFromDescription>, 8)]
+-#[case(PhantomData::<error::TryFromParsed>, 8)]
++#[case(PhantomData::<Error>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
++#[case(PhantomData::<error::Format>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
++#[case(PhantomData::<error::InvalidFormatDescription>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
++#[case(PhantomData::<error::Parse>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
++#[case(PhantomData::<error::ParseFromDescription>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
++#[case(PhantomData::<error::TryFromParsed>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
+ #[case(PhantomData::<Component>, 2)]
+-#[case(PhantomData::<BorrowedFormatItem<'_>>, 8)]
++#[case(PhantomData::<BorrowedFormatItem<'_>>, if cfg!(target_pointer_width = "64") { 8 } else { 4 })]
+ #[expect(deprecated)]
+ #[case(PhantomData::<modifier::MonthRepr>, 1)]
+ #[case(PhantomData::<modifier::Padding>, 1)]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-02 20:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-02 20:28 [rpms/rust-time] f44: Reenable tests with the fix sent to upstream Michel Lind

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox