path: root/meta
diff options
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-01 14:04:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-01 14:04:18 +0100
commit30912ba084aa8600156edddbe4f2db0b85e869d0 (patch)
treea0d70394b5c47804c226131eed8d944537cfa9ff /meta
parent9150933dc524b6cedc42b063b7a2092e202f3672 (diff)
populate_sdk_ext: Fix handling of TOOLCHAIN_HOST_TASK in the eSDK case
The current way TOOLCHAIN_HOST_TASK is handled within eSDK builds is causing much confusion, even to people who should understand the code. For a normal SDK, some layers append to TOOLCHAIN_HOST_TASK unconditionally which is fine, until the eSDK tries to override the variable to it's own values. It does not support or use packages installed using this variable and would use native recipes instead, it is a very different approach. In the referenced bug, binaries are added but not relocated leading to confusing errors. To fix this, add a new variables for the eSDK TOOLCHAIN_HOST_TASK to be explict and force the eSDK code to use this instead. The setVar in non-parsing context will clear out any appends resolving the current issues. The patch also gets rid of some dubious task override use. [YCOTO #14047] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
1 files changed, 7 insertions, 12 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 10f3265e91..35679208bc 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -2,15 +2,11 @@
inherit populate_sdk_base
-# NOTE: normally you cannot use task overrides for this kind of thing - this
-# only works because of get_sdk_ext_rdepends()
-TOOLCHAIN_HOST_TASK:task-populate-sdk-ext = " \
+# Used to override TOOLCHAIN_HOST_TASK in the eSDK case
meta-environment-extsdk-${MACHINE} \
-TOOLCHAIN_TARGET_TASK:task-populate-sdk-ext = ""
SDK_RELOCATE_AFTER_INSTALL:task-populate-sdk-ext = "0"
SDK_EXT = ""
@@ -755,6 +751,10 @@ fakeroot python do_populate_sdk_ext() {
if d.getVar('BB_CURRENT_MC') != 'default':
bb.fatal('The extensible SDK can currently only be built for the default multiconfig. Currently trying to build for %s.' % d.getVar('BB_CURRENT_MC'))
+ # eSDK dependencies don't use the traditional variables and things don't work properly if they are set
d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1':
buildtools_fn = get_current_buildtools(d)
@@ -800,12 +800,7 @@ do_sdk_depends[dirs] = "${WORKDIR}"
do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)} meta-extsdk-toolchain:do_populate_sysroot"
do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}"
do_sdk_depends[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy ${SDK_RECRDEP_TASKS}"
-do_sdk_depends[rdepends] = "${@get_sdk_ext_rdepends(d)}"
-def get_sdk_ext_rdepends(d):
- localdata = d.createCopy()
- localdata.appendVar('OVERRIDES', ':task-populate-sdk-ext')
- return localdata.getVarFlag('do_populate_sdk', 'rdepends')
+do_sdk_depends[rdepends] = "${@' '.join([x + ':do_package_write_${IMAGE_PKGTYPE} ' + x + ':do_packagedata' for x in d.getVar('TOOLCHAIN_HOST_TASK_ESDK').split()])}"
do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"