erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Build failing on Alpine #558

Closed freiden closed 7 years ago

freiden commented 7 years ago

Hi, It seems like the version 3.22.1 of the library, released 2 days ago, fails to build on Alpine Linux with the following infos:

Compiling relx
===> Compiling src/rlx_topo.erl failed
include/relx.hrl:18: can't find include lib "erlware_commons/include/ec_cmd_log.hrl"
include/relx.hrl:19: can't find include lib "providers/include/providers.hrl"

src/rlx_topo.erl:124: undefined macro 'PRV_ERROR/1'

src/rlx_topo.erl:72: function iterate/3 undefined
src/rlx_topo.erl:117: spec for undefined function iterate/3

src/rlx_topo.erl:144: function subtract/2 is unused
src/rlx_topo.erl:149: function remove_duplicates/1 is unused
src/rlx_topo.erl:166: function remove_pairs/2 is unused

** (Mix) Could not compile dependency :relx, "/root/.mix/rebar3 bare compile --paths "/app/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile relx", update it with "mix deps.update relx" or clean it with "mix deps.clean relx"

It could be due to some erlang dependencies packages not available yet on Alpine or something else.

It seems like @tsloughter met a similar problem with rebar3 in 2015 (https://github.com/erlang/rebar3/issues/349) but didn't indicate how he solved it.

Thanks by advance for your answer.

lrascao commented 7 years ago

does 3.22.0 build ok?

nlap commented 7 years ago

Just seeing this on Ubuntu 16.04 as well

3.22.0 builds fine

lrascao commented 7 years ago

cool, that narrows it down a bit, same OTP versions in both? @freiden any easy way of debugging this on an Alpine Linux?

freiden commented 7 years ago

@lrascao The 3.22.0 build is ok. I'm not sure, I just started playing with it on Docker and I'm still new to how to manage it, sorry.

lrascao commented 7 years ago

k, i'll try the Docker thing then, any image name you recommend?

freiden commented 7 years ago

You can try those images:

nlap commented 7 years ago

FYI, the version info for me: Erlang/OTP 19 [erts-8.2] [source-fbd2db2] [64-bit]

lrascao commented 7 years ago

@nlap are you building relx all by itself or as part of some other project? can you post the command to what you're building?

nlap commented 7 years ago

relx is a dependency in exrm, that I'm using to release an Elixir project with mix release

I don't know a lot about how the whole build process works, but it did fail with the exact same rebar3 error as @freiden posted.

Happy to help with debugging however I can. I was able to fix my elixir release by forcing relx version 3.22.0 in my project's top-level mix.exs:

defp deps do  
    [{:relx, "3.22.0"}
    ...]
lrascao commented 7 years ago

can you share your project? or maybe come up with a simple one that exhibits this behaviour?

nlap commented 7 years ago

Hmm, I can't reproduce it now. I brought a 16.04 box up from scratch and tried a similar project but 3.22.2 is compiling fine now. Maybe something else was messed up in that env at the time.

Since I wrote them down already, here are my steps: https://gist.github.com/nlap/0ab724235b00a7207a3867ecd971d31f

lrascao commented 7 years ago

Tristan detected an issue with 3.22.1, marked it as Retired on hex.pm and replaced it with 3.22.2, maybe this explains the behaviour you were getting before and not anymore

tsloughter commented 7 years ago

Ah, yes, most likely.

freiden commented 7 years ago

I updated the library and i seems to work now. Thanks.