script: apply override_files before validation and slang#331
Open
micprog wants to merge 1 commit into
Open
Conversation
Override files were resolved late, in the emit_template stage, so they did not apply to file-existence validation nor to the slang file-list reduction. This meant a shadowed original still had to exist on disk, and slang parsed both the original and its override as duplicate module definitions. Resolve override_files right after flatten() instead: drop the override groups and rewrite like-named files in the regular groups to the overriding path (preserving SourceType). Only the overriding files are then validated, and slang analyzes/reduces them instead of the files they shadow. The OVERRIDDEN annotation is carried through a side map so --source-annotations output is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
colluca
approved these changes
Jul 15, 2026
colluca
left a comment
Contributor
There was a problem hiding this comment.
I've tested this in Gwaihir, on both a target that uses the Slang features and a target without and it seems to correctly fix the issues I was facing: E31 is no longer raised on the overridden file, and Slang also no longer fails with a missing file error.
Thanks again @micprog!
2 tasks
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.
Override files were resolved late, in the emit_template stage, so they did not apply to file-existence validation nor to the slang file-list reduction. This meant a shadowed original still had to exist on disk, and slang parsed both the original and its override as duplicate module definitions.
Resolve override_files right after flatten() instead: drop the override groups and rewrite like-named files in the regular groups to the overriding path (preserving SourceType). Only the overriding files are then validated, and slang analyzes/reduces them instead of the files they shadow. The OVERRIDDEN annotation is carried through a side map so --source-annotations output is unchanged.