erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

rebar3_hex v6.11.3 does not run on OTP 24.0 #226

Closed jj1bdx closed 3 years ago

jj1bdx commented 3 years ago

Synopsis: the rebar3 used by mix as ~/.mix/rebar3 was obsolete. Updating the rebar3 by mix local.rebar solved this issue.

When I tried to compile elixir-ls on OTP 24.0 with Elixir 1.11.4, the following error was generated. Compiling elixir-ls on OTP 23.3.4 with Elixir 1.11.4 didn't generate this error and went fine.

% mix deps.compile
===> Fetching rebar3_hex v6.11.3
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/rebar3_hex-6.11.3.tar is up to date, reusing it
escript: exception error: undefined function erlang:get_stacktrace/0
  in function  rebar3:main/1 (/tmp/cirrus-ci-build/src/rebar3.erl, line 72)
  in call from escript:run/2 (escript.erl, line 750)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3
** (Mix) Could not compile dependency :forms, "/Users/kenji/.mix/rebar3 bare compile --paths="/Users/kenji/src/elixir-ls/_build/shared/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile forms", update it with "mix deps.update forms" or clean it with "mix deps.clean forms"
ferd commented 3 years ago

I've been compiling it on OTP-24 release candidates without much of a problem, so that's sort of surprising. Which version of rebar3 are you using?

tsloughter commented 3 years ago

Is rebar3_hex in your global plugins?

This must be mix using its own rebar3 which is likely old.

paulo-ferraz-oliveira commented 3 years ago

it on OTP-24 release candidates without much of a problem

Me too; I stated this over Slack. The issue got split between Slack and GitHub 😄

using its own rebar3 which is likely old.

I thought about some magic like this, but I don't know enough mix yet.

paulo-ferraz-oliveira commented 3 years ago

@jj1bdx, from the doc.s it seems you can override the rebar3 version.

ferd commented 3 years ago

yeah mix tends to bundle builds and even our latest official release was built with OTP-19 to be compatible with all follow-up versions. By deprecating stacktraces we can build rebar3 on OTP-20 still, but it needs to be built on OTP-21 (or later) to be compatible with OTP-24. Our CI rules have been updated for that, but the version bundled with Mix is much older than this.

jj1bdx commented 3 years ago

The failed configuration was:

% # at my login directory
% ./.mix/rebar3 version
rebar 3.13.1 on Erlang/OTP 23 Erts 11.2.2

After performing mix local.rebar of Elixir 1.11.4:

% ~/.mix/rebar3 version
rebar 3.14.4 on Erlang/OTP 23 Erts 11.2.2

Then building elixir-ls on OTP 24.0 went fine.

So I guess the reason seemed to be that the rebar3 used by mix was older than it was supposed to be.

Thanks for help to all!