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-rc1 support: Fix incremental dialyzer usage, and make it even more incremental #2774

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

ferd
Copy link
Collaborator

@ferd ferd commented Feb 26, 2023

The current state of Dialyzer incremental support was added before the code was shipped. There are 3 behaviours that can work:

  1. Dialyzer in incremental mode expects one PLT file per project and that file is fully managed by Dialyzer
  2. Dialyzer can work with a big global file shared by all projects and maintains all related updates based on each run
  3. Rebar3 can store a global base incremental PLT file, and then use it as a foundation for a per-project file that once created keeps running

What we currently have in main for incremental mode is option 1. What Rebar3 did with classical PLTs was in option 3, and saved cross-project build time. It appears that Dialyzer can tolerate receiving an input PLT and an output PLT for incremental builds, which means option 3 ought to be supported, but I don’t want to work at cross purposes with the tools.

This PR switches us to mode 3 and updates the tests to show that support.

@ferd ferd changed the title Fix incremental dialyzer usage, make it incremental as well Fix incremental dialyzer usage, and make it even more incremental Feb 26, 2023
@ferd ferd changed the title Fix incremental dialyzer usage, and make it even more incremental OTP-26-rc1 support: Fix incremental dialyzer usage, and make it even more incremental Feb 26, 2023
@ferd ferd force-pushed the incremental-dialyzer-fixes branch from e7ead25 to 400e338 Compare February 26, 2023 17:38
@tsloughter
Copy link
Collaborator

So this always uses incremental on 26+ and has no way to disable it?

Rather than having a project-local PLT, this mechanism uses a base
configuration to start from a shared PLT image, which is then used with
the new incremental build mechanism to make a new per-project PLT file,
which will then be maintained incrementally.

This should speed up per-project first incremental runs after the first
ever is done, in line with classic Dialyzer usage.
@ferd ferd force-pushed the incremental-dialyzer-fixes branch from 0f39ca1 to 2da0779 Compare February 26, 2023 19:47
@ferd
Copy link
Collaborator Author

ferd commented Feb 26, 2023

So this always uses incremental on 26+ and has no way to disable it?

It's an option, and defaults to false.

@ferd ferd requested a review from tsloughter February 26, 2023 21:33
@tsloughter
Copy link
Collaborator

Oh, so -i is still required? It looked like it just checked if it was available and used the option.

@ferd
Copy link
Collaborator Author

ferd commented Feb 27, 2023

Oh, so -i is still required? It looked like it just checked if it was available and used the option.

Yep, the effective check is at

case proplists:get_value(incremental, Args, get_config(State, incremental, false)) of

@ferd ferd merged commit 5678aad into erlang:main Feb 27, 2023
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

Successfully merging this pull request may close these issues.

2 participants