.elixir-version File Proposal
When it comes to version management Elixir has quite a few options. The official site lists asdf, exenv, and kiex for Elixir, and kerl for Erlang. One thing Elixir version managers still lack is a common version file supported by all of them. In Ruby there is the
.ruby-version file and all the major version managers support it. It would be nice to have a version file for Elixir that is version manager agnostic too. This has previously been proposed on the kiex issue tracker - https://github.com/taylor/kiex/issues/53, https://github.com/taylor/kiex/pull/54
The proposal on the kiex issue tracker seems like generally a good solution. To outline the specifics about my proposal for an
- It would be a flat file named
- The file would contain a full Elixir version. No wildcards or partial versions. Think of it as the version manager equivalent of a mix.lock file, not a mix.exs file.
- The could be used by any version manager but it would not enforce any specific behavior on the version manager. It’s simply indicates the Elixir version that should be used.
Note that we can’t use the version specified in
mix.exs because there is no good way to get that version without already having a version of Elixir installed and available. We could use grep/sed/awk to extract the version, but it’s not required to be a full Elixir version, and manually extracting it from a
mix.exs file seems a bit hacky.
What would it take to implement this? We are already pretty close.
- exenv appears to already have support for an
.elixir-versionfile that matches what I’ve described here. It’s likely no changes to exenv would be needed.
- kiex would need some work done, but there is already a PR out to add support for this (https://github.com/taylor/kiex/pull/54).
- asdf-elixir doesn’t have support for an
.elixir-versionfile, but with legacy file support it would be trivial to add (I’m a maintainer of asdf).
I want to hear everyone’s thoughts on this. Specifically:
- Is this something worth doing? If everyone is happy with the current state of things, there is no need trying to define a convention and then get it implemented.
- Do you think this is a good approach? Maybe we shouldn’t have a separate file for specifying the full Elixir version?
- Do you think there is anything my
.elixir-versionproposal that should be different or could be improved?