How to update .tool-versions?

I have a .tool-versions with this:

erlang 25.2.3
elixir 1.14.3-otp-25

How do I update it and should I?

Hey, this file is only used by external tool like (like ASDF) to manage your languages versions (here Erlang and Elixir).
You can simply edit the versions or use asdf local elixir x.y.z :ok_hand:

2 Likes

I think if you edit the .tool-versions file manually, you’ll need to run asdf install elixir [new-version] afterward (where [new-version] is the version you changed the file to use).

I finally ran into this issue recently, and there wasn’t a lot of material on the subject that I could find:

I guess the good news is more or less that the process is pretty straightforward. Just bump and install the new Erlang + Elixir versions, run the tests, and fix any issues that come up. The compiler should show warnings for any new deprecations.

Don’t forget to bump the dependencies in your mix.exs file as well:

mix hex.outdated

https://hexdocs.pm/hex/Mix.Tasks.Hex.Outdated.html

mix deps.update --all

https://hexdocs.pm/mix/Mix.Tasks.Deps.Update.html

And if you ended up adding any dependencies at some point that are no longer needed, then you can remove those as well:

1 Like

It depends on whether you want to change the versions of the tools you are using or not… You can change it manually by editing the file or running something like asdf local elixir latest. It’s essentially the same, but if you change the files manually, beware of typos since you can introduce a non-existing version that will prevent you from setting up your environment with asdf install later.

2 Likes

And the file .tool-versions is also compatible with mise, a more recent tool to manage your tools.

1 Like

I manually update the file and then run asdf install.

2 Likes

Using mend renovate! :wink: