summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2025-10-06 21:10:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-07 22:31:08 +0100
commit1ec63fc63c93fd8518f1181892de87683df52f07 (patch)
treee9f535ac87ead539ddbb82c57d2a9ef8db34e0a5
parentcd0915faa31a16dcc18f67252de8bf9a6551a595 (diff)
downloadpoky-1ec63fc63c93fd8518f1181892de87683df52f07.tar.gz
toolchain-scripts.bbclass: fix bitbake-setup compatibility
Pass the BITBAKEDIR parameter to oe-init-build-env when called from the environment-setup script. This fixes compatibility with bitbake-setup, which places bitbake in a different directory structure than the standard poky repository layout where bitbake is located alongside oe-init-build-env. The issue was discovered when running the oe-selftest test DevtoolIdeSdkTests.test_devtool_ide_sdk_shared_sysroots, which failed because the environment-setup script was not able to find bitbake. File ".../openembedded-core/meta/lib/oeqa/selftest/cases/devtool.py", line 2955, in test_devtool_ide_sdk_shared_sysroots self.assertExists(cmake_native) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File ".../openembedded-core/meta/lib/oeqa/selftest/case.py", line 251, in assertExists raise self.failureException(msg) AssertionError: 'Error: The bitbake directory (/tmp/devtoolqah9ndff2x/bitbake) does not exist! Please ensure a copy of bitbake exists at this location or specify an alternative path on the command line\n .../build-st/tmp/sysroots/x86_64/usr/bin/cmake' does not exist (From OE-Core rev: ea33cf924200d56d5263a7b45266a064490b1c1f) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/toolchain-scripts.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass
index 5d28df845b..ec040b5ebb 100644
--- a/meta/classes-recipe/toolchain-scripts.bbclass
+++ b/meta/classes-recipe/toolchain-scripts.bbclass
@@ -87,11 +87,12 @@ toolchain_create_sdk_env_script () {
87# Caller must ensure CONFIG_SITE is setup 87# Caller must ensure CONFIG_SITE is setup
88toolchain_create_tree_env_script () { 88toolchain_create_tree_env_script () {
89 script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} 89 script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
90 bitbakedir=$(readlink -f ${BITBAKEPATH}/..)
90 rm -f $script 91 rm -f $script
91 touch $script 92 touch $script
92 echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script 93 echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script
93 echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script 94 echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script
94 echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script 95 echo "orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR} $bitbakedir; cd \$orig" >> $script
95 echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script 96 echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script
96 echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script 97 echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script
97 echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script 98 echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script