Which version of elixir-otp-erlang can we use with dialyzer?

226 views Asked by At

Background

The newest version of Elixir (1.7.X) has a bug that prevents the usage of dialyzer 16.

Now, I am aware that some previous versions were free from this problem, but I don’t know which ones.

What I tried

I have tested the following builds:

1.7.2-otp-21
1.7.3-otp-21
1.7.4-otp-21

All failed to work properly.

The bug can be reproduced with the MWE:

Question

What is the latest version of elixir-otp-erlang that is not affected by this bug?

2

There are 2 answers

2
Marcos Tapajós On BEST ANSWER

I wrote a script (using official docker images) to test against all 1.7 versions and all of them failed.

The lasted version that works seems to be 1.6.6.

root@0697cad23f07:/data# mix dialyzer
Finding suitable PLTs
Checking PLT...
[:accept, :compiler, :crypto, :elixir, :kernel, :logger, :mime, :plug, :plug_crypto, :prometheus, :prometheus_ex, :prometheus_plugs, :stdlib]
PLT is up to date!
Starting Dialyzer
[
  check_plt: false,
  init_plt: '/data/_build/dev/dialyxir_erlang-20.3.8.14_elixir-1.6.6_deps-dev.plt',
  files_rec: ['/data/_build/dev/lib/myapp/ebin'],
  warnings: [:unknown]
]
Total errors: 0, Skipped: 0
done in 0m2.83s
done (passed successfully)
0
m3characters On

I'm not sure what is your other setup, but as I mentioned before, for me it works with the following:

$ mix dialyzer
Finding suitable PLTs
Checking PLT...
[:asn1, :bamboo, :bcrypt_elixir, :cache_server, :certifi, :compiler, :connection, :core, :cors_plug, :cowboy, :cowlib, :crypto, :database, :db_connection, :decimal, :ecto, :eex, :elixir, :elixir_make, :gettext, :hackney, :idna, :jason, :kernel, :logger, :metrics, :mime, :mimerl, :parse_trans, :phoenix, :phoenix_html, :phoenix_pubsub, :plug, :poison, :poolboy, :postgrex, :public_key, :ranch, :runtime_tools, :ssl, :ssl_verify_fun, :stdlib, :unicode_util_compat]
PLT is up to date!
Starting Dialyzer
[
  check_plt: false,
  init_plt: '/______/code/aetherwars_umbrella/_build/dev/dialyxir_erlang-21.0_elixir-1.7.2_deps-dev.plt',
  files_rec: ['/______/code/aetherwars_umbrella/_build/dev/lib/web/ebin',
   '/______/code/aetherwars_umbrella/_build/dev/lib/cache_server/ebin',
   '/______/code/aetherwars_umbrella/_build/dev/lib/database/ebin',
   '/______/code/aetherwars_umbrella/_build/dev/lib/core/ebin'],
  warnings: [:unknown]
]
Total errors: 70, Skipped: 0
done in 2m2.05s

Umbrella mix.exs:

# ...
def project do
    [
      apps_path: "apps",
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      dialyzer: [plt_add_deps: :transitive],
      aliases: aliases()
    ]
  end

#....

defp deps do
    [
      {:dialyxir, "~> 1.0.0-rc.3", only: [:dev], runtime: false},
      {:benchee, "~> 0.11", only: :dev}
    ]
end