From: Daan De Meyer Date: Fri, 7 Feb 2025 10:37:34 +0000 (+0100) Subject: mkosi: Work around regression in opensuse rpm 4.20 release X-Git-Tag: v258-rc1~1394 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=facc03dc973cc9051c2bde16d7084296e862c0e0;p=thirdparty%2Fsystemd.git mkosi: Work around regression in opensuse rpm 4.20 release The rpm 4.20 release introduces the following downstream change in /usr/lib/rpm/macros: ``` %buildroot %{_builddir}/%{NAME}-%{VERSION}-build/BUILDROOT ``` This definition is broken as rpm internally does the following since 4.20 to calculate the buildroot: ``` char *bn = rpmExpand("%{NAME}-%{VERSION}-build", NULL); /* Tilde and caret in paths are evil, convert to underscores */ for (char *t = bn; *t; t++) { if (*t == '^' || *t == '~') *t = '_'; } ``` This has broken our upstream opensuse CI builds in systemd as we do the following to fetch the list of unpackaged files by the rpm build: ``` rpmbuild ... --define "__check_files sh -c '$(rpm --define "_topdir /var/tmp" --eval %__check_files) | tee /tmp/unpackaged-files'" ... ``` which stopped working because the check files script tries to look for unpackaged files in the "/var/tmp/BUILD/systemd-258~devel-build/BUILDROOT" directory (%buildroot) whereas it should be looking in "/var/tmp/BUILD/systemd-258_devel-build/BUILDROOT". Let's remove the %buildroot compat definition until the bug is addressed in opensuse tumbleweed. --- diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot index 72115c2c5b8..f1cb7ba98fa 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot @@ -63,6 +63,11 @@ sed --in-place '/0009-pid1-handle-console-specificities-weirdness-for-s390.patch # TODO: Drop when the opensuse spec uses README.md instead of README.testsuite. sed --in-place 's/README.testsuite/README.md/' "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec" +# TODO: Drop when https://bugzilla.opensuse.org/show_bug.cgi?id=1236901 is resolved. +sed '/%buildroot/d' /usr/lib/rpm/macros >macros +mount --bind "$PWD/macros" /usr/lib/rpm/macros +rm macros + build() { IFS= # shellcheck disable=SC2046