jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.69k stars 141 forks source link

Unknown dialyzer warning option: race_conditions with OTP 25.0.4 #470

Closed gabrielpedepera closed 1 year ago

gabrielpedepera commented 1 year ago

Environment

Elixir & Erlang/OTP versions (elixir --version):

Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Elixir 1.14.0 (compiled with Erlang/OTP 25)

Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir):

"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},

Current behavior

To demostraste this behaviour I have create an application through the command mix new dummy_app and having mix.exs with dialyxir like that:

defmodule DummyApp.MixProject do
  use Mix.Project

  def project do
    [
      app: :dummy_app,
      version: "0.1.0",
      elixir: "~> 1.14",
      start_permanent: Mix.env() == :prod,
      dialyzer: dialyzer(),
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger]
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:dialyxir, "~> 1.1", only: [:dev, :test], runtime: false}
      # {:dep_from_hexpm, "~> 0.3.0"},
      # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
    ]
  end

  defp dialyzer do
    [
      plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
      flags: [:error_handling, :underspecs, :race_conditions],
      plt_add_apps: [:mix],
      ignore_warnings: "dialyzer.ignore-warnings"
    ]
  end
end

as feedback of the command mix dialyzer I got the error :dialyzer.run error: Unknown dialyzer warning option: race_conditions

Workspace/elixir/dummy_app via 🔮 v1.14.0 (OTP 25)
❯ mix dialyzer
Finding suitable PLTs
Checking PLT...
[:compiler, :elixir, :kernel, :logger, :mix, :stdlib]
Looking up modules in dialyzer.plt
Looking up modules in dialyxir_erlang-25.0.4_elixir-1.14.0.plt
Looking up modules in dialyxir_erlang-25.0.4.plt
Finding applications for dialyxir_erlang-25.0.4.plt
Finding modules for dialyxir_erlang-25.0.4.plt
Creating dialyxir_erlang-25.0.4.plt
Looking up modules in dialyxir_erlang-25.0.4.plt
Removing 3 modules from dialyxir_erlang-25.0.4.plt
Checking 18 modules in dialyxir_erlang-25.0.4.plt
Adding 185 modules to dialyxir_erlang-25.0.4.plt
done in 0m10.81s
Finding applications for dialyxir_erlang-25.0.4_elixir-1.14.0.plt
Finding modules for dialyxir_erlang-25.0.4_elixir-1.14.0.plt
Copying dialyxir_erlang-25.0.4.plt to dialyxir_erlang-25.0.4_elixir-1.14.0.plt
Looking up modules in dialyxir_erlang-25.0.4_elixir-1.14.0.plt
Checking 203 modules in dialyxir_erlang-25.0.4_elixir-1.14.0.plt
Adding 253 modules to dialyxir_erlang-25.0.4_elixir-1.14.0.plt
done in 0m9.38s
Finding applications for dialyzer.plt
Finding modules for dialyzer.plt
Copying dialyxir_erlang-25.0.4_elixir-1.14.0.plt to dialyzer.plt
Looking up modules in dialyzer.plt
Checking 456 modules in dialyzer.plt
Adding 163 modules to dialyzer.plt
done in 0m21.73s
:ignore_warnings opt specified in mix.exs: dialyzer.ignore-warnings, but file does not exist.

Starting Dialyzer
[
  check_plt: false,
  init_plt: '/Users/gabriel.pereira/Workspace/elixir/dummy_app/priv/plts/dialyzer.plt',
  files: ['/Users/gabriel.pereira/Workspace/elixir/dummy_app/_build/dev/lib/dummy_app/ebin/Elixir.DummyApp.beam'],
  warnings: [:error_handling, :underspecs, :race_conditions, :unknown]
]
:dialyzer.run error: Unknown dialyzer warning option: race_conditions
Halting VM with exit status 1

Expected behavior

If I change to using OTP 24 instead I'm able to run the dialyzer successfully

Erlang/OTP 24 [erts-12.3.2.6] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]
Elixir 1.14.0 (compiled with Erlang/OTP 24)
Workspace/elixir/dummy_app via 🔮 v1.14.0 (OTP 24)
❯ mix dialyzer
==> erlex
Compiling 2 files (.erl)
Compiling 1 file (.ex)
Generated erlex app
==> dialyxir
Compiling 64 files (.ex)
Generated dialyxir app
==> dummy_app
Compiling 1 file (.ex)
Generated dummy_app app
Finding suitable PLTs
Checking PLT...
[:compiler, :elixir, :kernel, :logger, :mix, :stdlib]
Looking up modules in dialyzer.plt
Looking up modules in dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
Looking up modules in dialyxir_erlang-24.3.4.6.plt
Finding applications for dialyxir_erlang-24.3.4.6.plt
Finding modules for dialyxir_erlang-24.3.4.6.plt
Creating dialyxir_erlang-24.3.4.6.plt
Looking up modules in dialyxir_erlang-24.3.4.6.plt
Removing 3 modules from dialyxir_erlang-24.3.4.6.plt
Checking 18 modules in dialyxir_erlang-24.3.4.6.plt
Adding 184 modules to dialyxir_erlang-24.3.4.6.plt
done in 0m22.43s
Finding applications for dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
Finding modules for dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
Copying dialyxir_erlang-24.3.4.6.plt to dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
Looking up modules in dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
Checking 202 modules in dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
Adding 253 modules to dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt
done in 0m19.99s
Finding applications for dialyzer.plt
Finding modules for dialyzer.plt
Copying dialyxir_erlang-24.3.4.6_elixir-1.14.0.plt to dialyzer.plt
Looking up modules in dialyzer.plt
Checking 455 modules in dialyzer.plt
Adding 164 modules to dialyzer.plt
done in 0m53.64s
:ignore_warnings opt specified in mix.exs: dialyzer.ignore-warnings, but file does not exist.

Starting Dialyzer
[
  check_plt: false,
  init_plt: '/Users/gabriel.pereira/Workspace/elixir/dummy_app/priv/plts/dialyzer.plt',
  files: ['/Users/gabriel.pereira/Workspace/elixir/dummy_app/_build/dev/lib/dummy_app/ebin/Elixir.DummyApp.beam'],
  warnings: [:error_handling, :underspecs, :race_conditions, :unknown]
]
Total errors: 0, Skipped: 0, Unnecessary Skips: 0
done in 0m0.42s
done (passed successfully)
jeremyjh commented 1 year ago

Yes OTP removed support for this feature. I don't think there is really anything we can do other than remove it from the documentation.

https://github.com/erlang/otp/pull/5502

gabrielpedepera commented 1 year ago

Thanks for the info @jeremyjh . I haven't checked. Do you want some help to remove these references from the documentation?

jeremyjh commented 1 year ago

Sure, a PR is welcome!

gabrielpedepera commented 1 year ago

Thanks one more time @jeremyjh.. I'm closing this issue.