Skip to contentSkip to conversation

scripts/oe-check-sstate: cleanup

PATCH New Ross Burton 1 participant 2 messages Oct 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 scripts/oe-check-sstate: cleanup

The scriptutils import isn't used, there's no need to run bitbake in a shell environment, and invoke bitbake as a list instead of a string.

---
 scripts/oe-check-sstate | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
scripts/oe-check-sstate +2 -6
index f4cc5869de4..7f9f835da4c 100755
@@ -18,7 +18,6 @@ import re
 scripts_path = os.path.dirname(os.path.realpath(__file__))
 lib_path = scripts_path + '/lib'
 sys.path = sys.path + [lib_path]
-import scriptutils
 import scriptpath
 scriptpath.add_bitbake_lib_path()
 import argparse_oe
@@ -51,11 +50,8 @@ def check(args):
             env['TMPDIR:forcevariable'] = tmpdir
 
         try:
-            output = subprocess.check_output(
-                    'bitbake -n %s' % ' '.join(args.target),
-                    stderr=subprocess.STDOUT,
-                    env=env,
-                    shell=True)
+            cmd = ['bitbake', '--dry-run'] + args.target
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env)
 
             task_re = re.compile('NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)')
             tasks = []
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 scripts/oe-check-sstate: force build to run for all targets, specifically populate_sysroot

Since the commit "populate_sdk_base/images: Drop use of 'meta' class and hence do_build dependencies"[1], builds of images or SDKs don't recursively depend on the top-level do_build target. This is typically a good thing: images just depend on the packages themselves and those dependencies already exist, but they don't need each recipes sysroot to be populated.

However, eSDK generation is partly done via the script oe-check-sstate, which does a 'dry-run' build of the target and collates all of the sstate that is used. With this commit the sstate that is used is a fraction of what would be needed in the SDK, specifically there are no sysroots populated during the build, so there are no sysroots in the SDK.

This is obviously a problem, as the entire point of an eSDK is to contain a sysroot. Resolve this problem by forcing bitbake to run the build task for all targets, so that all potentially needed sstate is collated.

[YOCTO #14626]

[1] https://github.com/openembedded/openembedded-core/commit/41d7f1aa2cc9ef5dba4db38435402d4c9c0a63e1

---
 scripts/oe-check-sstate | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/oe-check-sstate +1 -1
index 7f9f835da4c..4187e774581 100755
@@ -50,7 +50,7 @@ def check(args):
             env['TMPDIR:forcevariable'] = tmpdir
 
         try:
-            cmd = ['bitbake', '--dry-run'] + args.target
+            cmd = ['bitbake', '--dry-run', '--runall=build'] + args.target
             output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env)
 
             task_re = re.compile('NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)')
Signature · 1 line
2.34.1