asdf-vm / asdf-elixir

Elixir plugin for asdf version manager
https://github.com/asdf-vm/asdf
MIT License
473 stars 70 forks source link

Why Erlang doesn't seem to be really required? #57

Closed thbar closed 5 years ago

thbar commented 5 years ago

Please bear with me as I'm only starting to use asdf-elixir!

The readme states that:

Elixir requires Erlang to be installed. You can use the asdf-erlang plugin to install Erlang versions.

and later:

Be sure to also install the corresponding Erlang/OTP version with asdf-erlang, and to have both selected versions in your .tool-versions file.

I found the installation of Erlang to be very long (presumably from source) though, and I realised that for some reason, if I remove all traces of Erlang on my machine (such as previously installed with brew, but also installed with asdf-erlang), asdf-elixir will install Elixir just fine.

With that version of Elixir, I'm perfectly able to run mix tests or run my server.

This made me wonder: why is Erlang required, if that's the case? Are there specific things that will break later? Or am I in a situation where Erlang isn't truly required (or just bundled with Elixir, since I understand precompiled binaries bundle Erlang/OTP)?

Thanks for your highlights. Happy to update the readme with whatever I will have learned in the process.

DavidOliver commented 5 years ago

I don't have full answers to your questions, but these issues seem relevant: #47 #52.

So it seems you really should install Erlang in addition to Elixir. E.g.:

# Erlang
asdf plugin-add erlang
asdf install erlang 21.2
asdf global erlang 21.2

# Elixir
asdf plugin-add elixir
asdf install elixir 1.7.4-otp-21
asdf global elixir 1.7.4-otp-21
taiansu commented 5 years ago

@thbar Because what asdf installed is a pre-built version of Elixir, so Erlang is only required when you try to execute elixir command, e.g., iex, elixirc.

That is to say, Erlang can be installed after Elixir, or even using homebrew or directly from the source, instead of asdf-erlang. As long as Elixir can reference an Erlang executable, everything should work without any issue.

thbar commented 5 years ago

Perfect - many thanks @taiansu for the detailed answer!

Maybe this is worth transforming into a doc PR, because I'm pretty sure other will wonder at some point.

Stratus3D commented 5 years ago

Thanks @taiansu! I've added a note in the readme about this - https://github.com/asdf-vm/asdf-elixir#elixir-precompiled-versions. If you see anything else that can be improved please open another issue.