File hard codes sysroot paths in binary and can fail when installed via sstate-cache. The native version of file needs to be wrapped and pass the --magic-file option with the correct sysroot location for magic.mgc
Fixed in http://git.pokylinux.org/cgit.cgi/poky/commit/?id=7943338d1fea2b9e49b02f1c9f68b4a47188b883
file-native is working correctly with the wrapper
Created attachment 233 [details] log.do_package
It seems that file-native behaves incorrectly and peeks at buildhost file. Evidences are e.g. in log.do_package of update-modules-1.0-r10 and update-rc.d-0.7-r4 in all-oe-linux. ... error: magic_load(ms, /usr/share/misc/magic) failed: File 5.4 supports only version 7 magic files. `/usr/share/misc/magic.mgc' is version 8 rpmdeps: rpmfc.c:1154: rpmfcClassify: Assertion `mg != ((void *)0)' failed. ... Buildcase: the magic.mgc in sysroot is v7 and the one on buildhost/Gentoo is v8. andrea@mizar /oe/oe-core/build $ file /oe/oe-core/build/tmp-eglibc/sysroots/i686-linux/usr/share/misc/magic.mgc /oe/oe-core/build/tmp-eglibc/sysroots/i686-linux/usr/share/misc/magic.mgc: magic binary file for file(1) cmd (version 7) (little endian) andrea@mizar /oe/oe-core/build $ file /usr/share/misc/magic.mgc /usr/share/misc/magic.mgc: magic binary file for file(1) cmd (version 8) (little endian) Regards Andrea
So you are building with a gentoo system? Can you please confirm which file is being found when you do an update-rc.d with devshell, maybe attach an "strace -o file.strace -s 8192 -f" output. This might be a Gentoo specific issue that we need to understand. I do not see this issue on F15 or Ubunto 10.10 system thanks
Andrea, please let me know if you are still having issues, Please confirm the version of Yocto you are using and if you can provide the strace output that would also be helpful.
Created attachment 253 [details] strace of update-rc.d from devshell andrea@mizar /oe/oe-core/build $ bitbake -c devshell update-rc.d andrea@mizar /oe/oe-core/build/tmp-eglibc/work/all-oe-linux/update-rc.d-0.7-r4/g it $ which file /oe/oe-core/build/tmp-eglibc/sysroots/i686-linux/usr/bin/file While there, straced update-rc.d (see log) Thanks for investigating it Andrea
Created attachment 254 [details] strace of file Attached output of: andrea@mizar /oe/oe-core/build/tmp-eglibc/work/all-oe-linux/update-rc.d-0.7-r4/g it $ which file /oe/oe-core/build/tmp-eglibc/sysroots/i686-linux/usr/bin/file andrea@mizar /oe/oe-core/build/tmp-eglibc/work/all-oe-linux/update-rc.d-0.7-r4/g it $ strace -o file.strace -s 8192 -f file Usage: file.real [-bchikLNnprsvz0] [--apple] [--mime-encoding] [--mime-type] [-e testname] [-F separator] [-f namefile] [-m magicfiles] file ... file.real -C [-m magicfiles] file.real [--help] andrea@mizar /oe/oe-core/build/tmp-eglibc/work/all-oe-linux/update-rc.d-0.7-r4/g it $
Created attachment 255 [details] strace of update-rc.d more useful strace...
Ok, I am getting a better understanding of this problem now, it's not actaully file that failing as this was the orignal bug. It seems we have a different problem and would be better suited to have a new bug filed. Can you file a new bug and attach both the log.do_package, along with the run.do_package and run.do_package_rpm files. I am looking at my run* files and see a BUILDSPEC command being build and I wonder if there is some host contamination with the magic_load from RPM in this case. Also if you have a run.BUILDSPEC, please attach that. If run.BUILDPSEC exists, please run it using strace, maybe that will lead me someplace. Also provide an ldd `which rpmbuild.real`. Thanks
This bug kind of got hijacked because of the similar nature of the problem, the real issue is in RPM, see the new bug #1532, I am remarking this one as resolved