Repository navigation
Make source absolute for diagnostics emitted from after_verify - #16045
Merged
Merged
Conversation
Warnings emitted from @after_verify callbacks run in the parallel checker, where :elixir_compiler_file is not set. Their source field is therefore whatever :file the callback passed to IO.warn/2. The checker already made :file absolute when collecting the diagnostic but left :source untouched. Mix attaches warnings to their source files by matching :source against absolute paths. A relative :source matched nothing, so such a warning was printed once and never persisted in the manifest: later compilations did not print it again with --all-warnings, and a no-op compilation passed --warnings-as-errors despite it. Phoenix wants to store these paths relative to the project so that a build reused from another directory, such as a git worktree, reports the right files (phoenixframework/phoenix#6889).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Warnings emitted from @after_verify callbacks run in the parallel checker, where :elixir_compiler_file is not set. Their source field is therefore whatever :file the callback passed to IO.warn/2. The checker already made :file absolute when collecting the diagnostic but left :source untouched.
Mix attaches warnings to their source files by matching :source against absolute paths. A relative :source matched nothing, so such a warning was printed once and never persisted in the manifest: later compilations did not print it again with --all-warnings, and a no-op compilation passed --warnings-as-errors despite it.
Phoenix wants to store these paths relative to the project so that a build reused from another directory, such as a git worktree, reports the right files (phoenixframework/phoenix#6889).