Add support for dialyzer --incremental
when available
#2736
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the environment's OTP version supports
dialyzer --incremental
(see the PR introducing it), enable an--incremental
/-i
option torebar3 dialyzer
in order to make it accessible.In erlang/otp#5997, we added an
--incremental
option to Dialyzer, however, in order to make good use of it from a rebar3 project, you'd probably want to have a corresponding option inrebar3 dialyzer
, which is what I've added here.This PR introduces quite a bare-bones option, since you could do more in terms of reading incrementality-specific metrics from Dialyzer and reporting them, but it at least allows some early experimentation when it detects an appropriate bleeding-edge OTP version with the necessary features. For older OTP versions, users won't see this option, so nothing should change from their perspective.
As a point of comparison, when running on the rebar3 project itself, running Dialyzer the usual way without incrementality, the first run takes 2.25 mins, and a second run takes 25 secs. When using
--incremental
, it takes 1.5 mins, going down to 6 seconds on a re-run. Of course, your milage will very definitely vary depending on machine's performance/load, the changes you make between Dialyzer analyses, and the structure of the project you run it on.