summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-09-07 12:51:01 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-09 12:04:55 +0100
commit63e53fb8b60d38315015844bd3357fa1649cd639 (patch)
tree05f396b29b8c1c4f2ff0829c1f188fc1b4e3ee95
parent560a70a198c9a2a4efcbf077305af51ea259682c (diff)
downloadpoky-63e53fb8b60d38315015844bd3357fa1649cd639.tar.gz
build-sysroots: target or native sysroot population need to be selected explicitly
Running them in parallel is prone to races as postinsts from target sysroots rely on executables from native sysroots which may or may not be fully prepared yet. This was observed for example here: https://autobuilder.yoctoproject.org/typhoon/#/builders/146/builds/468/steps/12/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/147/builds/467/steps/12/logs/stdio (From OE-Core rev: 38d7a2e45b883cf999a86af05bcc0eaa875bb47c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/files/ext-sdk-prepare.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/meta_ide.py5
-rw-r--r--meta/recipes-core/meta/build-sysroots.bb12
-rw-r--r--scripts/lib/devtool/sdk.py3
4 files changed, 16 insertions, 6 deletions
diff --git a/meta/files/ext-sdk-prepare.py b/meta/files/ext-sdk-prepare.py
index d191e5e19c..89b0403089 100644
--- a/meta/files/ext-sdk-prepare.py
+++ b/meta/files/ext-sdk-prepare.py
@@ -71,7 +71,7 @@ def main():
71 71
72 ret = run_command_interruptible('BB_SETSCENE_ENFORCE=1 bitbake --quiet %s' % ' '.join(sdk_targets)) 72 ret = run_command_interruptible('BB_SETSCENE_ENFORCE=1 bitbake --quiet %s' % ' '.join(sdk_targets))
73 if not ret: 73 if not ret:
74 ret = run_command_interruptible('bitbake --quiet build-sysroots') 74 ret = run_command_interruptible('bitbake --quiet build-sysroots -c build_native_sysroot && bitbake --quiet build-sysroots -c build_target_sysroot')
75 lastlog = get_last_consolelog() 75 lastlog = get_last_consolelog()
76 if lastlog: 76 if lastlog:
77 with open(lastlog, 'r') as f: 77 with open(lastlog, 'r') as f:
diff --git a/meta/lib/oeqa/selftest/cases/meta_ide.py b/meta/lib/oeqa/selftest/cases/meta_ide.py
index bae98359e5..59270fb3e0 100644
--- a/meta/lib/oeqa/selftest/cases/meta_ide.py
+++ b/meta/lib/oeqa/selftest/cases/meta_ide.py
@@ -18,7 +18,8 @@ class MetaIDE(OESelftestTestCase):
18 def setUpClass(cls): 18 def setUpClass(cls):
19 super(MetaIDE, cls).setUpClass() 19 super(MetaIDE, cls).setUpClass()
20 bitbake('meta-ide-support') 20 bitbake('meta-ide-support')
21 bitbake('build-sysroots') 21 bitbake('build-sysroots -c build_native_sysroot')
22 bitbake('build-sysroots -c build_target_sysroot')
22 bb_vars = get_bb_vars(['MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE']) 23 bb_vars = get_bb_vars(['MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'])
23 cls.environment_script = 'environment-setup-%s' % bb_vars['MULTIMACH_TARGET_SYS'] 24 cls.environment_script = 'environment-setup-%s' % bb_vars['MULTIMACH_TARGET_SYS']
24 cls.deploydir = bb_vars['DEPLOY_DIR_IMAGE'] 25 cls.deploydir = bb_vars['DEPLOY_DIR_IMAGE']
@@ -55,5 +56,5 @@ class MetaIDE(OESelftestTestCase):
55 56
56 def test_meta_ide_can_run_sdk_tests(self): 57 def test_meta_ide_can_run_sdk_tests(self):
57 bitbake('-c populate_sysroot gtk+3') 58 bitbake('-c populate_sysroot gtk+3')
58 bitbake('build-sysroots') 59 bitbake('build-sysroots -c build_target_sysroot')
59 bitbake('-c testsdk meta-ide-support') 60 bitbake('-c testsdk meta-ide-support')
diff --git a/meta/recipes-core/meta/build-sysroots.bb b/meta/recipes-core/meta/build-sysroots.bb
index 1a3b692a1b..db05c111ab 100644
--- a/meta/recipes-core/meta/build-sysroots.bb
+++ b/meta/recipes-core/meta/build-sysroots.bb
@@ -22,6 +22,14 @@ deltask collect_spdx_deps
22deltask create_runtime_spdx 22deltask create_runtime_spdx
23deltask recipe_qa 23deltask recipe_qa
24 24
25do_build_warn () {
26 bbwarn "Native or target sysroot population needs to be explicitly selected; please use
27bitbake -c build_native_sysroot build-sysroots
28bitbake -c build_target_sysroot build-sysroots
29or both."
30}
31addtask do_build_warn before do_build
32
25python do_build_native_sysroot () { 33python do_build_native_sysroot () {
26 targetsysroot = d.getVar("STANDALONE_SYSROOT") 34 targetsysroot = d.getVar("STANDALONE_SYSROOT")
27 nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE") 35 nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
@@ -31,7 +39,7 @@ python do_build_native_sysroot () {
31} 39}
32do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}" 40do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}"
33do_build_native_sysroot[nostamp] = "1" 41do_build_native_sysroot[nostamp] = "1"
34addtask do_build_native_sysroot before do_build 42addtask do_build_native_sysroot
35 43
36python do_build_target_sysroot () { 44python do_build_target_sysroot () {
37 targetsysroot = d.getVar("STANDALONE_SYSROOT") 45 targetsysroot = d.getVar("STANDALONE_SYSROOT")
@@ -42,6 +50,6 @@ python do_build_target_sysroot () {
42} 50}
43do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}" 51do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}"
44do_build_target_sysroot[nostamp] = "1" 52do_build_target_sysroot[nostamp] = "1"
45addtask do_build_target_sysroot before do_build 53addtask do_build_target_sysroot
46 54
47do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}" 55do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}"
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index d717b6c2b8..9aefd7e354 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -300,7 +300,8 @@ def sdk_install(args, config, basepath, workspace):
300 return 2 300 return 2
301 301
302 try: 302 try:
303 exec_build_env_command(config.init_path, basepath, 'bitbake build-sysroots', watch=True) 303 exec_build_env_command(config.init_path, basepath, 'bitbake build-sysroots -c build_native_sysroot', watch=True)
304 exec_build_env_command(config.init_path, basepath, 'bitbake build-sysroots -c build_target_sysroot', watch=True)
304 except bb.process.ExecutionError as e: 305 except bb.process.ExecutionError as e:
305 raise DevtoolError('Failed to bitbake build-sysroots:\n%s' % (str(e))) 306 raise DevtoolError('Failed to bitbake build-sysroots:\n%s' % (str(e)))
306 307