setup-erlang icon indicating copy to clipboard operation
setup-erlang copied to clipboard

wrong rebar3 version included

Open sebastiw opened this issue 4 years ago • 7 comments

default rebar3 version included can't be used together with older otp releases https://github.com/actions/virtual-environments/blob/ubuntu18/20210606.1/images/linux/Ubuntu1804-README.md

for instance running ubuntu bionic with 21.3.8.17 gives

escript: exception error: undefined function rebar3:main/1
  in function  escript:run/2 (escript.erl, line 758)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3 
Error: Process completed with exit code 127.

sebastiw avatar Jun 14 '21 09:06 sebastiw

@sebastiw, I'm not sure setup-erlang does anything with rebar3 (are you using the system's - container's - default?). You need to include it yourself, in that case. Here's an example: https://github.com/erlang-lager/lager/blob/master/.github/workflows/ci.yml#L40. You might want to target a specific GitHub release, though, found here: https://github.com/erlang/rebar3/releases.

paulo-ferraz-oliveira avatar Jun 14 '21 10:06 paulo-ferraz-oliveira

it doesn't, but according to the examples it seems it does :( I think all the examples should be updated wrt this case.

I couldn't even get $env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH" to work.

sebastiw avatar Jun 14 '21 10:06 sebastiw

I couldn't even get $env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH" to work.

Are you doing something like https://github.com/erlang-lager/lager/blob/master/.github/workflows/ci.yml#L43? The | and & are relevant there, IIRC.

paulo-ferraz-oliveira avatar Jun 14 '21 10:06 paulo-ferraz-oliveira

I think all the examples should be updated wrt this case.

Sure, I guess. It's arguable, though. The examples rely on the system's default rebar3 which has a support maintenance window (e.g. 3.15.2 is 19-23, 3.16.0 is 22-24) so you either keep changing the examples in the README, document the compatibility list (which also needs to be updated from time to time) or rely on issues like these for history 😄

paulo-ferraz-oliveira avatar Jun 14 '21 10:06 paulo-ferraz-oliveira

I couldn't even get $env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH" to work.

Are you doing something like https://github.com/erlang-lager/lager/blob/master/.github/workflows/ci.yml#L43? The | and & are relevant there, IIRC.

Ah might have missed those two |, &, will test again, thanks.

I think all the examples should be updated wrt this case.

Sure, I guess. It's arguable, though. The examples rely on the system's default rebar3 which has a support maintenance window (e.g. 3.15.2 is 19-23, 3.16.0 is 22-24) so you either keep changing the examples in the README, document the compatibility list (which also needs to be updated from time to time) or rely on issues like these for history smile

but why give information on features not supported? that is just confusing in my opinion. either it should be explicit that rebar3 comes from ubuntu-default, or the examples shouldn't mention rebar3 at all, or this action should make sure that there is a compatible version of rebar3 per the otp-version option. otherwise the examples could as well mention how to run python or npm :P

On the note of updating the readme based on compatibility list: wouldn't you need to to that either way, because when whatever rebar3 version that is released doesn't support OTP-23 the examples doesn't work anymore.

just my 2 cents

sebastiw avatar Jun 14 '21 15:06 sebastiw

I agree the examples might be misleading, but only the maintainers of the repo. know why this decision was made. Stuff changes with time, so it's even probable (most likely) nobody was aware of this up until now.

Regarding the examples (compatibility), if you choose specific Erlang and rebar3 versions this should work even if rebar3 stops supporting a given Erlang version, because the versions would be fixed. But then you have to take the container into account...

In any case, whatever you feel could be improved in the doc. can also be the subject of a pull request on your behalf 😉

paulo-ferraz-oliveira avatar Jun 15 '21 10:06 paulo-ferraz-oliveira

I opened #11 as proof of concept, please give me feedback

sebastiw avatar Jun 16 '21 21:06 sebastiw