Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in update, don't bother typechecking again if we haven't changed the unison file #4446

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

mitchellwrosen
Copy link
Member

Fixes #4442

@mitchellwrosen mitchellwrosen marked this pull request as ready for review November 29, 2023 20:45
Comment on lines 135 to 141
let noChanges =
and
[ UF.dataDeclarations smallUf == UF.dataDeclarations bigUf,
UF.effectDeclarations smallUf == UF.effectDeclarations bigUf,
UF.terms smallUf == UF.terms bigUf, -- no need to sort these, though it wouldn't hurt
UF.watches smallUf == UF.watches bigUf
]
Copy link
Member

Choose a reason for hiding this comment

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

Seems like you should maybe just have the code that generates bigUf return a Bool of whether it had to pull in additional dependents.

Also seems like you could just compare sizes here. The bigUf can only have additional elements, since you don't remove anything, only add dependents.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 I changed this to just compare sizes. Making bigBuildUnisonFile return whether it changed anything is a bit more invasive to thread that state through everywhere, so I'm not sure it's worth it.

Copy link
Member

Choose a reason for hiding this comment

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

No objections here, just thought I'd mention it.

Comment on lines +136 to +141
and
[ Map.size (UF.dataDeclarations smallUf) == Map.size (UF.dataDeclarations bigUf),
Map.size (UF.effectDeclarations smallUf) == Map.size (UF.effectDeclarations bigUf),
length @[] (UF.terms smallUf) == length @[] (UF.terms bigUf),
Map.size (UF.watches smallUf) == Map.size (UF.watches bigUf)
]
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT About a keysSet kind of comparison here instead of size? Then again, we don't delete anything, so this should be fine?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see there was already discussion.

Comment on lines -143 to -146
That's done. Now I'm making sure everything typechecks...

Everything typechecks, so I'm saving the results...

Copy link
Contributor

Choose a reason for hiding this comment

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

I like that these go away.

@aryairani aryairani merged commit c7c00c8 into trunk Nov 29, 2023
7 checks passed
@aryairani aryairani deleted the 23-11-29-update-no-typecheck-if-no-deps branch November 29, 2023 21:57
@aryairani
Copy link
Contributor

Great!

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.

skip typechecking on update if we didn't add any new definitions to TypecheckedUnisonFile
3 participants