rebar3
rebar3 copied to clipboard
rebar3 installed with local install crashes if you attempt to set VSN variable
I've got a rebar.config.script
that expects the VSN
environment variable to be set, but rebar3 crashes if it is.
Reproduction
- Compile from source (I used main @2189a408d6c8ae239f730ca41a5ad3c651a90643), using
./bootstrap
- Install with
./rebar3 local install
. - Add
$HOME/.cache/rebar3/bin
to$PATH
. - Run
VSN=1 rebar3
; it crashes withinit terminating in do_boot ({undef,[{rebar3,main,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})
Investigation
This is because rebar3 local install
uses a wrapper script to locate the rebar3 files, and it uses the VSN
environment variable to do that. Unless you specify a "valid" VSN (e.g. 3.19.0 or 3.20.0), it crashes.
Suggestion
Co-opting the VSN
variable is bad form. I suggest that the script use REBAR3_VSN
instead. I'm aware that this might break something, but is the use of VSN
documented as allowing using a different rebar3?
Yeah it's undocumented, so I think switching to REBAR3_VSN ought to be entirely safe. I can open up a PR.