From: Alexander Kanavin Date: Mon, 8 Jun 2020 07:46:59 +0000 (+0200) Subject: build-sysroots: add sysroot paths with native binaries to PATH X-Git-Tag: 2020-04.2-dunfell~138 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=17fad96d3d9a8cfbc6724466475f6f161e967b74;p=openembedded-core.git build-sysroots: add sysroot paths with native binaries to PATH staging_populate_sysroot_dir() collects postinsts from the sysroot and executes them. These postinsts, in turn, may call binaries that are only available from the sysroot. This works fine with recipe-specific sysroots, as all necessary paths are already in PATH, but breaks down in this recipe which imitates the old global sysroot way but doesn't adjust the PATH to include the binary paths from global sysroot. To reproduce the failure: $ bitbake docbook-xml-dtd4-native $ bitbake -c build_native_sysroot build-sysroots ... Exception: subprocess.CalledProcessError: Command '/home/akanavin/build/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog' returned non-zero exit status 127. Subprocess output: /home/akanavin/build/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: 5: /home/akanavin/build/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: xmlcatalog: not found /home/akanavin/build/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: 8: /home/akanavin/build/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: xmlcatalog: not found Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie (cherry picked from commit 6b5f7bda4204d45cd29670cefcd53dc5da031095) Signed-off-by: Steve Sakoman --- diff --git a/meta/recipes-core/meta/build-sysroots.bb b/meta/recipes-core/meta/build-sysroots.bb index 7a712e2f38..ad22a75eb2 100644 --- a/meta/recipes-core/meta/build-sysroots.bb +++ b/meta/recipes-core/meta/build-sysroots.bb @@ -20,6 +20,8 @@ deltask populate_sysroot python do_build_native_sysroot () { targetsysroot = d.getVar("STANDALONE_SYSROOT") nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE") + import os + os.environ['PATH'] = "%s/bin:%s/usr/bin:%s" % (nativesysroot, nativesysroot, os.environ['PATH']) staging_populate_sysroot_dir(targetsysroot, nativesysroot, True, d) } do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}" @@ -29,6 +31,8 @@ addtask do_build_native_sysroot before do_build python do_build_target_sysroot () { targetsysroot = d.getVar("STANDALONE_SYSROOT") nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE") + import os + os.environ['PATH'] = "%s/bin:%s/usr/bin:%s" % (nativesysroot, nativesysroot, os.environ['PATH']) staging_populate_sysroot_dir(targetsysroot, nativesysroot, False, d) } do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}"