public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Add last-minute patches for found regressions
@ 2026-11-23 9:35 Michal Domonkos
0 siblings, 0 replies; only message in thread
From: Michal Domonkos @ 2026-11-23 9:35 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rpm
Branch : pmatilai-v6
Commit : 2c0de27181d490c648bc8fb00eb39668558d4d75
Author : Michal Domonkos <mdomonko@redhat.com>
Date : 2024-05-23T16:51:44+02:00
Stats : +294/-5 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/rpm/c/2c0de27181d490c648bc8fb00eb39668558d4d75?branch=pmatilai-v6
Log:
Add last-minute patches for found regressions
Commit 8cf089a93a22c9113dc630fa24e39cb69912c458 wasn't yet built in koji
but it certainly got tested in other folks' CI setups, see [1] and [2].
Those being the first builds of the soon-to-be 4.20 version that were
actually used by non-rpm folks, issues were spotted and reported pretty
quickly. They were also quickly fixed upstream but we've already
released alpha2 so just carry those patches downstream for now.
Kudos to all people involved in reporting/fixing these promptly:
Miro Hroncok, Pavel Raiskup and Panu Matilainen
Hopefully these are the last deal breakers for now, otherwise we'll see
each other soon in the next round of commits.
While at it, also reword the Conflicts comment a bit to make it clearer.
[1] https://github.com/rpm-software-management/rpm/issues/3120
[2] https://github.com/rpm-software-management/rpm/issues/3121
---
diff --git a/0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch b/0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
new file mode 100644
index 0000000..dcba1d2
--- /dev/null
+++ b/0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
@@ -0,0 +1,71 @@
+From c74ab58f081937eefd0f79af8d0310495d321864 Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Thu, 23 May 2024 07:36:05 +0300
+Subject: [PATCH 1/3] Fix --noprep regression from introducing %mkbuilddir
+
+Commit 9d35c8df497534e1fbd806a4dc78802bcf35d7cb added a new step
+into the build process but I literally wasn't even aware we have a
+--noprep switch in rpmbuild, much less that it's used. Quite widely
+even, by mock.
+
+Luckily this seems simple to fix, just skip %mkbuilddir in --noprep.
+Extend the dynamic buildrequires test to mimick what mock does.
+
+Fixes: #3121
+---
+ tests/rpmbuild.at | 18 ++++++++++++++++++
+ tools/rpmbuild.c | 2 +-
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index 8a06d8a84..a060abe1f 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -2259,6 +2259,8 @@ RPMTEST_CLEANUP
+
+ # ------------------------------
+ # Check dynamic build requires
++# Mimick what mock does: repeat build with --noprep --noclean
++# until -br succeeds, and finally build the package.
+ AT_SETUP([rpmbuild -br])
+ AT_KEYWORDS([build])
+ RPMTEST_CHECK([
+@@ -2275,6 +2277,22 @@ runroot rpmbuild \
+ foo-bar = 2.0 is needed by buildrequires-1.0-1.noarch
+ ],
+ )
++
++RPMTEST_CHECK([
++runroot rpmbuild \
++ --define "provs bar foo foo-bar" \
++ --define "pkg foo" \
++ -bb --quiet /data/SPECS/deptest.spec
++
++runroot rpm -U /build/RPMS/noarch/deptest-foo-1.0-1.noarch.rpm
++
++runroot rpmbuild \
++ -br --noprep --noclean\
++ --quiet /data/SPECS/buildrequires.spec
++],
++[0],
++[],
++[])
+ RPMTEST_CLEANUP
+
+ # Test that -br creates an src.rpm on success
+diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
+index 492b0c290..459427fe3 100644
+--- a/tools/rpmbuild.c
++++ b/tools/rpmbuild.c
+@@ -261,7 +261,7 @@ static struct poptOption rpmBuildPoptTable[] = {
+
+ { "noclean", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_CLEAN|RPMBUILD_RMBUILD,
+ N_("do not execute %clean stage of the build"), NULL },
+- { "noprep", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_PREP,
++ { "noprep", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_PREP|RPMBUILD_MKBUILDDIR,
+ N_("do not execute %prep stage of the build"), NULL },
+ { "nocheck", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_CHECK,
+ N_("do not execute %check stage of the build"), NULL },
+--
+2.45.1
+
diff --git a/0002-Drop-an-accidentally-added-duplicated-test.patch b/0002-Drop-an-accidentally-added-duplicated-test.patch
new file mode 100644
index 0000000..103dfe3
--- /dev/null
+++ b/0002-Drop-an-accidentally-added-duplicated-test.patch
@@ -0,0 +1,41 @@
+From 31758e51cd60a7eb33b7280e0f9efee767455d4d Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Thu, 23 May 2024 07:48:53 +0300
+Subject: [PATCH 2/3] Drop an accidentally added duplicated test
+
+Commit a68a2e50578347384bb2f1b08314d8bf7026b9bc added the same test
+twice, hardly intentionally.
+---
+ tests/rpmbuild.at | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index a060abe1f..7e4b088aa 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -2311,22 +2311,6 @@ runroot rpmbuild \
+ )
+ RPMTEST_CLEANUP
+
+-# Test that -br creates an src.rpm on success
+-AT_SETUP([rpmbuild -br success])
+-AT_KEYWORDS([build])
+-RPMTEST_CHECK([
+-RPMDB_INIT
+-
+-runroot rpmbuild \
+- -br /data/SPECS/mini.spec
+-],
+-[0],
+-[Wrote: /build/SRPMS/mini-1-1.src.rpm
+-],
+-[],
+-)
+-RPMTEST_CLEANUP
+-
+ # ------------------------------
+ # Check dynamic build requires
+ AT_SETUP([rpmbuild -bd with errors])
+--
+2.45.1
+
diff --git a/0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch b/0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
new file mode 100644
index 0000000..09c6fe1
--- /dev/null
+++ b/0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
@@ -0,0 +1,172 @@
+From d1075106bb315913574e1acac921058d23dd5130 Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Thu, 23 May 2024 10:22:15 +0300
+Subject: [PATCH 3/3] Make --build-in-place much less of a hack and also, work
+
+Instead of skipping everything in %setup, take advantage of it:
+we shouldn't unpack any sources but otherwise we can just let it
+fall through it, defining buildsubdir and everything, if we let
+rpm do its normal %mkbuilddir thing and just symlink to the in-place
+tree from rpm's %builddir. This way it's not such an ugly duckling
+interfering with how normal rpms are built, and even honors %setup
+flags to a degree.
+
+This fixes two regressions: one introduced when adding %mkbuilddir that
+nukes your current directory with no questions asked if --build-in-place
+is used before it even starts, and an earlier one from commit
+b34333fa021c0ee7215714eeef96d1a2843ea08e that would nuke your precious
+in-place directory afterwards. And as a side-effect of all this, debuginfo
+generation also now works with --build-in-place.
+
+Fixes: #3122
+Fixes: #3042
+---
+ build/parsePrep.c | 17 ++++++++++-----
+ tests/rpmbuild.at | 55 +++++++++++++++++++++++++++++++++++++++++++++++
+ tools/rpmbuild.c | 8 +------
+ 3 files changed, 68 insertions(+), 12 deletions(-)
+
+diff --git a/build/parsePrep.c b/build/parsePrep.c
+index 4754827f5..6aa692d40 100644
+--- a/build/parsePrep.c
++++ b/build/parsePrep.c
+@@ -171,6 +171,7 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
+ int leaveDirs = 0, skipDefaultAction = 0;
+ int createDir = 0, quietly = 0, autoPath = 0;
+ char * dirName = NULL;
++ int buildInPlace = rpmExpandNumeric("%{?_build_in_place}");
+ struct poptOption optionsTable[] = {
+ { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL},
+ { NULL, 'b', POPT_ARG_STRING, NULL, 'b', NULL, NULL},
+@@ -190,10 +191,6 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
+ goto exit;
+ }
+
+- if (rpmExpandNumeric("%{_build_in_place}")) {
+- goto exit;
+- }
+-
+ optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
+ while ((arg = poptGetNextOpt(optCon)) > 0) {
+ char *optArg = poptGetOptArg(optCon);
+@@ -206,7 +203,8 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
+ goto exit;
+ }
+
+- { char *chptr = doUntar(spec, num, quietly, 0);
++ if (!buildInPlace) {
++ char *chptr = doUntar(spec, num, quietly, 0);
+ if (chptr == NULL)
+ goto exit;
+
+@@ -235,6 +233,15 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
+ free(buildSubdir);
+ }
+
++ if (buildInPlace) {
++ skipDefaultAction = 1;
++ leaveDirs = 1;
++ /* note that pwd needs to be from parse, not build time */
++ char *buf = rpmExpand("ln -s %(pwd) %{buildsubdir}", NULL);
++ appendMb(mb, buf, 1);
++ free(buf);
++ }
++
+ /* cd to the build dir */
+ { char * buildDir = rpmGenPath(spec->rootDir, "%{_builddir}", "");
+
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index 7e4b088aa..a665a6bce 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -321,6 +321,61 @@ run rpmbuild \
+ [ignore])
+ RPMTEST_CLEANUP
+
++AT_SETUP([rpmbuild --build-in-place])
++AT_KEYWORDS([build])
++RPMDB_INIT
++
++RPMTEST_CHECK([
++runroot_other tar xf /data/SOURCES/hello-2.0.tar.gz
++runroot_other mv hello-2.0/hello.spec .
++runroot_other find hello-2.0 | sort
++],
++[0],
++[hello-2.0
++hello-2.0/COPYING
++hello-2.0/FAQ
++hello-2.0/Makefile
++hello-2.0/README
++hello-2.0/hello.c
++],
++[])
++
++RPMTEST_CHECK([
++runroot --chdir hello-2.0 rpmbuild -bb --build-in-place ../hello.spec
++],
++[0],
++[ignore],
++[ignore])
++
++RPMTEST_CHECK([
++runroot rpm -qp --qf "%{name}-%{version}-%{release}\n" /build/RPMS/*/*.rpm
++],
++[0],
++[hello-2.0-1
++hello-debuginfo-2.0-1
++],
++[])
++
++# finally, see that we left the tree intact
++RPMTEST_CHECK([
++runroot_other find hello-2.0 | sort
++],
++[0],
++[hello-2.0
++hello-2.0/COPYING
++hello-2.0/FAQ
++hello-2.0/Makefile
++hello-2.0/README
++hello-2.0/debugfiles.list
++hello-2.0/debuglinks.list
++hello-2.0/debugsources.list
++hello-2.0/elfbins.list
++hello-2.0/hello
++hello-2.0/hello.c
++],
++[])
++RPMTEST_CLEANUP
++
+ AT_SETUP([rpmbuild with %autosetup -C])
+ AT_KEYWORDS([build])
+ RPMDB_INIT
+diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
+index 459427fe3..dd36e24d8 100644
+--- a/tools/rpmbuild.c
++++ b/tools/rpmbuild.c
+@@ -136,6 +136,7 @@ static void buildArgCallback( poptContext con,
+ case POPT_BUILDINPLACE:
+ rpmDefineMacro(NULL, "_build_in_place 1", 0);
+ buildInPlace = 1;
++ nobuildAmount |= RPMBUILD_RMBUILD;
+ break;
+ }
+ }
+@@ -432,13 +433,6 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba,
+ int rc = 1; /* assume failure */
+ rpmSpecFlags specFlags = spec_flags;
+
+- /* Override default BUILD value for _builddir */
+- if (buildInPlace) {
+- char *cwd = rpmGetCwd();
+- rpmPushMacro(NULL, "_builddir", NULL, cwd, 0);
+- free(cwd);
+- }
+-
+ if (ba->buildRootOverride)
+ buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
+
+--
+2.45.1
+
diff --git a/rpm.spec b/rpm.spec
index 359ae1f..766f839 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -50,11 +50,13 @@ Requires: coreutils
Requires: popt%{_isa} >= 1.10.2.1
Requires: curl
Conflicts: systemd < 253.5-6
-# The old %%install hack for debuginfo enablement in redhat-rpm-config is no
-# longer needed and is now unsupported, causing rpmbuild failures. Reflect
-# that here. More details:
-# https://github.com/rpm-software-management/rpm/issues/2204
+
+# RPM used to require an %%install hack (shipped by redhat-rpm-config) in order
+# to enable debuginfo. Version 4.19.91 implements this functionality properly
+# so this hack is no longer necessary and, in fact, is no longer supported.
+# More details: https://github.com/rpm-software-management/rpm/issues/2204
Conflicts: redhat-rpm-config < 291-1
+
Obsoletes: python2-rpm < %{version}-%{release}
# XXX generally assumed to be installed but make it explicit as rpm
@@ -142,6 +144,9 @@ rpm-4.19.91-weak-user-group.patch
# Patches already upstream:
0001-Ensure-noarch-packages-don-t-get-debuginfo.patch
+0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
+0002-Drop-an-accidentally-added-duplicated-test.patch
+0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
# These are not yet upstream
rpm-4.7.1-geode-i686.patch
@@ -644,7 +649,7 @@ fi
%doc %{_defaultdocdir}/rpm/API/
%changelog
-* Tue May 21 2024 Michal Domonkos <mdomonko@redhat.com> - 4.19.91-1
+* Thu May 23 2024 Michal Domonkos <mdomonko@redhat.com> - 4.19.91-1
- Update to 4.20 alpha2 (https://rpm.org/wiki/Releases/4.20.0)
* Mon May 06 2024 Miro Hrončok <mhroncok@redhat.com> - 4.19.1.1-2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 9:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 9:35 [rpms/rpm] pmatilai-v6: Add last-minute patches for found regressions Michal Domonkos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox