All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: sumanth.gavini@windriver.com,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>,
	 "mathieu.dubois-briand@bootlin.com"
	<mathieu.dubois-briand@bootlin.com>,
	"alex.kanavin@gmail.com" <alex.kanavin@gmail.com>
Cc: "mattware@cisco.com" <mattware@cisco.com>,
	"esparlin@cisco.com"	 <esparlin@cisco.com>,
	"peter.marko@siemens.com" <peter.marko@siemens.com>,
	 "MacLeod, Randy" <Randy.MacLeod@windriver.com>
Subject: Re: [OE-core] [PATCH v15 00/12] rpm: 4.20.1 -> 6.0.2
Date: Mon, 24 Aug 2026 19:01:47 +0100	[thread overview]
Message-ID: <a1b73fb481ecc936d51a96f27e957a8aebf2a8d9.camel@linuxfoundation.org> (raw)
In-Reply-To: <7c99f641-a213-4524-acdf-1ecf782d06ba@windriver.com>

Hi Sumanth,

On Fri, 2026-08-21 at 23:49 +0000, Sumanth Gavini via lists.openembedded.org wrote:
> > Yes, I think we need to disable them.
> > 
> > Before we do that, I would like to understand what information this
> > changes and whether there are dependencies we're going to miss out
> > on that we really need to add to do_package.
> > 
> > So there are two things to work out:
> > 
> > - What information do we lose by turning off the rpm 4 rpmdep code in
> > do_package? Do we need to add/find some of it differently?
> > 
> > - What information do we lose by turning off the RPM 6 autogenerated
> > dependencies and is there any of that we need to add separately to
> > do_package somehow?
> 
> Thank you for the detailed questions. I went through the source code to
> answer both fully.
> 
> ---
> Q1: What do we lose by turning off the RPM 4 rpmdep code in do_package?
>      Do we need to add/find some of it differently?
> 
> Nothing is lost and nothing needs to be added differently.
> 
> In RPM 4, the dep generation in rpmbuild was explicitly disabled:
> 
>    package_rpm.bbclass (rpm_old):
>      line 661: --define '_use_internal_dependency_generator 0'
>      line 675: --define '__find_requires %{nil}'
>      line 676: --define '__find_provides %{nil}'
> 
> rpmbuild contributed zero file-based deps. The actual dep data came
> from a separate tool — rpmdeps — which runs in package_do_filedeps,
> defined in package.bbclass (shared across all backends):
> 
>    package.bbclass:402
>      RPMDEPS = "rpmdeps --alldeps --define '__font_provides %{nil}'"
> 
>    package.bbclass:404
>      python package_do_filedeps()  → calls oe.package.process_filedeps()
> 
>    meta/lib/oe/package.py:280
>      output = subprocess.check_output(shlex.split(rpmdeps) + pkgfiles)
> 
> rpmdeps uses the fileattr system internally (macros.in default:
> _use_internal_dependency_generator = 1), so it generates ELF soname,
> script interpreter and pkgconfig() deps. Results are stored in
> FILERDEPENDS/FILERPROVIDES (package.py:1654) and written into the
> RPM spec via get_perfile():
> 
>    RPM4 package_rpm.bbclass:368
>      if not perfiledeps:   ← True with default MERGEPERFILEDEPS=1
>          splitrdepends += get_perfile('RDEPENDS', pkg, d)   # line 370
>          splitrprovides += get_perfile('RPROVIDES', pkg, d) # line 371
> 
> In RPM 6 this is unchanged and now unconditional:
> 
>    RPM6 package_rpm.bbclass:303
>      splitrdepends  += get_perfile('RDEPENDS',  pkg, d)
>      splitrprovides += get_perfile('RPROVIDES', pkg, d)
> 
> Alongside this, two more backend-independent pipelines run unchanged:
>    package.bbclass:411  package_do_shlibs     — objdump -p → OE package
>                                                 name deps → RDEPENDS
>    package.bbclass:415  package_do_pkgconfig  — .pc file parsing → OE
>                                                 package name deps → RDEPENDS
> 
> All three pipelines are identical between RPM 4 and RPM 6 (confirmed
> by diff of package.bbclass and package.py between the two directories —
> only two unrelated lines differ in package.py, neither affecting deps).


Thanks, this helps a lot. Just to confirm, rpmdeps in v6 generates the
same information as we're seeing with rpmdeps v4, so the dependency
information output by the call during do_package is unchanged?

> Q2: What do we lose by turning off the RPM 6 autogenerated dependencies?
>      Is there any that we need to add separately to do_package?
> 
> Nothing is lost and nothing needs to be added to do_package.
> 
> In RPM 6, setting _use_internal_dependency_generator 0 is no longer
> silently ignored — it is a hard build error for v6-format packages:
> 
>    rpm/build/workspace/sources/rpm/build/rpmfc.cc:1618
>      if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) {
>          if (fc->rpmformat < 6) {
>              rc = rpmfcApplyExternal(fc);   // RPM4: allowed
>          } else {
>              rpmlog(RPMLOG_ERR,
>                  _("External dependency generator is incompatible "
>                    "with v6 packages\n"));
>              rc = RPMRC_FAIL;               // RPM6: hard error
>          }
>      } else {
>          rc = rpmfcApplyInternal(fc);       // fileattr system runs
>      }
> 
> So the only way to suppress deps in RPM 6 is per generator. The 12
> fileattr generators are verified from:
> 
>    rpm/build/workspace/sources/rpm/fileattrs/
> 
> Their status:
> 
>    FULLY SUPPRESSED in v15:
>    - font.attr     :__font_provides %{nil} (package_rpm.bbclass:601)
>                     __font_requires is already %{nil} in the attr file
>    - sysusers.attr :__sysusers_path %{nil} (package_rpm.bbclass:606)
>                     path=nil means no files match, entire generator disabled
>                      __sysusers_requires also nil via 
> _use_weak_usergroup_deps 1
>                     (package_rpm.bbclass:607, existed in RPM4 too)
> 
>    PARTIALLY SUPPRESSED in v15:
>    - pkgconfig.attr : Requires: __pkgconfig_requires %{nil}
>                       (package_rpm.bbclass:602)
>                       Provides: still active → needs 
> __pkgconfig_provides %{nil}
> 
>    NOT YET SUPPRESSED — needed in v16:
>    - elf.attr      :Provides: libfoo.so.1 / Requires: libfoo.so.1
>                     (duplicate of package_do_filedeps via rpmdeps — same
>                      elfdeps tool; ipk/deb do not generate soname deps)
>    - script.attr   : Requires: /bin/bash, /usr/bin/python3
>                     (duplicate of package_do_filedeps via rpmdeps — same
>                      script.req tool; ipk/deb do not generate these)
>    - pkgconfig.attr :Provides → pkgconfig(foo)
>                     (duplicate of package_do_filedeps; ipk/deb do not
>                      generate pkgconfig() deps)
>    - desktop.attr  :Provides: application(), mimehandler(text/html)
>                     (not in any OE pipeline; ipk/deb do not generate these)
>    - debuginfo.attr :Provides: debuginfo(build-id) = abc123
>                     (not in any OE pipeline; ipk/deb do not generate these)
>    - metainfo.attr :Provides: metainfo(), metainfo(foo.xml)
>                     (not in any OE pipeline; ipk/deb do not generate these)
>    - ocaml.attr   :Provides/Requires: ocaml(Foo)
>                     (not in any OE pipeline; ipk/deb do not generate these)
>    - rpm_lua.attr : Provides: rpm_lua(foo.bar)
>                     (not in any OE pipeline; ipk/deb do not generate these)
>    - rpm_macro.attr :Provides: RPM macro file provides
>                     (not in any OE pipeline; ipk/deb do not generate these)
>    - usergroup.attr: Provides: user(name), group(name)
>                     (not in any OE pipeline; ipk/deb do not generate these)
> 
> For elf and script the suppression removes duplicates — the same deps
> are already in the spec from package_do_filedeps via get_perfile().
> 
> For desktop, debuginfo, metainfo, ocaml, rpm_lua, rpm_macro and
> usergroup, these are RPM-specific Provides that ipk/deb never generate.
> Adding them to do_package would create exactly the backend inconsistency
> you raised. They should be suppressed, not preserved.
> 
> v16 will add the following to package_rpm.bbclass:
> 
>    cmd += " --define '__elf_requires %{nil}'"
>    cmd += " --define '__elf_provides %{nil}'"
>    cmd += " --define '__script_requires %{nil}'"
>    cmd += " --define '__pkgconfig_provides %{nil}'"
>    cmd += " --define '__desktop_provides %{nil}'"
>    cmd += " --define '__debuginfo_provides %{nil}'"
>    cmd += " --define '__metainfo_provides %{nil}'"
>    cmd += " --define '__ocaml_requires %{nil}'"
>    cmd += " --define '__ocaml_provides %{nil}'"
>    cmd += " --define '__rpm_lua_provides %{nil}'"
>    cmd += " --define '__rpm_macro_provides %{nil}'"
>    cmd += " --define '__usergroup_provides %{nil}'"
> 
> This restores the same zero auto-dep behaviour OE had with RPM 4,
> keeping all three backends (rpm, ipk, deb) consistent.
> 
> Please review the above analysis, I am currently working on oe-selftest
> failure(runtime_test.Postinst.test_failing_postinst).
> Once the analysis looks good to you, I will include the above 
> suppression changes together with the selftest fix in v16.

