-
Notifications
You must be signed in to change notification settings - Fork 81
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
Use ghc
instead of ghc-lib-parser
when possible
#948
Conversation
1b30655
to
1879045
Compare
This significantly reduces the build time with recent version of GHC.
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.
That definitely makes sense in general, and other tools like hlint
also offer a flag to do this, though hlint disabled using ghc
by default when possible, but I do not yet fully understand why they chose to do so: ndmitchell/hlint#1410
I applied the gitignore-related change separately in #953. We are a bit undecided about the main part though. One thing we do not want to do for sure is introducing a cabal flag because then we would need a bigger CI matrix and longer CI times. If we force
|
Thanks for that! That makes sense!
👍 less flags are always a good thing, especially if they are
I would hope this can be addressed by CI. Testing e.g.
From what I understand you have the same issue if you accept multiple versions of Examples you ask? Right now we have: if impl(ghc >=9.4 && <9.5)
build-depends: ghc
else
build-depends: ghc-lib-parser >=9.4 && <9.5 If we discovered a bug in if impl(ghc >=9.4.2 && <9.5)
build-depends: ghc
else
build-depends: ghc-lib-parser >=9.4.2 && <9.5 If at some later point we decided that everybody should be on the same single lastest version then we would change this again to: if impl(ghc ==9.4.4)
build-depends: ghc
else
build-depends: ghc-lib-parser ==9.4.4.* Does this make sense? All that said, I am not committed to this change by any means. It just seemed like an easy win in terms of build times. But I'm OK either way. |
That is true, but CPP might be necessary in that case.
I think it is easier to just specify a different version of In general, I guess we just prefer simplicity and are not very much effected by longer build times. |
How is that? I was under the impression that the packages are interchangeable as long as you do not exercise too much of But I might be wrong here.
Do you mean that a user would do this themselves by manually constraining the version? (say by passing
That's fine with me. Please feel free to close this PR. |
I think there some parts where the two packages diverge, but I do not know for sure. @amesgen might know more details.
Yes, this is what I had in mind. |
Yeah, differences for the same patch version would probably be a bug, but for different patch versions, they might differ, although I don't think we have ever experienced this so far (concretely: suppose one is compiling with GHC 9.4.1, but ghc-lib-parser has version 9.4.2). The original point was that
which was about a usability concern of downstream users such as HLS, i.e. that was the motivation why hlint changed the default: ndmitchell/hlint#1376 |
Okay, closing for now. |
This significantly reduces the build time with recent version of GHC.