philss / rustler_precompiled

Use precompiled NIFs from trusted sources in your Elixir code
181 stars 25 forks source link

TARGET_VENDOR, Unable to override the environment variable #70

Closed m0rt3nlund closed 2 months ago

m0rt3nlund commented 4 months ago

Hi!

Is there a special reason why I cannot override the vendor?

If I try to set it to TARGET_VENDOR="pc" it is reset back to unknown

The reason why I ask is that i am using Burrito to cross compile my application. My host is Linux and the target is Windows.

I am compiling using this environment variables:

ENV TARGET_ARCH="x86_64"
ENV TARGET_VENDOR="pc"
ENV TARGET_OS="windows"
ENV TARGET_ABI="msvc"

The result I get is this:

 == Compilation error in file lib/thumbp.ex ==
21.93 ** (RuntimeError) precompiled NIF is not available for this target: "x86_64-unknown-windows-msvc".
21.93 The available targets are:
21.93  - aarch64-apple-darwin
21.93  - aarch64-unknown-linux-gnu
21.93  - aarch64-unknown-linux-musl
21.93  - arm-unknown-linux-gnueabihf
21.93  - riscv64gc-unknown-linux-gnu
21.93  - x86_64-apple-darwin
21.93  - x86_64-pc-windows-gnu
21.93  - x86_64-pc-windows-msvc
21.93  - x86_64-unknown-linux-gnu
21.93  - x86_64-unknown-linux-musl
21.93     lib/thumbp.ex:8: (module)

This tells me that the vendor is not something I can override? Looking into the source code it looks like this is done for a reason, which i cannot fully understand :)

philss commented 2 months ago

Sorry for the delay. This will be fixed in the next patch.