public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/rust] main: Update rpmmacros test
@ 2026-08-24 17:23 Jesus Checa Hidalgo
  0 siblings, 0 replies; only message in thread
From: Jesus Checa Hidalgo @ 2026-08-24 17:23 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/rust
            Branch : main
            Commit : bc84e882082324fb9a131e90438224e755de1840
            Author : Jesus Checa Hidalgo <jchecahi@redhat.com>
            Date   : 2026-08-14T12:12:59+02:00
            Stats  : +14/-6 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/rust/c/bc84e882082324fb9a131e90438224e755de1840?branch=main

            Log:
            Update rpmmacros test

Starting with rhel 9.8 we are using the same rpmmacros format as Fedora
and RHEL 10, while RHEL older than 9.8 and 8 are using the "legacy"
format which pass-through the arguments to the cargo macros.

---
diff --git a/tests/Sanity/rust-rpmmacros/runtest.sh b/tests/Sanity/rust-rpmmacros/runtest.sh
index bfca5d4..e5312c5 100755
--- a/tests/Sanity/rust-rpmmacros/runtest.sh
+++ b/tests/Sanity/rust-rpmmacros/runtest.sh
@@ -36,7 +36,13 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest
-        rlRun "rpmbuild --define '_topdir $tmp' -ba $tmp/SPECS/$SPECFILE"
+        # Rpmmacros depending on RHEL version
+        # https://issues.redhat.com/browse/RHEL-104777
+        LEGACY_MACROS=""
+        if rlIsRHEL 8 || rlIsRHEL "<9.8"; then
+            LEGACY_MACROS="--with legacy_rpmmacros"
+        fi
+        rlRun "rpmbuild --define '_topdir $tmp' -ba ${LEGACY_MACROS} $tmp/SPECS/$SPECFILE"
     rlPhaseEnd
 
     rlPhaseStartCleanup

diff --git a/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec b/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec
index 34d87a0..d97088c 100644
--- a/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec
+++ b/tests/Sanity/rust-rpmmacros/rust-rpmtest.spec
@@ -1,5 +1,8 @@
 %global crate rpmtest
 
+# Build condition for legacy RPM macros (disabled by default)
+%bcond_with legacy_rpmmacros
+
 Name:           rust-rpmtest
 Version:        0.1.0
 Release:        1
@@ -38,9 +41,8 @@ Summary:        %{summary}
 %endif
 
 %build
-# cargo_build/install/test don't use -n/-a/-f in rhel/centos < 10 to avoid breaking
-# existing packages using arguments.
-%if 0%{?rhel} && 0%{?rhel} < 10
+# Use legacy cargo macros when requested
+%if %{with legacy_rpmmacros}
 %cargo_build --all-features
 %else
 %cargo_build -a
@@ -51,14 +53,14 @@ Summary:        %{summary}
 %{?cargo_license_summary:%cargo_license_summary -a}
 
 %install
-%if 0%{?rhel} && 0%{?rhel} < 10
+%if %{with legacy_rpmmacros}
 %cargo_install --all-features
 %else
 %cargo_install -a
 %endif
 
 %check
-%%if 0%{?rhel} && 0%{?rhel} < 10
+%if %{with legacy_rpmmacros}
 %cargo_test --all-features
 %else
 %cargo_test -a

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

only message in thread, other threads:[~2026-08-24 17:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-24 17:23 [tests/rust] main: Update rpmmacros test Jesus Checa Hidalgo

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