From 30912ba084aa8600156edddbe4f2db0b85e869d0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 1 Aug 2021 14:04:15 +0100 Subject: 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 --- meta/classes/populate_sdk_ext.bbclass | 19 +++++++------------ 1 file 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 +TOOLCHAIN_HOST_TASK_ESDK = " \ 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("TOOLCHAIN_HOST_TASK", "${TOOLCHAIN_HOST_TASK_ESDK}") + d.setVar("TOOLCHAIN_TARGET_TASK", "") + 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)}" -- cgit 1.2.3-korg