Managing archives when upgrading to Elixir 1.12

TL;DR: Make sure you update your archives when upgrading!

If you’ve been following Elixir news lately, you’ll know that the very exciting release of Elixir 1.12 happened this May. This comes with a ton of great new features, including Mix.install, jit (just in time) compilation, a farewell to severalargument error messages, and plenty of other great improvements. Check out the full list of release notes here.

By and large, the upgrade to 1.12 is pretty easy. For debian users, running sudo apt-get upgrade does a pretty good job of fetching all the latest packages and their dependencies, assuming you installed Elixir according to the installation instructions on Elixir’s main website. However, as with all software upgrades, some things require a little bit more meddling to get right.

When going through my own upgrade process, I decided to test out some of the new features of Elixir 1.12 in a new Phoenix Liveview side project (project #68123 or something like that…).

I first began to get a sense that things weren’t behaving normally when I saw this output, following the common mix phx.new --live my_new_sideproject command.

Steps are missing…?

These messages typically appear whenever an error happened during project initialization. So seeing them here means that something definitely went wrong. The only thing to do was to go through the steps manually and see what happened…

Well these are new…

Pretty much immediately mix deps.get started throwing errors.

I’ve never encountered the :ssl.cipher_suites/1 function before, but it seems like this was coming from an older version of the :ssl Erlang package — which, if you think about it, makes sense. Elixir 1.12 requires an updated version of several Erlang packages as well. When upgrading, you’ll notice the list of dependencies that your package manager will tell you will also be added.

New packages installed as part of the upgrade

One other interesting thing to note is that, in my particular case, esl-erlang became split into several packages. This became an important thing to remember later on.

In thinking about what is actually calling :ssl.cipher_suites, it occurred to me that the hex archive is probably what was causing the issue.

These were the `hex` and `phx_new` archives installed prior to the upgrade

hex can easily be upgraded to the latest version by using mix local.hex. Since I assumed it would also become an issue, I also reinstalled the latest version of phx_new using mix archive.install hex phx_new.

The newer versions

After installing the newer versions of hex and phx_new, I deleted the new project and started over.

This looks more like normal

Now things seem to be working fine. mix deps.get was able to return successfully, so all the dependencies are loaded.

After starting my local postgres database (thank you, Docker), I tried to run mix ecto.create and…

More errors!

Not out of the woods yet.

Remember earlier I mentioned that Erlang appeared to be split into several packages? This is how we found that the :ssl package might have been changed.

Well, if you read the error closely, you’ll actually see that gettext requires erlang-dev and erlang-parsetools packages. These were originally part of the complete Erlang package installation, but are now split out into separate packages that you must install manually.

Simply running sudo apt-get erlang-dev erlang-parsetools installed the required packages, and gets us running.

Success!

Everything now compiles, and we’re off to explore the new features of Elixir 1.12.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Combs

Andrew Combs

I'm a dad, software engineer, and plane enthusiast, and I will happily blab about any of those things for longer than most people care to listen!