diff mbox series

[v9,4/8] lib/oe/package.py: Filter out /usr/bin/pkg-config file dependency

Message ID 20260724200424.954199-5-sumanth.gavini@windriver.com
State New
Headers show
Series rpm: 4.20.1 -> 6.0.2 | expand

Commit Message

Sumanth Gavini July 24, 2026, 8:04 p.m. UTC
RPM's pkgconfig.attr fileattr auto-detects /usr/bin/pkg-config as a
Requires dependency for any package that ships .pc files. This causes
every -dev package to have a hard runtime dependency on pkg-config.

pkg-config is a development/build tool used at compile time to locate
libraries and flags via .pc files. It is not required at runtime on the
target.

Without this filter, do_rootfs and do_populate_sdk fail with errors
like:

  Error: nothing provides /usr/bin/pkg-config needed by
  python3-dev-3.14.6-r0.x86_64_v3 from oe-repo

This is triggered when IMAGE_FEATURES includes "ptest-pkgs" or
"dev-pkgs", or when building SDKs, because -dev packages are pulled
in and dnf cannot resolve the /usr/bin/pkg-config file dependency.

The fix filters this dependency at package generation time in
filedeprunner(), consistent with the existing filtering of python()
and perl() auto-dependencies in the same function.

Note: pkgconfig(foo) symbolic dependencies (e.g., pkgconfig(glib-2.0))
are NOT affected by this filter  they continue to work correctly for
build-time dependency resolution.

Signed-off-by: Sumanth Gavini <sumanth.gavini@windriver.com>
---
 meta/lib/oe/package.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 8ccd89a190..d210b4a73b 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -253,6 +253,20 @@  def filedeprunner(pkg, pkgfiles, rpmdeps, pkgdest):
             if dep.startswith("python("):
                 continue
 
+            # Ignore the file dependency on /usr/bin/pkg-config. RPM's
+            # pkgconfig.attr fileattr auto-detects this as a Requires for
+            # any package that ships .pc files. However, pkg-config is a
+            # development/build tool used at compile time to locate
+            # libraries and their flags — it is not needed at runtime.
+            # Without this filter, every -dev package would pull in
+            # pkg-config as a hard runtime dependency, causing do_rootfs
+            # and do_populate_sdk failures when pkg-config is not
+            # explicitly included in IMAGE_INSTALL or TOOLCHAIN_TARGET_TASK.
+            # This is consistent with how we already filter python() and
+            # perl() auto-dependencies above.
+            if dep == '/usr/bin/pkg-config':
+                continue
+
             # Ignore all perl(VMS::...) and perl(Mac::...) dependencies. These
             # are typically used conditionally from the Perl code, but are
             # generated as unconditional dependencies.