Fix -Ymagic-offset-header for DoubleDefinition error and implicitNotFound errors, and remove global unmanaged cache#25706
Open
lihaoyi wants to merge 8 commits intoscala:mainfrom
Open
Fix -Ymagic-offset-header for DoubleDefinition error and implicitNotFound errors, and remove global unmanaged cache#25706lihaoyi wants to merge 8 commits intoscala:mainfrom
-Ymagic-offset-header for DoubleDefinition error and implicitNotFound errors, and remove global unmanaged cache#25706lihaoyi wants to merge 8 commits intoscala:mainfrom
Conversation
-Ymagic-offset-header for DoubleDefinition error-Ymagic-offset-header for DoubleDefinition error and implicitNotFound errors
-Ymagic-offset-header for DoubleDefinition error and implicitNotFound errors-Ymagic-offset-header for DoubleDefinition error and implicitNotFound errors, and remove global unmanaged cache
Contributor
Author
|
This is ready to review, the CI failure is due to a broken master from b2b23b6 CC @tanishiking |
Member
|
Oops, there was a conflict between two PRs, sent a patch #25710 |
Contributor
|
@lihaoyi Seems there's a conflict now, another rebase necessary |
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.
This makes the reported error properly use remapped file paths and line numbers, where previously it did not. This was encountered trying to use
-Ymagic-offset-headerto properly refer to Mill's source.millscripts during error reporting rather than wrapped generated source files.This PR generalizes the header handling logic previous in
Positioned.scalaand re-uses it inSourcePosition.scalaandSymbol.scala, which also need to render source locationsAlso turns the global
WrappedSourceFile.cacheinto a per-context cache, so multiple compilers sharing the same classloader don't stomp over each other's wrapped source file header caches (which happens in Mill since we re-use classloaders for performance)How much have you relied on LLM-based tools in this contribution?
Mostly vibe coded with claude
How was the solution tested?
Added new unit tests
Additional Notes
These are issues encountered trying to use
-Ymagic-offset-headerin Mill to replace the ad-hoc AST/bytecode/error-message mangling com-lihaoyi/mill#5932