Re: [OE-core] [PATCH v7 1/7] package_rpm.bbclass: Drop external dependency generator to support rpm 6

Robert Yang
2026-03-03T12:01:28Z

Hi Mathieu,

Correct Ross' email (I had planed to ask Ross for help about cairo, but used
the wrong email, now the issue has been fixed, thanks all the same).

And please see my reply below.

On 3/3/26 17:41, Robert Yang wrote:
> Hi RP,
>
> Thanks for the comments.
>
> On 3/2/26 18:57, Richard Purdie wrote:
>> On Sun, 2026-03-01 at 04:25 -0800, Robert Yang via lists.openembedded.org wrote:
>>> From: Robert Yang <liezhi.yang@windriver.com>
>>>
>>> The rpm 6 doesn't support external dependency generator. Oe-core used it for
>>> per file dependency which was saved into pn.requires and pn.provides, but that
>>> hasn't been used any more since 2012 (rev:
>>> be40f6d0bb80274366af00461112af65687a4de8), and there were no complains or
>>> updates in the past 13 years, so just drop it to support rpm 6.
>>
>> This commit message is confusing. I think we need to be clear about the
>> following:
>>
>> Is this file dependency information written into the existing rpms with
>> rpm 5?
>
> I think you mean rpm 4 here, no, it isn't:
> * You disabled it by default since 2012 (rev:
> be40f6d0bb80274366af00461112af65687a4de8), and said:
>
>     Since few people use the per file dependency information, this patch
>     goes for the faster approach. It can be enabled if anyone needs it although
>     I'd mention that its being used to us as this code may well go away in
>     the future if nobody complains.
>
> * And even if we enable it manually, these info are just used by rpmbuild,
> others shouldn't use it?
>
>>
>> After the changes, do we still have the file dependency information or
>> is this being removed?
>
> Yes, we will still have the file dependency information generated by rpmbuild,
> here are related code from rpm:
>
>     /* If new-fangled dependency generation is disabled ... */
>     if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) {
>     if (fc->rpmformat < 6) {
>         /* ... then generate dependencies using %{__find_requires} et al. */
>         rpmlog(RPMLOG_WARNING,
>         _("Deprecated external dependency generator is used!\n"));
>         rc = rpmfcApplyExternal(fc);
>     } else {
>         rpmlog(RPMLOG_ERR,
>         _("External dependency generator is incompatible with v6 packages\n"));
>         rc = RPMRC_FAIL;
>     }
>     } else {
>     /* ... otherwise generate per-file dependencies */
>     rc = rpmfcApplyInternal(fc);
>     }
>
>>
>> I think you're saying there were no external users after 2012 but I'm
>> not even 100% sure about that.
>
> These info are for rpmbuild, there shouldn't be external users? And we must drop
> it to support rpm 6.
>
> And now I can't reproduce the build errors from autobuilder, I suspect it is
> because of host contamination issues, I tried to reproduce it on ubuntu
> 25.04 and debian v12, but can't reproduce them, it looks to me that cairo.pc's
> provides (pkgconfig(cairo) = 1.18.4) wasn't generate in autobuilder, but I don't
>  know why.

I've figured out the root cause, it is because I had added pkgconfig-native to
PACKAGE_DEPENDS, it would fail when do_packagedata is from sstate cache, but
do_package_write_rpm is re-run (not from sstate-cache), here is the reproducer:
$ bitbake cairo -ccleansstate && bitbake cairo -cpackagedata && bitbake cairo
-cclean && bitbake cairo -cpackage_write_rpm

$ rpm -qp --provides tmp/deploy/rpm/cortexa57/libcairo-dev-1.18.4-r0.cort
exa57.rpm
cairo-dev = 1.18.4
libcairo-dev = 1.18.4-r0

Then the "pkgconfig(cairo) = 1.18.4" is gone from the provides which is
incorrect. I should add pkgconfig-native as rpm-native:
python () {
if d.getVar('PACKAGES') != '':
deps = ' rpm-native:do_populate_sysroot
virtual/fakeroot-native:do_populate_sysroot'
+ # The pkgconfig-native is required by rpm's pkgconfigdeps.sh
+ deps += ' pkgconfig-native:do_populate_sysroot'
d.appendVarFlag('do_package_write_rpm', 'depends', deps)
d.setVarFlag('do_package_write_rpm', 'fakeroot', '1')

I've updated it in the pull (patch 7). @Mathieu, would you please help to
re-test it if RP has no objections on the external generator?

https://github.com/robertlinux/yocto rbt/rpm
https://github.com/robertlinux/yocto/tree/rbt/rpm

for you to fetch changes up to f8fa3090196bae3e12ad76f12f101722d84ca20a:

rpm: 4.20.1 -> 6.0.1 (2026-03-03 11:29:07 +0000)

----------------------------------------------------------------

Robert Yang (7):
package_rpm.bbclass: Drop external dependency generator to support rpm
6
package_rpm.bbclass: Define _lib and _libdir for rpmbuild
lib/oe/package.py: Don't add ldconfig_postinst_fragment for glibc or
musl
glib/python3/acl: Add pkgconfig to RDEPENDS
lib/oe/package.py: Don't redirect stderr
target-sdk-provides-dummy: Add pkg-config to DUMMYPROVIDES
rpm: 4.20.1 -> 6.0.1

// Robert

>
> We didn't get such issues in rpm4 was because rpm/scripts/pkgconfigdeps.sh
> didn't work in Yocto in the past, now rpm6 makes it work, so we got so many
> corner case issues, I've tried do as many tests I can, but still failed.
>
> // Robert
>
> > > Cheers,
>>
>> Richard
>