akash-akya/exile

Fails to compile in Alpine

nsweeting opened this issue ยท 3 comments

Hi there,

Exile is failing to compile in Alpine (3.17 and 3.18 tried) via docker.io/hexpm/elixir:1.14.2-erlang-25.1.2-alpine-3.18.0 at the moment. Here is the stacktrace:

#22 61.28 ==> exile
#22 61.28 mkdir -p priv
#22 61.28 cc -I/usr/local/lib/erlang/usr/include -fPIC -shared -Wall -Werror -Wno-unused-parameter -pedantic -std=c99 -O2 -fsanitize=undefined -D_POSIX_C_SOURCE=200809L c_src/exile.c -o priv/exile.so
#22 61.42 /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: cannot find -lubsan: No such file or directory
#22 61.42 collect2: error: ld returned 1 exit status
#22 61.42 make: *** [Makefile:21: priv/exile.so] Error 1
#22 61.43 could not compile dependency :exile, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile exile", update it with "mix deps.update exile" or clean it with "mix deps.clean exile"
#22 61.43 ==> conduit
#22 61.43 ** (Mix) Could not compile with "make" (exit status: 2).
#22 61.43 You need to have gcc and make installed. If you are using
#22 61.43 Ubuntu or any other Debian-based system, install the packages
#22 61.43 "build-essential". Also install "erlang-dev" package if not
#22 61.43 included in your Erlang/OTP version. If you're on Fedora, run
#22 61.43 "dnf group install 'Development Tools'".
#22 61.43

The build is including alpine-sdk (functional equivalent to build-essential).

Thanks

Hi @nsweeting, thanks for reporting the issue.

I created a fix, can you try dev branch to see if works?

{:exile, github: "akash-akya/exile", branch: "dev"}

Hi @akash-akya - thanks for the quick followup. I was able to compile in an alpine based build successfully from your dev branch ๐Ÿ‘

@nsweeting released v0.7.0 with the fix ๐ŸŽ‰