All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH] rpm: disable the RPM 6 script interpreter dependency generator
@ 2026-10-22  8:46 Roshan Sivakumar
  2026-10-22 12:19 ` Peter Kjellerstedt
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Roshan Sivakumar @ 2026-10-22  8:46 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sumanth Gavini, Roshan Sivakumar

RPM 4 generated dependencies with the external __find_requires /
__find_provides generator, which OE disabled entirely via
_use_internal_dependency_generator 0. RPM 6 removed that mechanism; for
v6-format packages only the internal fileattr generators run.

rpm's script.attr generator therefore runs for the first time in OE
builds. For every packaged executable whose first line is a #! shebang
it emits an interpreter dependency. kernel-devsrc ships
scripts/mksysmap (#!/bin/sed -f) as an executable, so its package gains:

  Requires: /bin/sed

OE manages build and runtime dependencies explicitly through
DEPENDS / RDEPENDS and does not want these. They break real use cases:

- The interpreter path is taken verbatim from the shebang. A #!/bin/sed
  script requires /bin/sed, but under usrmerge the only provider
  (busybox) offers /usr/bin/sed. The literal paths never match and the
  package becomes uninstallable.
- In the SDK the sole interpreter providers (busybox, coreutils, bash,
  perl) are deliberately banned by target-sdk-provides-dummy, so these
  auto-generated requires make -dev/-src packages uninstallable during
  do_populate_sdk ("nothing provides /bin/sed needed by kernel-devsrc").
- The requires are non-reproducible: they are only emitted when the
  interpreter is scanned from the shebang during packaging, so the same
  recipe can produce different packages between the reproducible A and
  B builds.

This is the same class of regression already handled for the pkgconfig
generator; see "rpm: disable the RPM 6 pkgconfig dependency generator".

Suppressing the generator from the rpmbuild command line
(__requires_exclude / __script_requires set to %{nil}) is not reliable:
rpm reloads the fileattr macros during dependency generation and
clobbers the --define. Remove script.attr and its helper script.req
from rpm's install lists via a source patch. This changes
do_unpack/do_patch, so the whole rpm recipe and everything downstream
re-hash and no stale rpm-native is reused.

Signed-off-by: Roshan Sivakumar <roshs@qti.qualcomm.com>
---
 ...he-script-interpreter-dependency-gen.patch | 72 +++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_6.0.2.bb        |  1 +
 2 files changed, 73 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/files/0004-Do-not-install-the-script-interpreter-dependency-gen.patch

diff --git a/meta/recipes-devtools/rpm/files/0004-Do-not-install-the-script-interpreter-dependency-gen.patch b/meta/recipes-devtools/rpm/files/0004-Do-not-install-the-script-interpreter-dependency-gen.patch
new file mode 100644
index 0000000000..8c3d1769c8
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0004-Do-not-install-the-script-interpreter-dependency-gen.patch
@@ -0,0 +1,72 @@
+From: Roshan Sivakumar <roshs@qti.qualcomm.com>
+Date: Thu, 16 Oct 2026 00:00:00 +0000
+Subject: [PATCH] Do not install the script interpreter dependency generator
+
+RPM 4 generated dependencies with the external __find_requires /
+__find_provides generator, which OE disabled entirely via
+_use_internal_dependency_generator 0. RPM 6 removed that mechanism; for
+v6-format packages only the internal fileattr generators run.
+
+rpm's script.attr generator therefore runs for the first time in OE
+builds. For every packaged executable whose first line is a #! shebang
+it adds an interpreter dependency, e.g. a kernel-devsrc package shipping
+scripts/mksysmap (#!/bin/sed -f) gains:
+
+  Requires: /bin/sed
+
+OpenEmbedded manages build and runtime dependencies explicitly via
+DEPENDS/RDEPENDS and does not want these. They break real use cases:
+
+- The literal interpreter path is taken verbatim from the shebang, so a
+  #!/bin/sed script requires /bin/sed while the only provider (busybox)
+  offers /usr/bin/sed under usrmerge. The paths never match and the
+  package is uninstallable.
+- In the SDK the sole interpreter providers (busybox, coreutils, bash,
+  perl) are deliberately banned by target-sdk-provides-dummy, so these
+  auto-generated requires make -dev/-src packages uninstallable during
+  do_populate_sdk ("nothing provides /bin/sed").
+- The requires are non-reproducible: they are only emitted when the
+  interpreter happens to be scanned from the shebang in the build
+  sysroot, so the same recipe can produce different packages.
+
+This is the same class of problem fixed for pkgconfig.attr; see
+"rpm: disable the RPM 6 pkgconfig dependency generator".
+
+Suppressing the generator from the rpmbuild command line is not
+reliable: rpm reloads the fileattr macros during dependency generation
+and clobbers any --define. Remove script.attr and its helper script.req
+from rpm's install lists via a source patch. This changes
+do_unpack/do_patch, so the whole rpm recipe and everything downstream
+re-hash and no stale rpm-native is reused.
+
+Upstream-Status: Inappropriate [OE policy: dependencies are managed by the build system, not generated by rpmbuild]
+
+Signed-off-by: Roshan Sivakumar <roshs@qti.qualcomm.com>
+---
+ fileattrs/CMakeLists.txt | 2 +-
+ scripts/CMakeLists.txt   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fileattrs/CMakeLists.txt b/fileattrs/CMakeLists.txt
+--- a/fileattrs/CMakeLists.txt
++++ b/fileattrs/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ install(FILES
+ 	debuginfo.attr desktop.attr elf.attr font.attr metainfo.attr
+ 	ocaml.attr
+-	rpm_macro.attr rpm_lua.attr script.attr sysusers.attr usergroup.attr
++	rpm_macro.attr rpm_lua.attr sysusers.attr usergroup.attr
+ 	DESTINATION ${RPM_CONFIGDIR}/fileattrs
+ )
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -6,7 +6,7 @@ install(PROGRAMS
+ 	check-buildroot check-rpaths check-rpaths-worker
+ 	find-lang.sh find-requires find-provides
+ 	ocamldeps.sh
+-	fontconfig.prov script.req
++	fontconfig.prov
+ 	rpm_macros_provides.sh
+ 	rpmdb_dump rpmdb_load
+ 	rpm2cpio.sh tgpg
diff --git a/meta/recipes-devtools/rpm/rpm_6.0.2.bb b/meta/recipes-devtools/rpm/rpm_6.0.2.bb
index c27f58a0e8..6c80c839ca 100644
--- a/meta/recipes-devtools/rpm/rpm_6.0.2.bb
+++ b/meta/recipes-devtools/rpm/rpm_6.0.2.bb
@@ -40,6 +40,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;protocol=https;branch=rp
            file://0001-tools-elfdeps.cc-Remove-format-module.patch \
            file://0001-macros.in-Set-_pkgverify_level-to-digest-as-RCPM-4.2.patch \
            file://0003-Do-not-install-the-pkgconfig-dependency-generator.patch \
+           file://0004-Do-not-install-the-script-interpreter-dependency-gen.patch \
            "
 
 PE = "1"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-29 14:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22  8:46 [OE-core][PATCH] rpm: disable the RPM 6 script interpreter dependency generator Roshan Sivakumar
2026-10-22 12:19 ` Peter Kjellerstedt
2026-10-23  7:41   ` Roshan Sivakumar
     [not found]   ` <18E118B84815B8D6.4141359@lists.openembedded.org>
2026-10-25 13:48     ` Roshan Sivakumar
2026-10-27 16:14       ` Peter Kjellerstedt
2026-10-23  7:37 ` [PATCH] " Roshan Sivakumar
2026-10-29 14:29 ` [OE-core][PATCH] " Alexander Kanavin

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.