Why my Elixir Phoenix project is redefining the "Prelude" modules only on a nix-shell?

I migrated to NixOS and it’s being such a great option to create reproducible dev environment and all elixir-erlang related packges are awesome. So I created a shell.nix file as:

https://gist.github.com/Mdsp9070/e562e4caa7349ee26156fce8fd1a945e

but every time I compile my project I get these warnings:

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/iex/info.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/iex/info.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/iex/info.ex:1

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

Any bets?

1 Like

This is a long known issue: #85265

It is related somehow to having Elixir itself set within the ERL_LIBS environment variable.
But as you set this yourself already, I’m not sure why it affects you.

Try to unset ERL_LIBS once to test if it caused by something else…

2 Likes