magika icon indicating copy to clipboard operation
magika copied to clipboard

Cross platform build failures

Open andrejohansson opened this issue 1 year ago • 5 comments

We have a cross platform build job for our rust app, it builds on the following targets but fails on windows and linux after I started to use the magika crate.

  • x86_64-pc-windows-gnu
    • Image: ghcr.io/cross-rs/x86_64-pc-windows-gnu:main
    • Error: downloaded binaries not available for target x86_64-pc-windows-gnu
  • x86_64-apple-darwin
    • Image: joseluisq/rust-linux-darwin-builder:1.82.0
  • x86_64-unknown-linux-gnu
    • Image: joseluisq/rust-linux-darwin-builder:1.82.0

According to the platform support page there should be precompiled binaries for all platforms. But I assume they are not for the windows-gnu variant then. For windows-gnu https://github.com/pykeio/ort/issues/189) says there is no support but I should be able to use the msvc binaries.

Where can I find these and how do I use them?

andrejohansson avatar Dec 05 '24 15:12 andrejohansson

Thanks for reporting!

@ia0 thoughts on this?

reyammer avatar Dec 09 '24 16:12 reyammer

The ort documentation is the reference on that matter. As they suggest, you can compile ONNX Runtime yourself (and either link it dynamically or statically). We actually do this when releasing the CLI (see https://github.com/google/magika/blob/main/.github/workflows/python-build-package.yml and https://github.com/google/magika/blob/main/rust/onnx/build.sh#L36-L37) which depends on the library as any other user would. If you believe something is missing in the library or it is preventing your use-case in some way, then we can fix it. But so far it seems the problem is that Pyke doesn't provide precompiled binaries for your platform, which is inconvenient and requires more work on your side.

ia0 avatar Dec 09 '24 17:12 ia0

@andrejohansson, any news on this? is anything still unclear or we can close this one? Thanks!

reyammer avatar Dec 17 '24 15:12 reyammer

Sorry, I gave up on this as I did not manage to get everything in order (lack of skill on my side). I got some way but in the end there were some missing headers I think and I did not find them for my platform.

For now I just had to go without using the crate (but with lesser functionality in my app).

So, close or use as a tracking issue :-)

andrejohansson avatar Mar 03 '25 14:03 andrejohansson