-
Notifications
You must be signed in to change notification settings - Fork 521
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
Export PLT #1931
Comments
I think if we want to support a PLT that includes everything we should have a configs option that match our lower level/base PLTs, and then a flag to build the higher level PLT. This would allow us to do more efficient changes to the PLT as we already have code to do this. Also we can guarantee to keep the PLT in sync with the code. This would also enable a new use case where |
So the idea would be to maintain a list of files + the modification date they had when they were added? When dialyzing, we would start by removing any modified/removed files from the PLT, write that to a PLT, followed by adding the modified files to that new PLT? |
My understanding was that PLTs were sensitive to absolute paths in a system and therefore should not be packaged and distributed since the differences in paths would cause the PLT to be rebuilt anyway? If that is indeed the case, then exporting the PLTs would be of limited value in the first place. Would it still be worth it for you? What's your use case with the exported PLT? |
It would still be useful to me! The use case is that my rebar3 projects are sub-components in a larger system which is not built using rebar3. To run dialyzer for the whole system we need a PLT for each sub-component; this leads to my initial suggestion. The PLTs are used in a very controlled environment so paths changing is not a problem. |
We have also started thinking about something similar. We have 42 rebar3 projects stored in different repos. If I run dialyzer on project1 which includes let's say Why would it be useful? On most projects having only a few tests most of the time is taken by dialyzer if I run a CI job. It would make the CI jobs at least 2-3 times faster. |
@tothlac having projects in different repos makes this a challenge because of @ferd's comment. There may also be other complications because the PLTs would be overlapping. For example both PLTs would contain their dependencies. I wonder if CI could handle this via a fake umbrella project with git submodules? Before starting on this we need to understand the desired dialyzer workflow and check it doesn't need changes to dialyzer itself. |
I've looked at |
I had a look at this again.From the documentation:
We see here that multiple PLTs can be combined, but only in analyze mode. This gives two ways of working:Serial modeUse Serial mode will create one very large PLT. When a dependency is updated, we would have to build the PLT from scratch. Parallel modeUse Parallel mode is what we use now in our Make-based solution. We keep track of the errors from each PLT built but mostly focus on the errors reported when everything is put together. My proposalRebar3 should support the parallel mode approach. To do that, we need to build a PLT for each dependency that only contains the modules of the dependency itself. We will need two modes:
Unfortunately, I think this would require a major rework of |
Also: what would be the benefit of this? Would it still be only about letting people export PLTs that only they can use (because of path-related issues and restrictions)? |
This would let people export PLTs that can be reused by anyone since the PLTs do not have path-related issues. It would for example be possible to store the PLTs in hex if so desired. We need this so that rebar3 projects can play nicely under our Make based umbrella project. I believe this approach would also speed up consecutive runs of |
Did anything change in Dialyzer that suddenly made PLTs portable? Because they absolutely weren't at any point in the past. |
I noticed now that there is file information included but our experience is that you can use the PLTs even if the file information is incorrect, e.g. if the beam files have been moved. @uabboli, can you shed some light on the issue? |
We're introducing Dialyzer to our codebase, and having similar issues. After some trial and error path, we came up to this approach:
This is rather limited change, would it work for your use-case too? @Zalastax |
Made a PR, #2249 |
My initial impression is that it should work to solve our original problem. Will have a look at the PR to see if there's anything that would make it not so. |
No, that PR doesn't solve my problem. I need to be able to use PLTs coming from two different umbrella projects that share dependencies together. |
I'd like to distribute a PLT file that contains all the specs in my applications.
To do that I expect to be able to use
rebar3 dialyzer
with some special flag.If I turn on DEBUG,
rebar3/src/rebar_prv_dialyzer.erl
Line 481 in 83d01b5
succ_typings
:for my use case I just need to
{analysis_type,succ_typings}
to{analysis_type,plt_add}
{output_plt, "somefilename"}
Would you accept a PR where I add a new option
and simply duplicate
succ_typings
into a new functionexport_plt
which I modify to pass in my suggested options?The text was updated successfully, but these errors were encountered: