]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool: ide_sdk: Use bitbake's python3 for generated scripts
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Mon, 19 Feb 2024 16:55:21 +0000 (17:55 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 20 Feb 2024 12:58:20 +0000 (12:58 +0000)
The generated scripts use the sys.path configuration found inside
bitbake. It can be a different python version than the one used on the
host through the IDE.

For instance, when running the generated script
deploy_target_cmake-example-core2-64 from an eSDK generated on another
machine, I got the following exception:
    AssertionError: SRE module mismatch

We need to match the sys.executable to the sys.path.

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/ide_sdk.py

index 3986dc1436ad389844ff3ee96b9d3da7a6c23aec..146797448076cde711dfca8d39bdf31ec4cb5d18 100755 (executable)
@@ -750,7 +750,7 @@ class RecipeModified:
         does not need to start a bitbake server. All information from tinfoil
         is hard-coded in the generated script.
         """
-        cmd_lines = ['#!/usr/bin/env python3']
+        cmd_lines = ['#!%s' % str(sys.executable)]
         cmd_lines.append('import sys')
         cmd_lines.append('devtool_sys_path = %s' % str(sys.path))
         cmd_lines.append('devtool_sys_path.reverse()')