diff mbox series

[1/2] coreutils: fix ptest build error with single-binary

Message ID 20250508072814.106107-1-ovidiu.panait@windriver.com
State New
Headers show
Series [1/2] coreutils: fix ptest build error with single-binary | expand

Commit Message

Ovidiu Panait May 8, 2025, 7:28 a.m. UTC
From: Ovidiu Panait <ovidiu.panait@windriver.com>

When coreutils has 'single-binary' PACKAGECONFIG enabled, coreutils-ptest
build fails with the following errors:
DISTRO_FEATURES:append = " ptest"
EXTRA_IMAGE_FEATURES += " ptest-pkgs"
PACKAGECONFIG:append:pn-coreutils = " single-binary"

bitbake coreutils
....
ERROR: coreutils-9.6-r0 do_package_qa: QA Issue: File /usr/lib/coreutils/ptest/src/pwd in package coreutils-ptest contains reference to TMPDIR [buildpaths]
ERROR: coreutils-9.6-r0 do_package_qa: QA Issue: coreutils-ptest: /usr/lib/coreutils/ptest/src/pwd maximum shebang size exceeded, the maximum size is 128. [shebang-size]

To fix this, use /usr/bin/env shebangs in ptest files and get rid of build
host paths.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---
 meta/recipes-core/coreutils/coreutils_9.6.bb | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-core/coreutils/coreutils_9.6.bb b/meta/recipes-core/coreutils/coreutils_9.6.bb
index b876a8fdd0..fe2cf73d40 100644
--- a/meta/recipes-core/coreutils/coreutils_9.6.bb
+++ b/meta/recipes-core/coreutils/coreutils_9.6.bb
@@ -215,6 +215,12 @@  do_install_ptest () {
     
     # handle multilib
     sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'single-binary', 'true', 'false', d)}; then
+        find "${D}${PTEST_PATH}/src" -type f -exec \
+            sed -i -e 's:${B}/src/coreutils:/usr/bin/env -S coreutils:g' \
+            {} +
+    fi
 }
 
 do_install_ptest:append:libc-musl () {