Skip to content

Make source absolute for diagnostics emitted from after_verify - #16045

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
SteffenDE:sd-warn-location
Nov 2, 2026
Merged

josevalim merged 1 commit into
elixir-lang:mainfrom
SteffenDE:sd-warn-location

Conversation

@SteffenDE

Copy link
Copy Markdown
Contributor

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).

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).
@josevalim
josevalim merged commit ad23ce4 into elixir-lang:main Nov 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants