public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] toolchain-scripts.bbclass: fix bitbake-setup compatibility
@ 2025-10-06 19:10 AdrianF
  2025-10-07 12:38 ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 3+ messages in thread
From: AdrianF @ 2025-10-06 19:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Adrian Freihofer

From: Adrian Freihofer <adrian.freihofer@siemens.com>

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>
---
 meta/classes-recipe/toolchain-scripts.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 () {
 # 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
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] toolchain-scripts.bbclass: fix bitbake-setup compatibility
  2025-10-06 19:10 [PATCH] toolchain-scripts.bbclass: fix bitbake-setup compatibility AdrianF
@ 2025-10-07 12:38 ` Mathieu Dubois-Briand
  2025-10-07 12:38   ` Mathieu Dubois-Briand
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2025-10-07 12:38 UTC (permalink / raw)
  To: adrian.freihofer, openembedded-core

On Mon Oct 6, 2025 at 9:10 PM CEST, Adrian Freihofer via lists.openembedded.org wrote:
> From: Adrian Freihofer <adrian.freihofer@siemens.com>
>
> 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>
> ---

Hi Adrian,

Thanks for the new version.

It looks like it is braking some tc tests:

2025-10-07 06:03:00,760 - oe-selftest - INFO - 9: 2/4 4/18 (0.31s) (0 failed) (meta_ide.MetaIDE.test_meta_ide_can_compile_c_program)
2025-10-07 06:03:00,760 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemuarm64-tc/build/meta/lib/oeqa/selftest/cases/meta_ide.py", line 40, in test_meta_ide_can_compile_c_program
    runCmd("cd %s; . %s; $CC test.c -lm" % (self.tmpdir_metaideQA, self.environment_script_path))
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/pokybuild/yocto-worker/qemuarm64-tc/build/meta/lib/oeqa/utils/commands.py", line 214, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'cd /tmp/metaid
...
cc1: fatal error: test.c: No such file or directory

Can you have look at this failure please?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] toolchain-scripts.bbclass: fix bitbake-setup compatibility
  2025-10-07 12:38 ` [OE-core] " Mathieu Dubois-Briand
@ 2025-10-07 12:38   ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2025-10-07 12:38 UTC (permalink / raw)
  To: adrian.freihofer, openembedded-core

On Tue Oct 7, 2025 at 2:38 PM CEST, Mathieu Dubois-Briand wrote:
> On Mon Oct 6, 2025 at 9:10 PM CEST, Adrian Freihofer via lists.openembedded.org wrote:
>> From: Adrian Freihofer <adrian.freihofer@siemens.com>
>>
>> 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>
>> ---
>
> Hi Adrian,
>
> Thanks for the new version.
>
> It looks like it is braking some tc tests:
>
> 2025-10-07 06:03:00,760 - oe-selftest - INFO - 9: 2/4 4/18 (0.31s) (0 failed) (meta_ide.MetaIDE.test_meta_ide_can_compile_c_program)
> 2025-10-07 06:03:00,760 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
>   File "/srv/pokybuild/yocto-worker/qemuarm64-tc/build/meta/lib/oeqa/selftest/cases/meta_ide.py", line 40, in test_meta_ide_can_compile_c_program
>     runCmd("cd %s; . %s; $CC test.c -lm" % (self.tmpdir_metaideQA, self.environment_script_path))
>     ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/srv/pokybuild/yocto-worker/qemuarm64-tc/build/meta/lib/oeqa/utils/commands.py", line 214, in runCmd
>     raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
> AssertionError: Command 'cd /tmp/metaid
> ...
> cc1: fatal error: test.c: No such file or directory
>
> Can you have look at this failure please?
>
> Thanks,
> Mathieu

Sorry, I forgot the AB links:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/2449
https://autobuilder.yoctoproject.org/valkyrie/#/builders/28/builds/2443

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-07 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-06 19:10 [PATCH] toolchain-scripts.bbclass: fix bitbake-setup compatibility AdrianF
2025-10-07 12:38 ` [OE-core] " Mathieu Dubois-Briand
2025-10-07 12:38   ` Mathieu Dubois-Briand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox