Open cognivore opened 1 year ago
I can recreate it with asdf on main-otp-25
. It is not only dialyzer. There is some change or problem with how some core OTP applications are found. I also get an error about erts
not being found.
If you launch iex -S mix
and run prettypr.text('hi')
you will indeed get an error that the module is missing. With that same version of OTP on Elixir 1.14.3 you get the expected output.
Elixir 14:
iex(8)> :prettypr.text('hi')
{:text, [2, 104, 105]}
Elixir main-otp25:
iex(2)> :prettypr.text('hi')
** (UndefinedFunctionError) function :prettypr.text/1 is undefined (module :prettypr is not available)
:prettypr.text(~c"hi")
It's a bit peculiar, as in erl
, it works! Good to know that asdf
has a similar problem though. But it's very confusing nonetheless. I'm 100% sure that my Elixir is built with literally this particular version of Erlang...
Mon Feb 27 14:22:15:684253100 sweater@conflagrate ~/github/etypes (main)
λ iex -S mix
Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.15.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :prettypr.text('hi')
** (UndefinedFunctionError) function :prettypr.text/1 is undefined (module :prettypr is not available)
:prettypr.text(~c"hi")
iex:1: (file)
iex(1)> :prettypr.module_info()
** (UndefinedFunctionError) function :prettypr.module_info/0 is undefined (module :prettypr is not available)
:prettypr.module_info()
iex:1: (file)
iex(1)>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
(l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
a
Mon Feb 27 14:22:39:360718800 sweater@conflagrate ~/github/etypes (main)
λ erl
Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Eshell V13.1.5 (abort with ^G)
1> prettypr:text("hi").
{text,[2,104,105]}
2>
FWIW, I'm trying to manually build up some PLTs and run dialyzer afterwards in this set up.
@cognivore We needed to add some dependencies to extra_applications. can you try with dialyxir master
now?
Will do!
On Mon, Feb 27, 2023 at 3:08 PM Jeremy Huffman @.***> wrote:
@cognivore https://github.com/cognivore We needed to add some dependencies to extra_applications. can you try with dialyxir master now?
— Reply to this email directly, view it on GitHub https://github.com/jeremyjh/dialyxir/issues/478#issuecomment-1446502143, or unsubscribe https://github.com/notifications/unsubscribe-auth/APY6WRVVYFKLXOZEZBHJVFLWZS7PRANCNFSM6AAAAAAVIPLTSU . You are receiving this because you were mentioned.Message ID: @.***>
@jeremyjh you fixed it so quickly! It's so much appreciated. It indeed works with the latest commit in upstream! Thank you!
P.S.
I've confirmed that this works on real projects too. I think this can be closed.
Precheck
Environment
Installed into the system with
nix
from this commit.Current behavior
Dialyzer works but it displays a huge wall of errors while building PLTs / being ran the first time.
They are of three problems types:
prettyptr
not foundEnum.reduce/3
is not a function andString.t/0
is not a type (it means that Elixir wasn't dialyzed?!)As you see even the first time in this particular project, dialyzer run happens, later on it's business as usual:
In another project, however, it won't run at all:
Expected behavior
It's expected that dialyxir either crashes catastrofically on both projects, signaling incompatibility with 1.15-dev, or works correctly, returning the results.