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

OTP 26: Incremental mode for Dialyzer: --incremental #498

Open
Nezteb opened this issue May 16, 2023 · 7 comments
Open

OTP 26: Incremental mode for Dialyzer: --incremental #498

Nezteb opened this issue May 16, 2023 · 7 comments

Comments

@Nezteb
Copy link
Contributor

Nezteb commented May 16, 2023

OTP 26 was released today, along with the new --incremental flag for Dialyzer.

This was first discussed in #105. Now that OTP 26 is out, I figured I'd make a new issue to track this.

If I find some time I'll start a branch to test out the new --incremental mode within dialyxir.

As for usage/API, I think we can:

@codeadict
Copy link

I have a branch for this but turned out not so easy to do when generating the PLTs. I can push it up and maybe pair with somebody on this or a person that has more time to take it from where I left off.

@TD5
Copy link

TD5 commented May 17, 2023

@codeadict what bits were you stuck on? I implemented the incremental mode for Dialyzer in OTP: I don't have the bandwidth to pair on this, but perhaps I could give some pointers if it's about how Dialyzer's incremental mode is intended to be used? If it's about Dialyxir itself, then I am the wrong person to help :)

@jdewar
Copy link

jdewar commented Oct 3, 2023

I did not find any GitHub forks where people had started on elixir using incremental mode, so I tried to use it in my app from the command line, but didn't get that far. The example given in various places, dialyzer --incremental --apps erts kernel stdlib crypto works, and emits a few complaints. However, adding the local elixir beam files in didn't work:

> dialyzer --incremental --apps ~/.asdf/installs/elixir/1.15.6-otp-26/lib/elixir/ebin  erts kernel stdlib crypto
Runtime terminating during boot ({{case_clause,{undef,[{elixir_erl,debug_info,[erlang_v1,'Elixir.BadMapError',{elixir_v1,#{attributes=>[{behaviour,'Elixir.Exception'}],line=>992,module=>'Elixir.BadMapError',file=><<"/home/runner/work/elixir/elixir/lib/elixir/lib/exception.ex">>,deprecated=>[],unreachable=>[],struct=>[#{default=>true,required=>false,field=>'__exception__'},#{default=>nil,required=>false,field=>term}],after_verify=>[],defines_behaviour=>false,definitions=>[{{message,1},def,[{line,996}],[{[{line,996}],[{exception,[{version,0},{line,996}],nil}],[],{'<<>>',[{alignment,0},{line,997}],[{'::',[{inferred_bitstring_spec,true},{line,997}],[<<"expected a map, got: ">>,{binary,[{line,997}],nil}]},{'::',[{line,997}],[{{'.',[{line,997}],['Elixir.Kernel',inspect]},[{line,997}],[{{'.',[{line,997}],[{exception,[{version,0},{line,997}],nil},term]},[{no_parens,true},{line,997}],[]}]},{binary,[],nil}]}]}}]},{{exception,1},def,[{line,993},{context,'Elixir.Kernel'}],[{[{line,993},{context,'Elixir.Kernel'}],[{args,

Crash dump is being written to: erl_crash.dump...done

Adding just elixir felt like low hanging fruit, but I've hit this wall. Attempting to google the error message itself didn't pan out. I've tried reading through dialyxir internals to shed some light on what I might be missing, but am still stuck.

@michalmuskala
Copy link

To make raw dialyzer working, I believe you'll need to add Elixir stdlib to the loadpath of the VM running dialyzer (this is necessary for translating Elixir AST to format that dialyzer uses internally). You should be able to do this with a -pa /path/to/elixir/ebin flag

@lukaszsamson
Copy link

If anyone is interested this PR adds support for incremental mode in ElixirLS elixir-lsp/elixir-ls#1081

@oliver-kriska
Copy link

so is it possible to use this flag with mix dialyzer command or it has to be developed in dialyxir code base? A little confused from jdewar comment

@jeremyjh
Copy link
Owner

jeremyjh commented Oct 7, 2024

@oliver-kriska it needs to be added as a feature to Dialyxir for mix dialyzer to support it. The raw dialyzer command would be issued from the command line as he noted, but it isn't helpful to most users, its just an example of how it works.

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

8 participants