Skip to content

ExternsDiff: compute deps of TypeSynonyms properly#7

Merged
zyla merged 3 commits intorestaumaticfrom
fix-dependency-computation
May 26, 2025
Merged

ExternsDiff: compute deps of TypeSynonyms properly#7
zyla merged 3 commits intorestaumaticfrom
fix-dependency-computation

Conversation

@zyla
Copy link
Copy Markdown
Collaborator

@zyla zyla commented May 19, 2025

Fixes a bug where type synonym changes are incorrectly computed when diffing externs.

See https://github.com/zyla/purs-recompilation-repro for a reproducer of the bug.

Bug explanation: Externs files can have multiple entries with the same Ref, but the code in ExternsDiff assumed uniqueness. This led to buggy dependency graph construction.

The fix is to merge duplicate entries.

@zyla zyla changed the base branch from various-perf-changes to restaumatic May 22, 2025 08:50
@zyla zyla requested review from jborkowski and kozak May 22, 2025 08:50

-- | Returns refs as a tuple of four (added, removed, changed, unchanged).
splitRefs :: Ord r => Eq a => [a] -> [a] -> (a -> Maybe r) -> Tuple4 [] r
splitRefs :: forall ref a deps. Monoid deps => Ord ref => Eq a => [a] -> [a] -> (a -> Maybe (ref, deps)) -> Tuple4 [] (ref, deps)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what a soup 🍜

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@zyla zyla merged commit 8f9bc92 into restaumatic May 26, 2025
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.

3 participants