diff mbox series

ruby: strip the build machine triplet from rbconfig.rb

Message ID 20260927154119.1129073-1-sunilkumar.dora@windriver.com
State New
Headers show
Series ruby: strip the build machine triplet from rbconfig.rb | expand

Commit Message

Dora, Sunil Kumar Sept. 27, 2026, 3:41 p.m. UTC
From: Sunil Dora <sunilkumar.dora@windriver.com>

rbconfig.rb records the configure arguments and the autoconf build
triplet (CONFIG["build"], "build_cpu", "build_vendor", "build_alias").
These describe the machine ruby was built on, so the package differs
between the x86_64 and aarch64 autobuilder workers. Drop the two
configure_args tokens and blank the four CONFIG values in
ruby_scrub_rbconfig, which already cleans build paths out of this file.
build_os is left alone: it is the same on every host and mkmf.rb reads it.

[YOCTO #16376]

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 meta/recipes-devtools/ruby/ruby_4.0.7.bb | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/ruby/ruby_4.0.7.bb b/meta/recipes-devtools/ruby/ruby_4.0.7.bb
index 324de86f8c..d8dcde5fbb 100644
--- a/meta/recipes-devtools/ruby/ruby_4.0.7.bb
+++ b/meta/recipes-devtools/ruby/ruby_4.0.7.bb
@@ -91,6 +91,15 @@  ruby_scrub_rbconfig () {
            -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
         $rbconfig_rb
 
+    # Remove the build host triplet (build_os is the same on every host)
+    sed -i -e "s|'--build=${BUILD_SYS}' ||g" \
+           -e "s|'build_alias=${BUILD_SYS}' ||g" \
+           -e 's|^\([[:space:]]*CONFIG\["build_vendor"\] = \).*|\1""|' \
+           -e 's|^\([[:space:]]*CONFIG\["build_cpu"\] = \).*|\1""|' \
+           -e 's|^\([[:space:]]*CONFIG\["build"\] = \).*|\1""|' \
+           -e 's|^\([[:space:]]*CONFIG\["build_alias"\] = \).*|\1""|' \
+        $rbconfig_rb
+
     sed -i -e 's|${DEBUG_PREFIX_MAP}||g' \
         ${D}${libdir}/pkgconfig/*.pc