summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2025-10-06 00:00:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-05 23:47:05 +0100
commit24f8ed2e6b2d6843c25f49357c07ee3000f061e1 (patch)
tree869d5164012fd5a2c97a30e224bb8b1794c2b248 /scripts/lib
parent4c63dcf36150449ab9a3fe5c366860f690563cf2 (diff)
downloadpoky-24f8ed2e6b2d6843c25f49357c07ee3000f061e1.tar.gz
devtool: ide_sdk: pass BITBAKEDIR to oe-init-build-env
This fixes an issue where the generated install_and_deploy script is unable to find the bitbake directory when run outside of the build environment. This happens if the oe-selftest suite runs in a bitbake environment that is bootstrapped by bitbake-setup. oe-selftest -r devtool.DevtoolIdeSdkTests.test_devtool_ide_sdk_none_qemu AssertionError: Command '.../build-st/workspace/ide-sdk/cmake-example/ scripts/install_and_deploy_cmake-example-cortexa57' returned non-zero exit status 1: Error: The bitbake directory (/tmp/devtoolqakq7kzgeo/bitbake) does not exist! Please ensure a copy of bitbake exists at this location or specify an alternative path on the command line . /tmp/devtoolqakq7kzgeo/core-copy/oe-init-build-env /home/adrian/bitbake-builds/poky-master-poky-with-sstate-distro_poky-altcfg-machine_qemuarm64/build-st failed Another reason this issue occurs with oe-selftests is that devtool tests assume the full poky git repository is available. The setUpModule function clones layer repositories, which for poky includes bitbake. However, when using separate git repositories for bitbake and openembedded-core, the bitbake directory is not preserved during layer copying. While copying layers to allow modification during tests makes sense, copying bitbake is less beneficial. Referring to the original bitbake location is preferable, but cleaning up the devtool tests is not part of this change. (From OE-Core rev: e233292008cd4ea0c0726b07b773e6a7868011d8) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rwxr-xr-xscripts/lib/devtool/ide_sdk.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py
index ccb6cfbc61..d9b54f7991 100755
--- a/scripts/lib/devtool/ide_sdk.py
+++ b/scripts/lib/devtool/ide_sdk.py
@@ -286,6 +286,7 @@ class RecipeModified:
286 self.b = None 286 self.b = None
287 self.base_libdir = None 287 self.base_libdir = None
288 self.bblayers = None 288 self.bblayers = None
289 self.bitbakepath = None
289 self.bpn = None 290 self.bpn = None
290 self.d = None 291 self.d = None
291 self.debug_build = None 292 self.debug_build = None
@@ -346,6 +347,7 @@ class RecipeModified:
346 self.b = recipe_d.getVar('B') 347 self.b = recipe_d.getVar('B')
347 self.base_libdir = recipe_d.getVar('base_libdir') 348 self.base_libdir = recipe_d.getVar('base_libdir')
348 self.bblayers = recipe_d.getVar('BBLAYERS').split() 349 self.bblayers = recipe_d.getVar('BBLAYERS').split()
350 self.bitbakepath = recipe_d.getVar('BITBAKEPATH')
349 self.bpn = recipe_d.getVar('BPN') 351 self.bpn = recipe_d.getVar('BPN')
350 self.cxx = recipe_d.getVar('CXX') 352 self.cxx = recipe_d.getVar('CXX')
351 self.d = recipe_d.getVar('D') 353 self.d = recipe_d.getVar('D')
@@ -712,11 +714,11 @@ class RecipeModified:
712 """Generate a script which does install and deploy""" 714 """Generate a script which does install and deploy"""
713 cmd_lines = ['#!/bin/sh'] 715 cmd_lines = ['#!/bin/sh']
714 716
715 # . oe-init-build-env $BUILDDIR 717 # . oe-init-build-env $BUILDDIR $BITBAKEDIR
716 # Using 'set' to pass the build directory to oe-init-build-env in sh syntax 718 # Using 'set' to pass the build directory to oe-init-build-env in sh syntax
717 cmd_lines.append('cd "%s" || { echo "cd %s failed"; exit 1; }' % ( 719 cmd_lines.append('cd "%s" || { echo "cd %s failed"; exit 1; }' % (
718 self.oe_init_dir, self.oe_init_dir)) 720 self.oe_init_dir, self.oe_init_dir))
719 cmd_lines.append('set ' + self.topdir) 721 cmd_lines.append('set %s %s' % (self.topdir, self.bitbakepath.rstrip('/bin')))
720 cmd_lines.append('. "%s" || { echo ". %s %s failed"; exit 1; }' % ( 722 cmd_lines.append('. "%s" || { echo ". %s %s failed"; exit 1; }' % (
721 self.oe_init_build_env, self.oe_init_build_env, self.topdir)) 723 self.oe_init_build_env, self.oe_init_build_env, self.topdir))
722 724