* [PATCH v2] ruby: scrub build host paths from rbconfig.rb for nativesdk too
@ 2026-08-06 11:58 Trevor Woerner
0 siblings, 0 replies; only message in thread
From: Trevor Woerner @ 2026-08-06 11:58 UTC (permalink / raw)
To: openembedded-core
rbconfig.rb records the flags ruby was configured with, which include the
recipe sysroot, the hosttools directory and the debug prefix map, all of
them paths on the machine that did the build. The recipe removes them,
but only for class-target, so a nativesdk build ships them.
Nothing noticed because nativesdk-ruby has not been installed into an
SDK before. Doing so fails do_package_qa outright:
QA Issue: File .../rbconfig.rb in package nativesdk-ruby contains
reference to TMPDIR [buildpaths]
Move the scrubbing into a function and call it for class-nativesdk as
well as class-target.
Deliberately not for class-native. A native rbconfig.rb names paths
inside the native sysroot, and those are correct: stripping them leaves
the file pointing at the build host's /usr, which breaks every recipe
that builds anything with ruby-native. With the scrub applied to native,
DLDFLAGS becomes
-L/usr/lib -L/lib -Wl,-rpath,/usr/lib ...
and CFLAGS becomes -isystem/usr/include. Nothing packages a native
rbconfig.rb, so there is no reason to touch it.
AI-Generated: codex/claude-opus 5 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
meta/recipes-devtools/ruby/ruby_4.0.6.bb | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/ruby/ruby_4.0.6.bb b/meta/recipes-devtools/ruby/ruby_4.0.6.bb
index 13b6746bbeb3..2bbe434f196a 100644
--- a/meta/recipes-devtools/ruby/ruby_4.0.6.bb
+++ b/meta/recipes-devtools/ruby/ruby_4.0.6.bb
@@ -78,7 +78,7 @@ EXTRA_OECONF:append:libc-musl = "\
PARALLEL_MAKEINST = ""
-do_install:append:class-target () {
+ruby_scrub_rbconfig () {
rbconfig_rb=`find ${D} -name rbconfig.rb`
# Remove build host directories
sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
@@ -97,6 +97,16 @@ do_install:append:class-target () {
find ${D} -name gem_make.out -delete
}
+# Not for class-native: those paths point into the native sysroot and are
+# correct there, and scrubbing them leaves ruby-native naming the host's /usr.
+do_install:append:class-target () {
+ ruby_scrub_rbconfig
+}
+
+do_install:append:class-nativesdk () {
+ ruby_scrub_rbconfig
+}
+
do_install_ptest () {
cp -rf ${S}/test ${D}${PTEST_PATH}/
install -D ${S}/tool/test/init.rb ${D}${PTEST_PATH}/tool/test/init.rb
--
2.50.0.173.g8b6f19ccfc3a
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-06 11:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 11:58 [PATCH v2] ruby: scrub build host paths from rbconfig.rb for nativesdk too Trevor Woerner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox