Which Elixir release targets which Erlang release?

When i run an older version of Elixir with a newer version of Erlang it gives me weird errors.
I use asdf for version management.
Do I need to compile an Elixir release with an Erlang release, with which it was compiled by Elixir’s core team during the time of that release?
If yes, how do I know which Elixir release targets which Erlang release?

There is a tag You can add when installing Elixir with asdf…

-otp-${OTP_MAJOR_VERSION}

Do You use it?

2 Likes

https://bobs-list.kobrakai.de/ shows all available versions. You can also find the link in the readme of asdf-elixir’s github repo.

4 Likes

Nice :slight_smile:

1 Like

No, I don’t use it. How do I use it, so that it installs the correct Erlang version for my specific Elixir version?

It doesn’t show when a specific Elixir version was released with what version of Erlang it was built.
How do I know that.

Thank you @kokolegorille and @LostKobrakai!

If you install the default versions via asdf you’re correct it doesn’t show the otp version explicitly, but this means elixir is build using the lowest supported otp version, which currently is 19. Basically you can expect it to be 1 version below the first explicit -otp-xx version available for the given elixir version.

1 Like

Let’s say You have installed erlang 21.3 and You want to install Elixir 1.8.3, You would type…

asdf install elixir 1.8.3-otp-21

If You do not specify otp version, it will compile Elixir with the oldest otp version available.

1 Like

Why oldest? What is the benefit of the oldest version being used?

From asdf elixir plugin documentation…

The precompiled packages are built against every officially supported OTP version, however if you only specify the elixir version, like 1.4.5, the downloaded binaries will be those compiled against the oldest OTP release supported by that version.

PS: Maybe supporting oldest is better for compatibility reason.

1 Like

There is a table available in the elixir documentation, which exactly tells the range of known-to-work OTP versions:

https://hexdocs.pm/elixir/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp

The regular prebuild package which is distributed via the elixir homepage and installed via asdf when you do not specify an OTP release, is built against the lowest supported OTP version.

As you already have been told, there are prebuilts for the other supported OTP versions distributed via “bob” and asdf uses them when using the ${elixir_vsn}-otp-${erlang_version} syntax.

Anyway, asdf does not know that 1.8.0-otp-23 actually needs OTP 23, you need to make sure that you set up your .asdf-versions file correctly (or whatever that file was called).

asdf helps you manage that file through the asdf local command.

PS: I’m currently at my home laptop which doesn’t have asdf available, therefore I can not currently check exact syntax and names of related config files.

4 Likes

Thank you all for the replies and the time!