summaryrefslogtreecommitdiffstats
path: root/meta/classes/populate_sdk_ext.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-01 14:04:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-02 15:44:11 +0100
commit825043ec771aad54c055ec30aee007a793183487 (patch)
tree69f6058a0b0798159bbff494a3f183f98d132899 /meta/classes/populate_sdk_ext.bbclass
parentccd83269b7cbe27270c10c7a4fa0ea5498a1a624 (diff)
downloadpoky-825043ec771aad54c055ec30aee007a793183487.tar.gz
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] (From OE-Core rev: 30912ba084aa8600156edddbe4f2db0b85e869d0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/populate_sdk_ext.bbclass')
-rw-r--r--meta/classes/populate_sdk_ext.bbclass19
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 @@
2 2
3inherit populate_sdk_base 3inherit populate_sdk_base
4 4
5# NOTE: normally you cannot use task overrides for this kind of thing - this 5# Used to override TOOLCHAIN_HOST_TASK in the eSDK case
6# only works because of get_sdk_ext_rdepends() 6TOOLCHAIN_HOST_TASK_ESDK = " \
7
8TOOLCHAIN_HOST_TASK:task-populate-sdk-ext = " \
9 meta-environment-extsdk-${MACHINE} \ 7 meta-environment-extsdk-${MACHINE} \
10 " 8 "
11 9
12TOOLCHAIN_TARGET_TASK:task-populate-sdk-ext = ""
13
14SDK_RELOCATE_AFTER_INSTALL:task-populate-sdk-ext = "0" 10SDK_RELOCATE_AFTER_INSTALL:task-populate-sdk-ext = "0"
15 11
16SDK_EXT = "" 12SDK_EXT = ""
@@ -755,6 +751,10 @@ fakeroot python do_populate_sdk_ext() {
755 if d.getVar('BB_CURRENT_MC') != 'default': 751 if d.getVar('BB_CURRENT_MC') != 'default':
756 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')) 752 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'))
757 753
754 # eSDK dependencies don't use the traditional variables and things don't work properly if they are set
755 d.setVar("TOOLCHAIN_HOST_TASK", "${TOOLCHAIN_HOST_TASK_ESDK}")
756 d.setVar("TOOLCHAIN_TARGET_TASK", "")
757
758 d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d)) 758 d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
759 if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1': 759 if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1':
760 buildtools_fn = get_current_buildtools(d) 760 buildtools_fn = get_current_buildtools(d)
@@ -800,12 +800,7 @@ do_sdk_depends[dirs] = "${WORKDIR}"
800do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)} meta-extsdk-toolchain:do_populate_sysroot" 800do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)} meta-extsdk-toolchain:do_populate_sysroot"
801do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}" 801do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}"
802do_sdk_depends[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy ${SDK_RECRDEP_TASKS}" 802do_sdk_depends[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy ${SDK_RECRDEP_TASKS}"
803do_sdk_depends[rdepends] = "${@get_sdk_ext_rdepends(d)}" 803do_sdk_depends[rdepends] = "${@' '.join([x + ':do_package_write_${IMAGE_PKGTYPE} ' + x + ':do_packagedata' for x in d.getVar('TOOLCHAIN_HOST_TASK_ESDK').split()])}"
804
805def get_sdk_ext_rdepends(d):
806 localdata = d.createCopy()
807 localdata.appendVar('OVERRIDES', ':task-populate-sdk-ext')
808 return localdata.getVarFlag('do_populate_sdk', 'rdepends')
809 804
810do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}" 805do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
811 806