Skip to content

script: apply override_files before validation and slang#331

Open
micprog wants to merge 1 commit into
masterfrom
fix/apply-override-files-early
Open

script: apply override_files before validation and slang#331
micprog wants to merge 1 commit into
masterfrom
fix/apply-override-files-early

Conversation

@micprog

@micprog micprog commented Jul 15, 2026

Copy link
Copy Markdown
Member

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.

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>
@micprog
micprog requested review from colluca and fischeti July 15, 2026 12:15

@colluca colluca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

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.

2 participants