Skip to content

Conversation

sodic
Copy link
Contributor

@sodic sodic commented Oct 8, 2025

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.

@@ -1,6 +1,5 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE GADTs #-}
Copy link
Contributor Author

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
Copy link
Contributor Author

@sodic sodic Oct 8, 2025

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:

image

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
Copy link
Contributor Author

@sodic sodic Oct 8, 2025

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"
Copy link
Contributor Author

@sodic sodic Oct 8, 2025

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).

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't - it complains that you're missing a version it needs:

image

Copy link
Member

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?

Comment on lines -63 to -65
# TODO: Add a Linux ARM64 build once we update the GHC version (#1446)
# GHC 8.10.7 does not support ARM64 on Linux yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@Martinsos Martinsos left a 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.

@FranjoMindek
Copy link
Contributor

FranjoMindek commented Oct 9, 2025

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.

The problem is that we never use default values from setup Haskell action, even if we can.
We always use the same GHC version across all the workflows. We should be able to remove passing GHC version in everything except the setup Haskell version itself.

So we can definitely reduce part of the duplication.

Edit: now mentioned here #3238 (comment)

@sodic sodic merged commit 6f0c92d into main Oct 9, 2025
7 checks passed
@sodic sodic deleted the filip-upgrade-ghc-to-902 branch October 9, 2025 07:46
@sodic
Copy link
Contributor Author

sodic commented Oct 9, 2025

@FranjoMindek said

We should be able to remove passing GHC version in everything except the setup Haskell version itself.

I did it here: #3241

@FranjoMindek @cprecioso @Martinsos Check it out and tell me what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants