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

Tests fail on elixir 1.15-rc.0 #503

Closed
lukaszsamson opened this issue May 27, 2023 · 4 comments
Closed

Tests fail on elixir 1.15-rc.0 #503

lukaszsamson opened this issue May 27, 2023 · 4 comments

Comments

@lukaszsamson
Copy link

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Elixir 1.15.0-rc.0 (ea31af5) (compiled with Erlang/OTP 25)

  • Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.3.0 and master@e9556460bc130287dd6687ab02041634ac827913

Current behavior

5 tests from the suite fail. Each failure is due to the same reason

test check plts (Dialyxir.PltTest)
     test/dialyxir/plt_test.exs:9
     ** (UndefinedFunctionError) function :dialyzer_plt.included_files/1 is undefined (module :dialyzer_plt is not available)
     code: assert capture_io(fun) ==
     stacktrace:
       (dialyzer 5.0.4) :dialyzer_plt.included_files(~c"/var/dialyxir_erlang-20.3.plt")
       (dialyzer 5.0.4) dialyzer.erl:228: :dialyzer.plt_info/1
       (dialyxir 1.3.0) lib/dialyxir/plt.ex:243: Dialyxir.Plt.plt_files/1
       (dialyxir 1.3.0) lib/dialyxir/plt.ex:16: Dialyxir.Plt.find_plts/3
       test/dialyxir/plt_test.exs:16: anonymous fn/0 in Dialyxir.PltTest."test check plts"/1
       (ex_unit 1.15.0-rc.0) lib/ex_unit/capture_io.ex:287: ExUnit.CaptureIO.do_capture_gl/2
       (ex_unit 1.15.0-rc.0) lib/ex_unit/capture_io.ex:245: ExUnit.CaptureIO.do_with_io/3
       (ex_unit 1.15.0-rc.0) lib/ex_unit/capture_io.ex:121: ExUnit.CaptureIO.capture_io/1
       test/dialyxir/plt_test.exs:19: (test)

I have a suspicion that this is elixir problem

Expected behavior

Tests should pass

@josevalim
Copy link
Contributor

josevalim commented May 27, 2023

Elixir v1.15 prunes code paths and none of the projects tested in mix/tasks/dialyzer_test declare Dialyzer as a dependency, which is why it fails. If you specify your deps in the mix.exs, it works for me:

  def application do
    [extra_applications: [:dialyzer]]
  end

You can also use Mix.ensure_application!(:dialyzer) (inside the Mix task implementation).

@elliottneilclark
Copy link

What's the correct solution for umbrella projects? We used to have just a single dependency on dialyzer in the root mix.exs. Adding extra_applications to just the root mix.exs doesn't work. It seems like I need to add the dependency to every sub app and add extra_applications to every sub app.

@jeremyjh
Copy link
Owner

@elliottneilclark This issue is just regarding dialyxir's own test suite and the project fixtures in there. I was not aware of an impact on applications that use dialyxir because we do already specify :dialyzer as an extra application. Are you on the latest version of dialyxir? If so please open another issue and include a repro example if possible.

@jeremyjh
Copy link
Owner

Fixed in #512

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

4 participants