From: Oleksandr Hnatiuk <ohnat...@cisco.com>

Wrapper that adds proper path to magic file was removed in
47db876d09d9a4394048579c21d0b394450ce681 in favor of
environment-setup.d/file.sh which now contains `MAGIC` environment variable.
This breaks builds that rely on external buildtools with `file` included in
buildtools-tarball (e.g. via TOOLCHAIN_HOST_TASK) because do_populate_sysroot
task invokes `file` via `subprocess.check_output` (in is_elf function) and
doesn't use variables from files in environment-setup.d. To address this use
case, we need to preserve the wrapper, but also have
environment-setup.d/file.sh for the purposes described in
47db876d09d9a4394048579c21d0b394450ce681.

Signed-off-by: Oleksandr Hnatiuk <ohnat...@cisco.com>
Signed-off-by: Alexandre Belloni <alexandre.bell...@bootlin.com>
(cherry picked from commit e76b059cf4ba9a79150032d68d012b233dd79a65)
Signed-off-by: Steve Sakoman <st...@sakoman.com>
---
 meta/recipes-devtools/file/file_5.44.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-devtools/file/file_5.44.bb 
b/meta/recipes-devtools/file/file_5.44.bb
index 3090d346ed..0834384230 100644
--- a/meta/recipes-devtools/file/file_5.44.bb
+++ b/meta/recipes-devtools/file/file_5.44.bb
@@ -45,6 +45,7 @@ do_install:append:class-native() {
 }
 
 do_install:append:class-nativesdk() {
+       create_wrapper ${D}/${bindir}/file MAGIC=${datadir}/misc/magic.mgc
        mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
        cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh
                export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc"
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#185788): 
https://lists.openembedded.org/g/openembedded-core/message/185788
Mute This Topic: https://lists.openembedded.org/mt/100666371/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to