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

Normalize Dialyzer PLT paths #2578

Merged
merged 1 commit into from
Jun 10, 2021
Merged

Conversation

ferd
Copy link
Collaborator

@ferd ferd commented Jun 9, 2021

this takes the current path formatting (which reuses compiler-specific
functions) and makes it contextual to knowing whether files exist or
not. The compiler path printing assumes all directory paths are
project-local, but PLTs only occasionally fit this description. On first
copies, they don't.

This currently yields output such as:

===> Building with 204 files in ../.cache/rebar3/rebar3_24.0.2_plt...
===> Copying ../.cache/rebar3/rebar3_24.0.2_plt to _build/default/rebar3_24.0.2_plt...
===> Checking 204 files in _build/default/rebar3_24.0.2_plt...
===> Adding 29 files to _build/default/rebar3_24.0.2_plt...
===> Doing success typing analysis...
===> Resolving files...
===> Analyzing 13 files with _build/default/rebar3_24.0.2_plt...

Whereas this patch instead allows the following formatting:

===> Dialyzer starting, this may take a while...
===> Updating plt...
===> Resolving files...
===> Updating base plt...
===> Resolving files...
===> Checking 204 files in /home/ferd/.cache/rebar3/rebar3_24.0_plt...
===> Copying /home/ferd/.cache/rebar3/rebar3_24.0_plt to /tmp/chk/_build/default/rebar3_24.0_plt...
===> Checking 204 files in _build/default/rebar3_24.0_plt...
===> Doing success typing analysis...
===> Resolving files...
===> Analyzing 2 files with _build/default/rebar3_24.0_plt...

That Copying <from> to <dest> message is always going to have the
<dest> value be absolute just because I can check whether a relative
path exists before normalizing on the absolute path, which is the
simplest way to make this work without major rework of output functions
to attach them all to the calling context to know when a path may or may
not be absolute.

Fixes #2577

this takes the current path formatting (which reuses compiler-specific
functions) and makes it contextual to knowing whether files exist or
not. The compiler path printing assumes all directory paths are
project-local, but PLTs only occasionally fit this description. On first
copies, they don't.

This currently yields output such as:

    ===> Building with 204 files in ../.cache/rebar3/rebar3_24.0.2_plt...
    ===> Copying ../.cache/rebar3/rebar3_24.0.2_plt to _build/default/rebar3_24.0.2_plt...
    ===> Checking 204 files in _build/default/rebar3_24.0.2_plt...
    ===> Adding 29 files to _build/default/rebar3_24.0.2_plt...
    ===> Doing success typing analysis...
    ===> Resolving files...
    ===> Analyzing 13 files with _build/default/rebar3_24.0.2_plt...

Whereas this patch instead allows the following formatting:

    ===> Dialyzer starting, this may take a while...
    ===> Updating plt...
    ===> Resolving files...
    ===> Updating base plt...
    ===> Resolving files...
    ===> Checking 204 files in /home/ferd/.cache/rebar3/rebar3_24.0_plt...
    ===> Copying /home/ferd/.cache/rebar3/rebar3_24.0_plt to /tmp/chk/_build/default/rebar3_24.0_plt...
    ===> Checking 204 files in _build/default/rebar3_24.0_plt...
    ===> Doing success typing analysis...
    ===> Resolving files...
    ===> Analyzing 2 files with _build/default/rebar3_24.0_plt...

That `Copying <from> to <dest>` message is always going to have the
`<dest>` value be absolute just because I can check whether a relative
path exists before normalizing on the absolute path, which is the
simplest way to make this work without major rework of output functions
to attach them all to the calling context to know when a path may or may
not be absolute.

Fixes erlang#2577
@ferd ferd merged commit fe3a062 into erlang:master Jun 10, 2021
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.

rebar3 dialyzer reports wrong PLT path in output
2 participants