-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update GHC to 9.0.2 #3239
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
Update GHC to 9.0.2 #3239
Conversation
@@ -1,6 +1,5 @@ | |||
{-# LANGUAGE AllowAmbiguousTypes #-} | |||
{-# LANGUAGE BlockArguments #-} | |||
{-# LANGUAGE GADTs #-} |
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.
This has nothing to do with the update but I noticed the redundancy and removed it.
dtBodyType = $bodyTypeE, | ||
dtEvaluate = \typeDefs bindings declName declBodyExpr -> | ||
makeDecl @ $(conT typeName) declName <$> declEvaluate typeDefs bindings declBodyExpr | ||
makeDecl @($(conT typeName)) declName <$> declEvaluate typeDefs bindings declBodyExpr |
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.
GHC 9.0.2 changed whitespace sensitivity around some special characters, one of them being @
(source).
This is the part that concerns us:

Because the splice $(conT typeName)
starts with a $
, there had to be a space after the type application operator @
. GHC no longer allows this space (i.e., it interprets it as an operator function call) so we had to remove it and add the parantheses to ensure the parser doesn't interpret @$
as the same character.
Same goes for the rest of the file.
, aeson-pretty ^>= 0.8 | ||
, text ^>= 1.2.4 | ||
, template-haskell ^>= 2.16.0 | ||
, template-haskell ^>= 2.17.0 |
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 couldn't update GHC without updating template-haskell
.
Our base
is pretty permissive and accounts for all versions that don't make a breaking change. There hasn't been a breaking change between 8.10.7 and 9.0.2 (or even 9.12.x), so there's nothing we have to do there.
GHCID_CMD="ghcid --command=cabal repl" | ||
# ghc version below should be the one from `cabal.project` file, `with-compiler` field. | ||
GHCUP_SET="ghcup set ghc 8.10.7 && ghcup set hls 2.2.0.0" | ||
GHCUP_SET="ghcup set hls 2.2.0.0" |
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.
GHC setting is redundant because cabal chooses the compiler version specified in cabal.project
(which I bumped).
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.
What happens when this compiler version is not installed? Does ghcup automatically install too?
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.
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.
So maybe we can modify this command to ghcup install 9.0.2
?
# TODO: Add a Linux ARM64 build once we update the GHC version (#1446) | ||
# GHC 8.10.7 does not support ARM64 on Linux yet | ||
|
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.
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.
LGTM! It sucks a bit we have to update version number on so many places, I wish we had one place for it. But Github Actions are famous for not being able to de-duplicate stuff, so I don't think we will have any luck there / it is worth bothering with it.
Great! Let's see how the rest of the merge will go, and if we are fast, we can very soon start updating all the packages to latest versions, that would also be nice.
The problem is that we never use default values from setup Haskell action, even if we can. So we can definitely reduce part of the duplication. Edit: now mentioned here #3238 (comment) |
@FranjoMindek said
I did it here: #3241 @FranjoMindek @cprecioso @Martinsos Check it out and tell me what you think. |
Partially takes care of #1446
9.0.2 is the very next version after 8.10.7 (and a breaking change one), so I decided to take care of that first.