Hi, I have problem with reproducibility of this issue.
What I did: build buildtools tarball and install it Than build sdk with this buildtools tarball. 1. No changes. Buildtools tarball installed and relocated into. /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/usr/bin/file point to file.file actual binary that use MAGIC /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/environment-setup.d/file.sh contains: export MAGIC="/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-xesdk-linux/usr/share/misc/magic.mgc" 2. Fix file recipe as recommended with escaping dollar sign and reinstall tarball. Got strange results. /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/environment-setup.d/file.sh contains: export MAGIC="OECORE_NATIVE_SYSROOT/nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/usr/share/misc/magic.mgc", i.e. proper path but OECORE_NATIVE_SYSROOT not replaced with value 3. Cleanup and retest option (a). Get proper path export MAGIC="/nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/usr/share/misc/magic.mgc" And I can't reproduce the issue with magic path. Probably it was an issue on my side with inproper initialization or something. But still even with proper path to the magic file I have initial issue: ERROR: quilt-native-0.67-r0 do_populate_sysroot: Fatal errors occurred in subprocesses: Command '['file', '-b', '/nobackup/oobitots/sdk-master/test-file/tmp/work/x86_64-linux/quilt-native/0.67-r0/sysroot-destdir/nobackup/oobitots/sdk-master/test-file/tmp/work/x86_64-linux/quilt-native/0.67-r0/recipe-sysroot-native/usr/share/quilt/compat/sendmail']' returned non-zero exit status 1. It looks like 'file' executed during do_package is unable to find magic, so environment have no such MAGIC value. Trying to test with bitbake quilt-native -c devshell oobitots-> echo $MAGIC /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/usr/share/misc/magic.mgc [/nobackup/oobitots/sdk-master/test-file/tmp/work/x86_64-linux/quilt-native/0.67-r0/quilt-0.67] oobitots-> which file /nobackup/oobitots/sdk-master/test-file/tmp/hosttools/file [/nobackup/oobitots/sdk-master/test-file/tmp/work/x86_64-linux/quilt-native/0.67-r0/quilt-0.67] oobitots-> file /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/usr/bin/file.file /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/usr/bin/file.file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nobackup/oobitots/btt-master/sysroots/x86_64-xesdk-linux/lib/ld-linux-x86-64.so.2, BuildID[sha1]=a7344295f5f77b886e3bef6cab8e21ea6e8ad08b, for GNU/Linux 4.18.0, stripped Regards, Oleksiy ________________________________ From: Alexander Kanavin <alex.kana...@gmail.com> Sent: Monday, June 19, 2023 19:27 To: alex.kana...@gmail.com <alex.kana...@gmail.com> Cc: Oleksiy Obitotskyi -X (oobitots - GLOBALLOGIC INC at Cisco) <oobit...@cisco.com>; yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> Subject: Re: [yocto] File magic/sdk relocation On closer look, it should even say: export MAGIC="\$OECORE_NATIVE_SYSROOT/usr/share/misc/magic.mgc" If you can test this and confirm that it works, a patch would be welcome. Alex On Mon, 19 Jun 2023 at 18:55, Alexander Kanavin via lists.yoctoproject.org <alex.kanavin=gmail....@lists.yoctoproject.org> wrote: > > I think there is a mistake in the file recipe (and rpm has the problem too): > > cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh > export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc" > EOF > > $OECORE_NATIVE_SYSROOT should be prefixed with a \ to prevent shell > variable expansion at build time. > > Can you check that the problem is then fixed? > > Alex > > On Mon, 19 Jun 2023 at 17:50, Oleksiy Obitotskyy via > lists.yoctoproject.org <oobitots=cisco....@lists.yoctoproject.org> > wrote: > > > > Hi, > > > > I'm working on master oe core master branch and run into problem with file > > for nativesdk (buildtools tarball). > > File started to use MAGIC variable initialized from > > .../environment-setup.d/file.sh, like > > > > /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-xesdk-linux/usr/share/misc/magic.mgc > > > > This path relocation does not covered by relocate_sdk.sh script. > > > > Commit that change behavior from wrapper that use relative path to > > environment variable with absolute path is: > > > > commit 47db876d09d9a4394048579c21d0b394450ce681 > > Author: Chen Qi <qi.c...@windriver.com> > > Date: Tue Jan 17 12:06:30 2023 +0800 > > > > file: export MAGIC in SDK > > > > Previously, a wrapper is used for file, which adds '--magic-file' > > option to it. But other components might use libmagic and in such > > case, if there's no MAGIC environent variable set correctly, things > > do not work. For example, rpmbuild makes use of libmagic and it > > requries MAGIC to be set correctly. > > > > Signed-off-by: Chen Qi <qi.c...@windriver.com> > > Signed-off-by: Luca Ceresoli <luca.ceres...@bootlin.com> > > Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org> > > > > > > I would like to ask if anybody else has such an issue. Any propositions > > other than reverting commit? > > > > Regards, > > Oleksiy > > > > > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#60371): https://lists.yoctoproject.org/g/yocto/message/60371 Mute This Topic: https://lists.yoctoproject.org/mt/99626082/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-