Re: [OE-core] [PATCH v3 2/2] rpm: 4.20.1 -> 6.0.1

Robert Yang
2026-02-08T14:48:39Z

I had blocked by another issue in the past week, the rpm 4.20.1 couldn't find
any requires/provides on pkg-config files (.pc), but for rpm 6.0.1,
qemuarm64 and qemux86 can find them, but qemux-64 can't, so there
are do_rootfs errors for qemuarm64 and qemux86 when install the
dev pkgs, such as:

Problem 1: package python3-ptest-3.14.2-r0.cortexa15t2hf_neon from oe-repo
requires python3-dev, but none of the providers can be instal
led
- conflicting requests
- nothing provides /usr/bin/pkg-config needed by
python3-dev-3.14.2-r0.cortexa15t2hf_neon from oe-repo
Problem 2: package libglib-2.0-ptest-1:2.86.3-r0.cortexa15t2hf_neon from
oe-repo requires glib-2.0-dev, but none of the providers can be
installed
- conflicting requests
- nothing provides /usr/bin/pkg-config needed by
libglib-2.0-dev-1:2.86.3-r0.cortexa15t2hf_neon from oe-repo
(try to add '--skip-broken' to skip uninstallable packages or
'--setopt=optional_metadata_types=filelists' to load additional filelists m
etadata)

I finally found the root cause and fixed that, this is because the macros
(_lib and _libdir) for rpmbuild is built from rpm-native, they may not work
for target recipes, the fix is passing the correct macros to rpmbuild
when do_package_write_rpm:

diff --git a/meta/classes-global/package_rpm.bbclass
b/meta/classes-global/package_rpm.bbclass
index 30696aa45f..526ac57982 100644
--- a/meta/classes-global/package_rpm.bbclass
+++ b/meta/classes-global/package_rpm.bbclass
@@ -622,6 +622,8 @@ python do_package_rpm () {
cmd = rpmbuild
cmd = cmd + " --noclean --nodeps --short-circuit --target " + pkgarch + "
--buildroot " + pkgd
cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " +
pkgwritedir + "'"
+ cmd = cmd + " --define '_lib ${BASELIB}'"
+ cmd = cmd + " --define '_libdir ${libdir}'"
cmd = cmd + " --define '_builddir " + d.getVar('B') + "'"
cmd = cmd + " --define '_build_name_fmt
%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'"

I will send the patches after more testing.

// Robert

On 2/2/26 21:01, Robert Yang wrote:
> Hi Mathieu,
>
> On 1/27/26 20:27, Mathieu Dubois-Briand wrote:
>> On Fri Jan 23, 2026 at 7:13 AM CET, Robert Yang via lists.openembedded.org wrote:
>>> From: Robert Yang <liezhi.yang@windriver.com>
>>>
>>> * Add a tag to SRC_URI so that there will be errors when only change the
>>>    filename during upgrade it, as suggested by Alexander.
>>>
>>> * Rebase the following patch:
>>>    - 0001-Add-a-color-setting-for-mips64_n32-binaries.patch
>>>    - 0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
>>>    - 0001-Do-not-read-config-files-from-HOME.patch
>>>    - 0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
>>>    - 0001-When-cross-installing-execute-package-scriptlets-wit.patch
>>>    - 0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch
>>>    - 0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch
>>>    - 0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
>>>    - 0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch
>>>    - 0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch
>>>
>>> * Remove backported patch 0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch
>>>
>>> * Add the following 2 patches:
>>>    - 0001-tools-elfdeps.cc-Remove-format-module.patch
>>>      There is no format until gcc 13.1, so remove the format module to make it
>>>      work on hosts such as Ubuntu 22.04.
>>>
>>>    - 0001-macros.in-Set-_pkgverify_level-to-digest-as-RCPM-4.2.patch
>>>      Fixed:
>>>      GPG check FAILED
>>>
>>> * Add scdoc-native to DEPENDS to fix do_configure error for both native and
>>>    target:
>>>    Could not find SCDOC using the following names: scdoc
>>>
>>>    Note, both target and native need scdoc-native, it is used for generating the
>>>    manual, the man pages in *man/* are scdoc sources
>>>
>>> * Add /etc/rpm to nativesdk-rpm to fix:
>>>    ERROR: nativesdk-rpm-1_6.0.1-r0 do_package: QA Issue: nativesdk-rpm:
>>>    Files/directories were installed but not shipped in any package:
>>>    /etc
>>>    /etc/rpm
>>>
>>> * Test info:
>>>    PACKAGE_CLASSES = "package_rpm"
>>>    $ bitbake core-image-sato world
>>>    $ bitbake core-image-sato -cpopulate_sdk
>>>
>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> ---
>>
>> Hi Robert,
>>
>> Thanks for your patch.
>>
>> Some tests are failing after this upgrade, you can see them with
>> "bitbake core-image-full-cmdline:do_testimage":
>>
>> AssertionError: 1 != 0 : dnf --repofrompath=oe-testimage-repo-
>> qemux86_64,http://192.168.7.1:41395/qemux86_64 --repofrompath=oe-testimage-
>> repo-noarch,http://192.168.7.1:41395/noarch --repofrompath=oe-testimage-repo-
>> x86_64_x32,http://192.168.7.1:41395/x86_64_x32 --nogpgcheck install --
>> installroot=/home/root/chroot/test -v -y --rpmverbosity=debug busybox
>> ...
>> %post(busybox-1.37.0-r0.x86_64_x32): execv(/bin/sh) pid 624
>> error: failed to exec scriptlet interpreter /bin/sh: No such file or directory
>> %post(busybox-1.37.0-r0.x86_64_x32): waitpid(624) rc 624 status 7f00
>> warning: %post(busybox-1.37.0-r0.x86_64_x32) scriptlet failed, exit status 127
>>
>> Error in POSTIN scriptlet in rpm package busybox
>>    Installing       : libc6-2.42+git0+453e6b8dba-r1.x86_64_x32               3/4
>
> I found the root cause, it is because busybox and libc6 depends on each other,
> busybox' elf files depends on libc6, and libc6's postin depends on busybox'
> /bin/sh, the do_rootfs works well is because dnf-native has set
> RPM_NO_CHROOT_FOR_SCRIPTS=1, but it would be failed for a fresh rootfs.
>
> In rpm 4.20.1, it let the installed files' Requires win, so it installed busybox
> firstly, but in rpm 6.0.1, it let the postin's Requires win since postin would
> run immediately after the files are installed, this does make sense, so it
> installed busybox (which provides /bin/sh required by libc6' postin) firstly,
> then we got the errors. I couldn't find which commit made this change because
> a lot of files and functions are refactored during 4.20.1 and 6.0.0 (not .1),
> I also tried bisect, but failed because a lot of do_patch or
> do_configure/do_compile failures for each build.
>
> For libc6's the postin is:
>
> #!/bin/sh
> if [ x"$D" = "x" ]; then
>     if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi
> fi
>
> This doesn't make sense for lib6 since there is no /bin/sh or ldconfig when
> libc6 is not ready, so we can just remove libc6's postin to fix the problem.
>
> I will send a V4 for it if no objections.
>
> // Robert
>
>>
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/11/builds/3059
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/3107
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/16/builds/3127
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/19/builds/3100
>>
>> Can you have a look at these tests?
>>
>> Thanks,
>> Mathieu
>>
>