]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
toolchain-scripts.bbclass: fix bitbake-setup compatibility
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Mon, 6 Oct 2025 19:10:55 +0000 (21:10 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 Oct 2025 09:27:02 +0000 (10:27 +0100)
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

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/toolchain-scripts.bbclass

index 5d28df845b88e614cb887bf0cfc56562705ca52d..ec040b5ebbe20252e6735999e9ce5d4e11c2eaa5 100644 (file)
@@ -87,11 +87,12 @@ toolchain_create_sdk_env_script () {
 # Caller must ensure CONFIG_SITE is setup
 toolchain_create_tree_env_script () {
        script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+       bitbakedir=$(readlink -f ${BITBAKEPATH}/..)
        rm -f $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}; cd $orig' >> $script
+       echo "orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR} $bitbakedir; 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