I’ve made a library called “polyn” and am trying to include it an my app. However my app uses dialyzer and won’t pass anymore and I can’t figure it out. I’ve done mix deps.clean --all && mix deps.get && mix deps.compile I’ve done mix dialyzer.clean . None of that seems to help. Same thing happens on a brand new project. Something about the library seems to be off. The error dialyzer gives me when I run mix dialyzer.build is
dialyzer.run error: Analysis failed with error:
Could not scan the following file(s):
Could not get Core Erlang code for: dialyzer_polyn_issue/_build/dev/lib/polyn/ebin/Elixir.Polyn.Tracing.beam
dialyzer_polyn_issue/_build/dev/lib/polyn/ebin/Elixir.Polyn.beam
...every module in the library
When I look inside _build/dev/lib/polyn/ebin/ I see all the *.beam files so I don’t understand why it can’t get them. Using versions:
I saw the note in the thread about asdf having a problem with temporary files when compiling from source. I uninstalled erlang 25.1 and elixir 1.14.0-otp-25. I upgraded asdf brew upgrade asdf. Then I reinstalled erlang and elixir versions. Still having same issue.
When I run mix dialyzer from within the Polyn library itself I get unexpected results as well
lib/mix/tasks/polyn.gen.migration.ex:21:unknown_function
Function Mix.raise/1 does not exist.
lib/testing/testing.ex:23:unknown_function
Function ExUnit.Callbacks.start_supervised!/1 does not exist.
It doesn’t recognize any Mix module or functions as existing. I’ve tried this on both 1.14.0-otp-25 and 1.14.5-otp-25 with the same results. I don’t know if this is related to the issues in the consuming application, but thought I would surface it in case it is relevant.
Sorry, I lied. I see tons of errors, just not during analysis, but yes if I glance up a bit yes I see those same errors building the PLT. Not sure what’s going on here. I was also able to reproduce in a non-ASDF build using
this image hexpm/elixir:1.14.3-erlang-25.2.2-ubuntu-jammy-20221130
All the permissions on the polyn/ebin/*.beam files are -rw-r--r--. When I check the permissions on other files for other libraries (e.g. jason, decimal, etc.) they are the same, but dialyzer doesn’t complain about them.
The :elixir_erl.debug_info function expects some metatdata like this {elixir_v1, Map, Specs} and the initial :beam_lib.chunks function is returning :none for the metadata.
So for some reason the Polyn beam files don’t have metadata.