* [PATCH 1/2] meta/classes-recipe/toolchain-scripts.bbclass: eliminate bash-ism
@ 2025-10-07 18:21 Alexander Kanavin
2025-10-07 18:21 ` [PATCH 2/2] selftest/meta_ide: source the environment first, then change to the sources directory Alexander Kanavin
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2025-10-07 18:21 UTC (permalink / raw)
To: openembedded-core; +Cc: Alexander Kanavin
From: Alexander Kanavin <alex@linutronix.de>
Sourcing a script with arguments is a non-standard bash extension
and doesn't work with other shells (e.g. dash, which is used on
Debian and derivatives). This used to work by coincidence when
running against integrated poky repo without having to separately
specify where bitbake is, but no longer does.
Using set is a POSIX standard.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
meta/classes-recipe/toolchain-scripts.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass
index ec040b5ebbe..8c062ef0e74 100644
--- a/meta/classes-recipe/toolchain-scripts.bbclass
+++ b/meta/classes-recipe/toolchain-scripts.bbclass
@@ -92,7 +92,7 @@ toolchain_create_tree_env_script () {
touch $script
echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script
echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script
- echo "orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR} $bitbakedir; cd \$orig" >> $script
+ echo "orig=`pwd`; cd ${COREBASE}; set ${TOPDIR} $bitbakedir; . ./oe-init-build-env; cd \$orig" >> $script
echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script
echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script
echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] selftest/meta_ide: source the environment first, then change to the sources directory
2025-10-07 18:21 [PATCH 1/2] meta/classes-recipe/toolchain-scripts.bbclass: eliminate bash-ism Alexander Kanavin
@ 2025-10-07 18:21 ` Alexander Kanavin
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2025-10-07 18:21 UTC (permalink / raw)
To: openembedded-core; +Cc: Alexander Kanavin
From: Alexander Kanavin <alex@linutronix.de>
This too used to work by coincidence: sourcing the environment
quietly failed without changing to the build directory, but
now that it works properly, things should be done in correct order.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
meta/lib/oeqa/selftest/cases/meta_ide.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/meta_ide.py b/meta/lib/oeqa/selftest/cases/meta_ide.py
index c3a7df4cdf5..1a114737975 100644
--- a/meta/lib/oeqa/selftest/cases/meta_ide.py
+++ b/meta/lib/oeqa/selftest/cases/meta_ide.py
@@ -37,7 +37,7 @@ class MetaIDE(OESelftestTestCase):
def test_meta_ide_can_compile_c_program(self):
runCmd('cp %s/test.c %s' % (self.tc.files_dir, self.tmpdir_metaideQA))
- runCmd("cd %s; . %s; $CC test.c -lm" % (self.tmpdir_metaideQA, self.environment_script_path))
+ runCmd(". %s; cd %s; $CC test.c -lm" % (self.environment_script_path, self.tmpdir_metaideQA))
compiled_file = '%s/a.out' % self.tmpdir_metaideQA
self.assertExists(compiled_file)
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-07 18:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07 18:21 [PATCH 1/2] meta/classes-recipe/toolchain-scripts.bbclass: eliminate bash-ism Alexander Kanavin
2025-10-07 18:21 ` [PATCH 2/2] selftest/meta_ide: source the environment first, then change to the sources directory Alexander Kanavin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox