public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Domonkos <mdomonko@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Fix debuginfo enabled for noarch when --target is used regression
Date: Mon, 23 Nov 2026 09:35:22 GMT	[thread overview]
Message-ID: <179542652281.1.1241991608285551241.rpms-rpm-530f48d09638@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : 530f48d096384132c416937545ee843cdad64966
            Author : Michal Domonkos <mdomonko@redhat.com>
            Date   : 2024-05-28T16:34:03+02:00
            Stats  : +67/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/530f48d096384132c416937545ee843cdad64966?branch=pmatilai-v6

            Log:
            Fix debuginfo enabled for noarch when --target is used regression

Another round of the whack-a-mole game, this bug was found by Fedora CI.

---
diff --git a/0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch b/0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch
new file mode 100644
index 0000000..7ec9b99
--- /dev/null
+++ b/0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch
@@ -0,0 +1,62 @@
+From 3a14eb950148514c6d196ab3cefa7a37b82bff64 Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Tue, 28 May 2024 14:03:29 +0300
+Subject: [PATCH] Hammer in "no debuginfo for noarch packages, damn it" rule
+
+All the work we now do to get target platform right gets thrown away by mock
+apparently always passing "--target $(uname -m)" equivalent to rpmbuild,
+causing %_target_cpu and all that stuff be wrong during build scriptlet
+execution. Those are right during the initial spec parse so the old
+implementation just barely scraped through it all.
+
+Hammer in a C-side test based on the package arch to disable debuginfo
+packages on noarch no matter what. Pfft.
+
+Fixes: #3115
+---
+ build/build.c     |  5 +++++
+ tests/rpmbuild.at | 12 ++++++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/build/build.c b/build/build.c
+index 0c2d73862..7451c9c22 100644
+--- a/build/build.c
++++ b/build/build.c
+@@ -386,6 +386,11 @@ static int buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
+     spec->buildTime = getBuildTime();
+     spec->buildHost = buildHost();
+ 
++    /* Don't generate debug packages on noarch no matter what --target says */
++    const char *arch = headerGetString(spec->packages->header, RPMTAG_ARCH);
++    if (rstreq(arch, "noarch"))
++	rpmPushMacro(spec->macros, "_enable_debug_packages", NULL, "0", RMIL_SPEC);
++
+     /* XXX TODO: rootDir is only relevant during build, eliminate from spec */
+     spec->rootDir = buildArgs->rootdir;
+     if (!spec->recursing && spec->BACount) {
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index 2243afcf4..38fe476a3 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -2343,6 +2343,18 @@ runroot rpmbuild --quiet -bb \
+ [0],
+ [ignore],
+ [ignore])
++
++RPMTEST_CHECK([
++# mock uses --target <hostarch> everywhere, even noarch packages
++target=$(runroot rpm --eval "%{_host_cpu}")
++runroot rpmbuild --quiet -bb \
++		--target ${target} \
++		--define "%_enable_debug_packages 1" \
++		/data/SPECS/hlinktest.spec
++],
++[0],
++[ignore],
++[ignore])
+ RPMTEST_CLEANUP
+ 
+ # ------------------------------
+-- 
+2.45.1
+

diff --git a/rpm.spec b/rpm.spec
index 123e2e5..5210bc8 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -27,7 +27,7 @@
 
 %global rpmver 4.19.91
 #global snapver rc1
-%global baserelease 2
+%global baserelease 3
 %global sover 10
 
 %global srcver %{rpmver}%{?snapver:-%{snapver}}
@@ -153,6 +153,7 @@ rpm-4.19.91-weak-user-group.patch
 0002-Drop-an-accidentally-added-duplicated-test.patch
 0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
 0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
+0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch
 
 # These are not yet upstream
 rpm-4.7.1-geode-i686.patch
@@ -655,6 +656,9 @@ fi
 %doc %{_defaultdocdir}/rpm/API/
 
 %changelog
+* Tue May 28 2024 Michal Domonkos <mdomonko@redhat.com> - 4.19.91-3
+- Fix debuginfo enabled for noarch when --target is used regression
+
 * Mon May 27 2024 Michal Domonkos <mdomonko@redhat.com> - 4.19.91-2
 - Fix incomplete header on plain src.rpm build modes regression
 

                 reply	other threads:[~2026-11-23  9:35 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=179542652281.1.1241991608285551241.rpms-rpm-530f48d09638@fedoraproject.org \
    --to=mdomonko@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