From 56f81087fbf4f98ae3a3bd314deab532e5809c8e Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 7 Nov 2017 17:15:56 +0800 Subject: populate_sdk_ext.bbclass: disable for multilib image The following build doesn't work: MACHINE ?= "qemux86-64" require conf/multilib.conf MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "x86" $ bitbake lib32-core-image-minimal -cpopulate_sdk_ext [snip] Exception: FileExistsError: [Errno 17] File exists: '/buildarea/lyang1/test_q64/tmp/sysroots-components/core2-64/openssl/sysroot-providers/openssl10' -> '/buildarea/lyang1/test_q64/tmp/work/qemux86_64-pokymllib32-linux/lib32-core-image-minimal/1.0-r0/lib32-recipe-sysroot/sysroot-providers/openssl10' [snip] The problem is populate_sdk_ext installs all multilib variants, and extend_recipe_sysroot() handles foo-image depends lib32-foo-image, but doesn't handle lib32-foo-image depends foo-image, we can use a lot of trick ways to make it work: 1) Get foo-image's RECIPE_SYSROOT when build lib32-foo-image 2) Handle conflicts with foo-image.do_rootfs 3) Handle conflicts when "bitbake lib32-foo-image foo-image -cpopulate_sdk_ext" And maybe other potential problems, this looks painful, fortunately, we don't have to do that since "bitbake foo-image -cpopulate_sdk_ext" generate the same eSDK as "bitbake lib32-foo-image -cpopulate_sdk_ext" in theory. So just disable the build and print hint messages. [YOCTO #12210] Signed-off-by: Robert Yang --- meta/classes/populate_sdk_ext.bbclass | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index 07c7e8216b..da0e29232f 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass @@ -701,6 +701,23 @@ python do_sdk_depends() { } addtask sdk_depends +# "bitbake lib32-foo-image -csdk_depends" doesn't work, use +# "bitbake foo-image -csdk_depends" to replace of it, they will generate +# the same depends. +do_sdk_depends[prefuncs] = 'disable_for_multilib_image' +python disable_for_multilib_image() { + mlprefix = d.getVar("MLPREFIX") + if mlprefix: + pn = d.getVar('PN') + bpn = d.getVar('BPN') + bb.fatal("do_sdk_depends for %s doesn't work, use %s to replace of it, " \ + "they will generate the same dependencies and eSDK.\n" \ + "For example, the following 2 commands will generate the same eSDK:\n" \ + "$ bitbake %s -cpopulate_sdk_ext\n" \ + "$ bitbake %s -cpopulate_sdk_ext\n" % (pn, bpn, bpn, pn)) +} + + do_sdk_depends[dirs] = "${WORKDIR}" do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)}" do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}" -- cgit 1.2.3-korg