Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown dialyzer warning option: race_conditions with OTP 25.0.4 #470

Closed
gabrielpedepera opened this issue Oct 21, 2022 · 4 comments
Closed

Comments

@gabrielpedepera
Copy link

gabrielpedepera commented Oct 21, 2022

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
Copy link
Owner

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.

erlang/otp#5502

@gabrielpedepera
Copy link
Author

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

@jeremyjh
Copy link
Owner

Sure, a PR is welcome!

@gabrielpedepera
Copy link
Author

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

w0rd-driven added a commit to w0rd-driven/beatseek that referenced this issue Jan 27, 2023
Postgres: attempt using the official image. I haven't done this enough to know honestly and I may need a docker login regardless.
Dialyzer:
No longer supports `race_conditions`: jeremyjh/dialyxir#470.
Unknown is included by default I believe so there's no need to include it again.
Add MP3Stat exclusions tied to the line numbers. If I drastically change this file I need to follow the warnings too. I'm fine with making this whitelist as I don't think Beatseek had these checks applied or they may have taken different approaches.
w0rd-driven added a commit to w0rd-driven/beatseek that referenced this issue Mar 21, 2023
Postgres: attempt using the official image. I haven't done this enough to know honestly and I may need a docker login regardless.
Dialyzer:
No longer supports `race_conditions`: jeremyjh/dialyxir#470.
Unknown is included by default I believe so there's no need to include it again.
Add MP3Stat exclusions tied to the line numbers. If I drastically change this file I need to follow the warnings too. I'm fine with making this whitelist as I don't think Beatseek had these checks applied or they may have taken different approaches.
w0rd-driven added a commit to w0rd-driven/beatseek_private that referenced this issue Jul 11, 2023
Postgres: attempt using the official image. I haven't done this enough to know honestly and I may need a docker login regardless.
Dialyzer:
No longer supports `race_conditions`: jeremyjh/dialyxir#470.
Unknown is included by default I believe so there's no need to include it again.
Add MP3Stat exclusions tied to the line numbers. If I drastically change this file I need to follow the warnings too. I'm fine with making this whitelist as I don't think Beatseek had these checks applied or they may have taken different approaches.
w0rd-driven added a commit to w0rd-driven/beatseek that referenced this issue Jul 11, 2023
Postgres: attempt using the official image. I haven't done this enough to know honestly and I may need a docker login regardless.
Dialyzer:
No longer supports `race_conditions`: jeremyjh/dialyxir#470.
Unknown is included by default I believe so there's no need to include it again.
Add MP3Stat exclusions tied to the line numbers. If I drastically change this file I need to follow the warnings too. I'm fine with making this whitelist as I don't think Beatseek had these checks applied or they may have taken different approaches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants