-
Notifications
You must be signed in to change notification settings - Fork 152
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
Upgrade to ghc 9.10 #480
base: main
Are you sure you want to change the base?
Upgrade to ghc 9.10 #480
Conversation
Status update: this is functionally complete, but waiting for ghc 9.10 to become available in stackage snapshot so I can upgrade stack ci config |
Hello @jaspervdj |
Thanks! |
I am addressing the broken CI here: #484 IMO we should not switch the stack CI over to use the newest GHC version (yet), as long as it's covered by cabal we're good. This avoids the chicken-and-egg problem. |
Sounds great. Feel free to merge your PR and I'll rebase this PR on top, removing CI changes from this one. |
.github/workflows/cabal.yml
Outdated
@@ -9,13 +9,13 @@ jobs: | |||
strategy: | |||
matrix: | |||
os: [ubuntu-latest, macOS-latest] | |||
ghc: ["9.4", "9.6", "9.8"] | |||
ghc: ["9.6", "9.8", "9.10"] |
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.
FYI removing 9.4 from CI, because its associated base 4.17 is out of bounds for ghc-lib-parser, which requires base >= 4.18.
Can we make progress on this now? |
db87892
to
aa9f155
Compare
@michaelpj The current state is that ~10/278 tests are still failing with ghc 9.10. |
please do 9.12 |
Is it fixed so that we can start badgering GHC HQ for GHC 9.10.2? Or is it fixed in 9.12.1 maybe or will GHC 9.12.2 have it? Pretty please. :) |
85895fc
to
1f2bdf7
Compare
Hey folks, sorry I completely forgot about this PR. I will take a stab at trying to migrate to ghc 9.12, but it might take some time for me to get to it.
I'm not sure about that. Probably Alan Zimmerman would know whether he managed to get in his fixes to exactprint in 9.10 branch. But at this point it might make more sense to switch to 9.12. |
on 9.12 getting this, any tips on how to patch? [ 4 of 26] Compiling Language.Haskell.Stylish.GHC ( lib/Language/Haskell/Stylish/GHC.hs, dist/build/Language/Haskell/Stylish/GHC.o, dist/build/Language/Haskel
l/Stylish/GHC.dyn_o )
lib/Language/Haskell/Stylish/GHC.hs:83:15: error: [GHC-76037]
Not in scope: data constructor ‘GHC.EpAnnNotUsed’
Note: Neither ‘GHC.Driver.Ppr’, ‘GHC.Driver.Session’, ‘GHC.Hs’,
‘GHC.Types.SrcLoc’ nor ‘GHC.Utils.Outputable’ export ‘EpAnnNotUsed’.
|
83 | epAnnComments GHC.EpAnnNotUsed = []
| ^^^^^^^^^^^^^^^^
lib/Language/Haskell/Stylish/GHC.hs:90:29: error: [GHC-76037]
Not in scope: ‘GHC.anchor’
Note: Neither ‘GHC.Driver.Ppr’, ‘GHC.Driver.Session’, ‘GHC.Hs’,
‘GHC.Types.SrcLoc’ nor ‘GHC.Utils.Outputable’ export ‘anchor’.
Suggested fix:
Perhaps use one of these:
‘GHC.char’ (imported from GHC.Utils.Outputable),
record field of AnnList ‘GHC.al_anchor’ (imported from GHC.Hs)
|
90 | priorAndFollowing = sortOn (GHC.anchor . GHC.getLoc) . \case
| ^^^^^^^^^^ |
I'm afraid there won't be any easy way, because I expect there to be quite a few changes in GHC Annotation apis from 9.10 to 9.12. How I would go about it:
For example: the |
well, that's sad |
@GuillaumedeVolpiano Nice that you were able to find a workaround!
Could you please check the logic surrounding this piece to understand where this behavior is coming from? |
Yes I think the issue is that the first constructor is somehow not registered as the first if there is a comment before. Looking into it |
@jhrcek So, to get into the nitty gritty: for some reason, we were capturing the haddock comment before the data declaration as it's own comment group, which interfered with the logic of the printing part. Filtering it out when building the DataDecl rather than when printing it did the trick. Add my commit to your commit and you're good to go. At least on my side, it passes all tests. |
Awesome, thanks! I think we can go with your PR as well. Otherwise I will update my PR by copying the approach from your PR tomorrow. |
Basically it depends on which version of ghc_lib_parser you want to depend on. If you're interested I have a branch relying on the CPP Pragma which seems to work with ghc-lib-parser-9.8+ (the gentoo branch in my fork) |
I agree it would make sense to make the project compilable with both ghc 9.10 and 9.12. Maybe we could merge this PR, release 9.10 compatible version of the lib to hackage, |
Your repo, your choice, but indeed, making two releases would be my advice, for what it’s worth. Once you’ve merged this, I’ll rebase my last commit over the new source and we should be good to merge and make a second release. Edit: the code is cleaner indeed ;) |
This is not my repo, I only contributed few compatibility fixes for previous ghc versions 😄 |
Trying to make things work with GHC 9.10, for the purpose of including stylish-haskell in haskell language server (haskell/haskell-language-server#4233)