public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jesus Checa Hidalgo <jchecahi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/rust] main: Update rpmmacros test
Date: Mon, 24 Aug 2026 17:23:24 GMT	[thread overview]
Message-ID: <178759220436.1.16178638792737594477.tests-rust-bc84e8820823@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-08-24 17:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178759220436.1.16178638792737594477.tests-rust-bc84e8820823@fedoraproject.org \
    --to=jchecahi@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox