precompiled NIF is not available: Compilation fails on M1 with Alpine hex.pm builder for target aarch64-unknown-linux-musl
kentbull opened this issue · comments
Kent Bull commented
Issue
Building my app that has an MJML dependency fails as the precompiled NIF is not available for target architecture aarch64-unknown-linux-musl
MJML Version
MJML 1.3.2
Also fails on 1.3.4
Builder Image Version
FROM hexpm/elixir:1.13.4-erlang-24.3.4.2-alpine-3.16.0 as builder
Error
(RuntimeError) Error while downloading precompiled NIF: precompiled NIF is not available for this target: "aarch64-unknown-linux-musl".
Log Output
#15 52.53 ==> rustler_precompiled
#15 52.53 Compiling 4 files (.ex)
#15 52.82 Generated rustler_precompiled app
#15 52.85 ==> mjml
#15 52.85 Compiling 1 file (.ex)
#15 52.89
#15 52.89 == Compilation error in file lib/mjml.ex ==
#15 52.89 ** (RuntimeError) Error while downloading precompiled NIF: precompiled NIF is not available for this target: "aarch64-unknown-linux-musl".
#15 52.89 The available targets are:
#15 52.89 - aarch64-apple-darwin
#15 52.89 - x86_64-apple-darwin
#15 52.89 - x86_64-unknown-linux-gnu
#15 52.89 - x86_64-unknown-linux-musl
#15 52.89 - arm-unknown-linux-gnueabihf
#15 52.89 - aarch64-unknown-linux-gnu
#15 52.89 - x86_64-pc-windows-msvc
#15 52.89 - x86_64-pc-windows-gnu.
Paul Götze commented
Thanks for reporting @kentbull. I'll add it to the release targets and will let you know once it's available.
Paul Götze commented
Alright, I published v1.3.5 which also provides the precompiled NIF for aarch64-unknown-linux-musl
targets.
@kentbull, can you please give it another try and check if everything works as expected now?
Kent Bull commented
@paulgoetze I can confirm this worked. Thank you! We will gladly use the hex.pm Alpine images now.