blockscout / blockscout

Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
http://docs.blockscout.com
GNU General Public License v3.0
3.61k stars 2.4k forks source link

(RuntimeError) precompiled NIF is not available for this target: "x86_64-alpine-linux-musl". #7392

Open spilin opened 1 year ago

spilin commented 1 year ago

Not compiling on latest version on alpine. Issue is within new version of :ex_keccak "0.7.1". Works with 0.6.0 as expected. Update was introduced in this commit.

Environment

Steps to reproduce

Runing: mix do deps.get, local.rebar --force, deps.compile, compile

Expected behaviour

Should raise no error

** (RuntimeError) precompiled NIF is not available for this target: "x86_64-alpine-linux-musl".
The available targets are:
 - aarch64-unknown-linux-musl
 - aarch64-apple-darwin
 - aarch64-unknown-linux-gnu
 - arm-unknown-linux-gnueabihf
 - riscv64gc-unknown-linux-gnu
 - x86_64-apple-darwin
 - x86_64-pc-windows-gnu
 - x86_64-pc-windows-msvc
 - x86_64-unknown-linux-gnu
 - x86_64-unknown-linux-musl
    lib/ex_keccak.ex:10: (module)
    (elixir 1.13.4) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
vbaranov commented 1 year ago

@spilin would you change to build Blockscout with Docker image? Current image (master tag) is built on top of Alpine 3.18 https://github.com/blockscout/blockscout/blob/c46aa15d0bcb1d2a6aab15a9db03409ea46b4bd3/docker/Dockerfile#L1 and has no issues with precompiled NIF.

spilin commented 1 year ago

I will do that when will get a chance. As of now I still get:

Generated rustler_precompiled app
==> ex_secp256k1
Compiling 2 files (.ex)

== Compilation error in file lib/ex_secp256k1/impl.ex ==
** (RuntimeError) precompiled NIF is not available for this target: "x86_64-alpine-linux-musl".

But I resolved this by using:

export EX_SECP256K1_BUILD=true
export EXKECCAK_BUILD=true
export TARGET_VENDOR=unknown

So if it's only me who gets this error - you can close it.