Is the default Elixir version truly the latest?

I’m getting this error during compilation for my latest Phoenix/Elixir release:

Nov 18 07:40:57 AM  ** (CompileError) lib/seeker/parsing/dt_listing_parser.ex:87: cannot find or invoke local is_map_key/2 inside guard. Only macros can be invoked in a guard and they must be defined before their invocation

This has been supported in Elixir since v1.10 released in January and the only way I can reproduce this locally is falling back to an earlier version.

This is from the Render Elixir docs:

By default, Render uses the most recent Elixir release and the latest Erlang/OTP version compatible with it.

Any thoughts on what’s happening here? I do not set the environment variables linked by that doc in my app.

Render is currently using Elixir v1.10.2 What versions are you using locally to get that failure?

render@srv-bkolge8rvnpqtm6f2og0-8688979884-rcjpb:~/project/src$ elixir -v
Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:8:4] [ds:8:4:10] [async-threads:1] [hipe]

Elixir 1.10.2 (compiled with Erlang/OTP 22)

As far as I can tell, that is not true on my instance at compile time. To prove this, I updated my ./build.sh script to the following:

#!/usr/bin/env bash
# exit on error
set -o errexit

# output the version during compilation
elixir --version
mix deps.get --only prod
MIX_ENV=prod mix compile
# ... other steps don't matter here since the script doesn't get this far

The output of elixir --version is visible in the deploy logs on my application and outputs the following:

Nov 18 10:27:56 PM  Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe]
Nov 18 10:27:56 PM  
Nov 18 10:27:56 PM  Elixir 1.9.4 (compiled with Erlang/OTP 22)

To answer your original question, I have to downgrade to a version before v1.10 to see the error since the ability to use is_map_key in a guard was added in v1.10

A second question which is much less urgent than my prior one above - if Render is currently defaulting to v1.10.2, that means the Render Elixir docs are wrong:

By default, Render uses the most recent Elixir release and the latest Erlang/OTP version compatible with it.

There have been several minor releases and a major version released since v1.10.2 was released back in Feb of 2020

My apologies, apparently I was wrong. I did a simple test of checking the version in an elixir deployment that we have. You are correct that our docs are wrong. The base image is elixir 1.9.4, and you can set the version with Environment variables. Basically exactly your OP and I stuck my foot right into my mouth. I’ll make an issue to update the docs.

1 Like

Great, thanks for confirming. I’ll use the environment variables to specify a newer version in that case.

Just checking in - any news on updated docs?

The docs have been updated: https://render.com/docs/elixir-erlang-versions

1 Like