Closed faithanalog closed 3 years ago
This has been an annoyance for quite a while, and I usually worked around it with samu out/pkg/file/file && PATH=$PWD/out/pkg/file:$PATH samu
. I did some investigation and it turns out file has a bunch of ifdefs for COMPILE_ONLY
which allow you to build a minimal tool just to generate the magic database.
It appears to generate the exact same magic.mgc
as the real file
, so I pushed a commit to use that instead. This should work even when cross-compiling.
Thanks for reporting the issue!
Meant to report this last night but was tired
During build, using ubuntu 20.04 and debian buster, I got the following error with the
file
package:file: could not find any valid magic files!
'. This happens while runningfile -C -m magic
, after a bunch of warnings. Full log of warnings attached but it's not too relevant.Anyway, the problem seems to be that it's using the host system's
file
, not thefile
it just built, and I guess there's some incompatibilities from the versions shipped by debian and ubuntu. This patch fixes it by using thefile
it just built to generate the magic:There is a catch. If you want to be able to cross-compile oasis, this won't work, unless you have qemu-user and corresponding binfmt on the host system to emulate the built
file
binary. I don't know if cross compiling is even a goal of oasis or not; If that's not a problem, this should work.