Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebar3 woes #47

Open
ericb-summit opened this issue May 29, 2023 · 6 comments
Open

rebar3 woes #47

ericb-summit opened this issue May 29, 2023 · 6 comments

Comments

@ericb-summit
Copy link

I realize this is not directly evm problem, but just asking if there's some way to kill 2 birds with one stone here.

It looks like something changed in > erl23 and a rebar3 compiled with sayl, er23 barfs when run against erl25 with

init terminating in do_boot ({undef,[{rebar3,main,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

This requires recompiling rebar3 when switching with evm. What would be the cleanest way to leverage how evm works such that switching evm would also switch rebar3 version? I can do the work and send a PR. Thanks.

@robisonsantos
Copy link
Owner

robisonsantos commented May 29, 2023 via email

@ericb-summit
Copy link
Author

Sorry let me be sure I explained properly:

Let's say I evm use 23.3.4.18, and install rebar3 from sources, which is just ./bootstrap && ./rebar3 local install which pops it into ~/.cache/rebar3/bin/rebar3. Of course rebar3 works fine at this point.

Now if I, say evm use 25.3.2, rebar3 won't work, due to some incompatibility between the compiled rebar3 and erl/otp 25.3.2. So, I have to rebuild it, git clean -dffx && ./bootstrap && ./rebar3 local install and this newly compiled rebar3 will work on 25.3.2.

But then going back to evm use 23.3.4.18 I would have to recompile rebar3 again.

So my question was, in a way: is there some place I could put the version-specific rebar3 so a specific rebar3 would follow evm use xxx ? Would it be okay if we simply placed rebar3 for example in ~/.evm/erlang_versions/otp_src_25.3.2/bin/erl for 25.3.2 and similarly for other versions?

@robisonsantos
Copy link
Owner

robisonsantos commented May 30, 2023 via email

@ericb-summit
Copy link
Author

This is what installed rebar3 looks like

#!/usr/bin/env sh
## Rebar3 3.22.0+build.5277.ref44d0587a
REBAR3_VSN=${REBAR3_VSN:-3.22.0+build.5277.ref44d0587a}
erl -pz /home/enry/.cache/rebar3/vsns/${REBAR3_VSN}/lib/*/ebin +sbtu +A1 -noshell -boot start_clean -s rebar3 main $REBAR3_ERL_ARGS -extra "$@"

Within that .cache/rebar3/.. folder are beam files kind of like an installed erlang release. That complicates things a bit. I think I might reach out to ferd to get his input on this.

@robisonsantos
Copy link
Owner

robisonsantos commented May 30, 2023 via email

@ericb-summit
Copy link
Author

Ok so turns out rebar3 is by design friendly to current +2 versions of erlang.

So:

  • Compile for 23, use on 24, 25 (I got my example above mixed up)
  • Compile for 25, won't work on 23, or 24 (this is what I meant to write above), only works on 25,26,27

I can live with with current + 2 version it's a fair limitation. We can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants