Skip to content

Recompilation avoidance in GHC 9.4 conflicts with recompilation avoidance in HLS #3450

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

Closed
wz1000 opened this issue Jan 12, 2023 · 5 comments
Closed
Labels
GHC issues with particular GHC versions type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@wz1000
Copy link
Collaborator

wz1000 commented Jan 12, 2023

We added very fine grained recompilation avoidance to HLS in #2316. With that change, a module using TH is recompiled if the hash of the Core of any of the modules it uses in a splice changes.

However, we still use GHC's recompilation avoidance by way of the checkOldIface function, which handles all the other recompilation avoidance cases which don't involve Template Haskell.

GHC 9.4 also added a similar finer grained recompilation avoidance scheme, in that it will recompile a module using TH if the hash of the source of any modules it uses in a splice changes. This is weaker than what we have in HLS, and as such we may end up recompiling when we didn't need to before.

Possible solution: Filter out the UsageHomeModuleInterface entries added to usages by GHCs recompilation checker.

@wz1000 wz1000 added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: needs triage labels Jan 12, 2023
@michaelpj
Copy link
Collaborator

Should we be trying to improve GHC's recompilation avoidance so it's as good as ours and we can just rely on it?

@mouse07410
Copy link

Should we be trying to improve GHC's recompilation avoidance so it's as good as ours and we can just rely on it?

Yes - because right now HLS is almost unusable with GHC-9.4.4 and VS Code: whenever I try to apply a Quick Fix hint, the hint is not applied and HLS errors out on this very issue.

@michaelpj
Copy link
Collaborator

I think you're commenting on the wrong issue. This has nothing to do with code actions.

@mouse07410
Copy link

mouse07410 commented Jan 13, 2023

I think you're commenting on the wrong issue. This has nothing to do with code actions.

Possible - but that's where VSCcode plugin threw me upon hitting that problem. I think the problem was not code actions per se, but the internal error triggered by attempt to apply the action, presumably because it got entangled with "whether to recompile" thing. But I don't know. In fact, if you're sure this is barking up the wrong tree - please feel free to delete my (irrelevant) comments in this issue.

@fendor fendor added GHC issues with particular GHC versions and removed status: needs triage labels Feb 22, 2023
@fendor
Copy link
Collaborator

fendor commented Feb 22, 2023

Fixed by #3452 afaict

@fendor fendor closed this as completed Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GHC issues with particular GHC versions type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants