-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Replace checkHomeUnitsClosed with a faster implementation #4109
Conversation
Hooray! Please put the reasoning into the code! Can we have a test case? It would be nice to know what its going wrong with the |
I'm investigating that currently, it seems like |
That definitely seems bad. I would have thought this was a standard graph problem of some kind 🤔 |
I've put up a patch here, I will copy the implementation to ghcide so we can use it on released GHCs https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12162 |
1555164
to
8b3a381
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea looks great, I do have a couple of questions, though.
I'm assuming we're going to wait for the GHC MR to land so we can incorporate any comments from upstream. |
Seems like https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12162 will get merged / backported. Can we get this proper workaround for < 9.10 compilers now? :) |
Yes, we should be able to copy in the final code now. |
75343ef
to
b644165
Compare
GHC had an implementation of this function, but it was horribly inefficient We should move back to the GHC implementation on compilers where https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12162 is included Fixes #4046
b644165
to
1610a6d
Compare
Co-authored-by: Jan Hrcek <[email protected]>
Co-authored-by: Jan Hrcek <[email protected]>
GHC gives a default "main" home unit, and it is difficult to avoid this aseach ghc session must have an active home unit at all times, but in a multiple
component session, there is no other good choice for a default unit. We could
pick one arbitrarily, but this is ugly and complicates the code a lot.
We never use this default "main" unit for anything, as the GHC sessionscorresponding to any file/component have the active unit set to the correct one
for that component.
When checking for home unit closure, we must make sure to include only theactual units in the project, not the bogus "main" unit that GHC forces us to
have. Including the main unit seems to make the
checkHomeUnitsClosed
function loopforever for some reason.
Use a faster implementation of checkHomeUnitsClosed
GHC had an implementation of this function, but it was horribly inefficient
We should move back to the GHC implementation on compilers where
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12162 is included
Fixes #4046