-
Notifications
You must be signed in to change notification settings - Fork 30
Add GHC 9 support #84
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Please note I added a GHC 9 CI job and deleted the others. |
Is supporting at least ghc 8.10 too much trouble? I'm worried about single-target releases. |
I think I understand now, this PR shows what it takes to get ghc 9 compatibility. Somebody needs to finish the change so that multiple versions can coexist. This makes sense, thanks for the PR! |
I don't even know if new functionality is correct. I just know it builds. |
I think GHC 9 support #77 can be considered working experimentally at this stage: There's no new GHC 9 features, and I can't garantee I haven't broken anything making the neccesary GHC 9 changes. GHC 8 should be working unchanged. |
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.
Looks like we had a pre-existing lie:
https://www.stackage.org/lts-15.13 is for ghc-8.8.3 and so when I run your change in with ghc 8.10 I hit:
ghc-source-gen >
ghc-source-gen > /home/greg/s/ghc-source-gen/src/GHC/SourceGen/Decl.hs:174:25: error:
ghc-source-gen > Data constructor not in scope: NoLayoutInfo :: NoExtField
ghc-source-gen > |
ghc-source-gen > 174 | , tcdCExt = NoLayoutInfo
ghc-source-gen > | ^^^^^^^^^^^^
ghc-source-gen >
I'll update the CI to be less broken.
Could you rebase on top of #85 and make the tests pass? |
I'll look at it sometime. I also remember that I left two test cases commented out - I should try to fix those, or at least document if I've broken the API. |
Reinstated CI GHC 8 should be as was No new GHC 9 functionality; can't be sure I haven't broken anything on GHC 9
Attempt GHC 9 CI fix by clearing cache
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
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.
I've marked all meaningful changes.
@@ -24,9 +31,15 @@ needsPar (NPat _ l _ _) = overLitNeedsParen $ unLoc l | |||
needsPar (LitPat l) = litNeedsParen l | |||
needsPar (NPat l _ _ _) = overLitNeedsParen $ unLoc l | |||
#endif | |||
#if MIN_VERSION_ghc(9,0,1) | |||
-- Think this is correct; can't be sure - AF |
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.
Please confirm this is correct.
name | ||
$ PrefixCon | ||
#if MIN_VERSION_ghc(9,0,1) | ||
$ map (HsScaled (HsUnrestrictedArrow NormalSyntax) . renderField) |
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.
HsConDetails
of HsConDeclDetails
now yas HsScaled
wrapped around its first field. I've stubbed this with (HsScaled (HsUnrestrictedArrow NormalSyntax)
) | ||
( | ||
#if MIN_VERSION_ghc(9,0,1) | ||
HsScaled (HsUnrestrictedArrow NormalSyntax) $ |
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.
instance BVar HsTyVarBndr' where | ||
#if MIN_VERSION_ghc(9,0,1) | ||
instance BVar HsTyVarBndrSpec' where | ||
bvar = noExt UserTyVar SpecifiedSpec . typeRdrName . UnqualStr |
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.
No idea whether this is correct
h | ||
neverQualify | ||
#if MIN_VERSION_ghc(9,0,1) | ||
AllTheWay |
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.
Don't know whether this is correct
a --> b = | ||
noExt HsFunTy | ||
#if MIN_VERSION_ghc(9,0,1) | ||
(HsUnrestrictedArrow NormalSyntax) |
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.
Again, stubbed out linear arrow type
#if MIN_VERSION_ghc(8,10,0) | ||
, tcdCExt = NoExtField | ||
#if MIN_VERSION_ghc(9,0,1) | ||
, tcdCExt = NoLayoutInfo |
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.
Don't know if this is right
@@ -49,6 +56,9 @@ module' | |||
-> HsModule' | |||
module' name exports imports decls = HsModule | |||
{ hsmodName = fmap (builtLoc . unModuleNameStr) name | |||
#if MIN_VERSION_ghc(9,0,1) |
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.
Could you rebase on top of HEAD and force-push this to clear the complaint? |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@judah it would be great if you could look at the code as @AriFordsham has some semantic questions that will take me a while to get up to speed with. |
Reinstated CI GHC 8 should be as was No new GHC 9 functionality; can't be sure I haven't broken anything on GHC 9
Attempt GHC 9 CI fix by clearing cache
b2e8b27
to
dea5e95
Compare
I think #86 is unequivocally better than this. |
I've modified
ghc-source-gen
so it builds and passes tests on GHC 9.0.1. I hope you find this useful for #77.It's not production-ready; I just 'brute-forced' it - I definitely broke GHC 8.10, and I just stubbed out any new features etc. with whatever seemed to make sense to allow building.
I had to comment out two tests to get it to build; all other tests are passing.
Main issues:
HsTyVarBndr
now has aSpecificity
flagConPat
constructor(s)