Thanks, this really helps. I think we need to open a bug about
analysing what output we're missing out on here and whether it would
make sense to capture some of it but we can think about that as a
separate issue longer term compared to the more urgent upgrade.

I'm assuming this output is available from rpmdeps when called
externally too?

Regardless, I'm much happier now this has been properly checked into
and detailed.

Cheers,

Richard



      reply	other threads:[~2026-08-24 18:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16 23:10 [PATCH v15 00/12] rpm: 4.20.1 -> 6.0.2 Sumanth Gavini
2026-08-16 23:10 ` [PATCH v15 01/12] package_rpm.bbclass: Drop external dependency generator to support rpm 6 Sumanth Gavini
2026-08-17  8:55   ` Mathieu Dubois-Briand
2026-08-17 13:34     ` Gavini, Sumanth
2026-08-17 14:48       ` Mathieu Dubois-Briand
2026-08-17 20:15         ` Alexander Kanavin
2026-08-19  7:10         ` Mathieu Dubois-Briand
2026-08-22  9:05   ` [OE-core] " Richard Purdie
2026-08-16 23:10 ` [PATCH v15 02/12] package_rpm.bbclass: Define _lib and _libdir for rpmbuild Sumanth Gavini
2026-08-16 23:10 ` [PATCH v15 03/12] lib/oe/package.py: Don't add ldconfig_postinst_fragment for glibc or musl Sumanth Gavini
2026-08-16 23:10 ` [PATCH v15 04/12] lib/oe/package.py: Don't redirect stderr Sumanth Gavini
2026-08-16 23:10 ` [PATCH v15 05/12] target-sdk-provides-dummy: Add pkg-config to DUMMYPROVIDES Sumanth Gavini
2026-08-16 23:10 ` [PATCH v15 06/12] rpm: 4.20.1 -> 6.0.2 Sumanth Gavini
2026-08-16 23:10 ` [PATCH v15 07/12] libarchive: Make it work with rpm 6.0.2 Sumanth Gavini
2026-08-16 23:11 ` [PATCH v15 08/12] rpm: Fix pkgconfig() Provides missing in cross-built RPMs Sumanth Gavini
2026-08-16 23:11 ` [PATCH v15 09/12] libarchive: Add RPM format reader to support rpm 6 Sumanth Gavini
2026-08-16 23:11 ` [PATCH v15 10/12] libarchive: Disable RPM filter auto-bidding and update huge_rpm test Sumanth Gavini
2026-08-23  8:06   ` [OE-core] " Richard Purdie
2026-08-16 23:11 ` [PATCH v15 11/12] package_rpm.bbclass: Suppress pkgconfig() Requires for sstate compatibility Sumanth Gavini
2026-08-16 23:11 ` [PATCH v15 12/12] lib/oe/package_manager/rpm: Enable DNF filelists to resolve file deps Sumanth Gavini
2026-08-17 22:20 ` [OE-core] [PATCH v15 00/12] rpm: 4.20.1 -> 6.0.2 Richard Purdie
2026-08-18  1:13   ` Ryan Eatmon
2026-08-18 16:09   ` Gavini, Sumanth
2026-08-18 21:05     ` Richard Purdie
2026-08-21 23:49       ` Gavini, Sumanth
2026-08-24 18:01         ` Richard Purdie [this message]

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=a1b73fb481ecc936d51a96f27e957a8aebf2a8d9.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=Randy.MacLeod@windriver.com \
    --cc=alex.kanavin@gmail.com \
    --cc=esparlin@cisco.com \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=mattware@cisco.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.marko@siemens.com \
    --cc=sumanth.gavini@windriver.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.