Question: how to "force" a specific target without philss/[email protected] action
I'm trying to build nifs to be incuded in a OTP build. But no matter what I try to configure it always results in libs built for the host architecture
TARGET_ARCH=x86_64 RUST_TARGET="x86_64-apple-ios" RUSTFLAGS='-C target-feature=+crt-static' STATIC_ERLANG_NIF_LIBNAME=btleplug_client mix release
lipo -info _build/dev/lib/rustler_btleplug/native/btleplug_client/release/libbtleplug_client.a Non-fat file: _build/dev/lib/rustler_btleplug/native/btleplug_client/release/libbtleplug_client.a is architecture: arm64
currently I'm only targeting 1 lib; i could use a manual process to build the lib using cargo or rustler-precompiled action. but potentially I want to include more than just . using philss/[email protected] as part of a ci pipeline works smoothly. but I need to support nifs that are not built with rustler too. Therefor the mix release approach
@adiibanez I think you will need to run the build manually using cargo build --target, because that GH Action only do that behind the scenes - selecting some cargo features -, and then rename the artifact to a proper name (also tar.gz it).
The GH Action has a script that you can use as reference. Please take a look there: https://github.com/philss/rustler-precompiled-action/blob/main/build.sh
Passing TARGET_ARCH is going to be useful if you want to load a different NIF for the target architecture you are running into, but this is not useful during compilation of the NIF itself.