Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-haskell/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
description: |
The version of GHC to install.
required: false
default: "8.10.7"
default: "9.0.2"

cabal-version:
description: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- uses: ./.github/actions/setup-haskell
with:
ghc-version: "8.10.7"
ghc-version: "9.0.2"
cabal-version: "3.10.2.0"
cabal-project-dir: waspc

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/starters-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: ./.github/actions/setup-haskell
with:
ghc-version: "8.10.7"
ghc-version: "9.0.2"
cabal-version: "3.10.2.0"
cabal-project-dir: waspc

Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/waspc-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
inputs:
ghc-version:
description: "GHC version to use"
default: "8.10.7"
default: "9.0.2"
required: false
node-version:
description: "Node.js version to use"
Expand All @@ -17,7 +17,7 @@ on:
inputs:
ghc-version:
description: "GHC version to use"
default: "8.10.7"
default: "9.0.2"
type: string
required: false
node-version:
Expand Down Expand Up @@ -60,9 +60,6 @@ jobs:
# Cabal dependencies
apt-get install -y zlib1g-dev

# TODO: Add a Linux ARM64 build once we update the GHC version (#1446)
# GHC 8.10.7 does not support ARM64 on Linux yet

Comment on lines -63 to -65
Copy link
Contributor Author

Choose a reason for hiding this comment

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

- name: linux-x86_64-static
runner: ubuntu-latest
# actions/setup-node does not work in alpine.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/waspc-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
node-version:
- "latest"
ghc:
- "8.10.7"
- "9.0.2"
cabal:
- "3.10.2.0"
# In addition to the default matrix, we also want to run the build job for
Expand All @@ -58,11 +58,11 @@ jobs:
include:
- os: ubuntu-22.04
node-version: 22
ghc: "8.10.7"
ghc: "9.0.2"
cabal: "3.10.2.0"
- os: ubuntu-22.04
node-version: 24
ghc: "8.10.7"
ghc: "9.0.2"
cabal: "3.10.2.0"

steps:
Expand Down
2 changes: 1 addition & 1 deletion waspc/cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
with-compiler: ghc-8.10.7
with-compiler: ghc-9.0.2

packages: .

Expand Down
5 changes: 3 additions & 2 deletions waspc/run
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ RUN_CMD="cabal --project-dir=${PROJECT_ROOT} run wasp-cli -- ${ARGS[@]}"

# Utility
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"
# HLS version below should be one that works with the GHC version from the
# `with-compiler` field in `cabal.project`
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?

DEV_TOOLS_BIN="$PROJECT_ROOT/.bin"
function install_dev_tool() {
echo "cabal --project-file=$PROJECT_ROOT/dev-tool.project install $1 --installdir=$DEV_TOOLS_BIN --install-method=copy --overwrite-policy=always"
Expand Down
18 changes: 9 additions & 9 deletions waspc/src/Wasp/Analyzer/TypeDefinitions/TH/Decl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ where
import Control.Applicative ((<|>))
import qualified Data.HashMap.Strict as H
import Language.Haskell.TH
import Language.Haskell.TH.Syntax (VarBangType)
import qualified Wasp.Analyzer.Evaluator.Evaluation as E
import qualified Wasp.Analyzer.Type as T
import Wasp.Analyzer.TypeDefinitions (DeclType (..), EnumType (..), IsDeclType (..), IsEnumType (..))
Expand Down Expand Up @@ -147,7 +146,8 @@ makeIsDeclTypeInstanceDefinition typeName _dataConstructor@(NormalC conName [(_,
-- The constructor is in the form @data Type = Type x1 x2 ... xn@, which is not valid for a decl
makeIsDeclTypeInstanceDefinition typeName _dataConstructor@(NormalC _ values) =
fail $
"makeDeclType expects given type " ++ show typeName
"makeDeclType expects given type "
++ show typeName
++ " to be a record or to have one data constructor with exactly 1 value, "
++ "but instead it was given a data constructor with "
++ show (length values)
Expand Down Expand Up @@ -188,7 +188,7 @@ genIsDeclTypeInstanceDefinition typeName dataConstructorName bodyTypeE evaluateE
{ dtName = $(nameToLowerFirstStringLiteralExpr dataConstructorName),
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.

}
|],
genVal 'declEvaluate evaluateE
Expand Down Expand Up @@ -218,19 +218,19 @@ genWaspTypeAndEvaluationForHaskellType typ =
KJSON -> return ([|T.QuoterType "json"|], [|E.json|])
KDeclRef t ->
return
( [|T.DeclType $ dtName $ declType @ $(pure t)|],
[|E.declRef @ $(pure t)|]
( [|T.DeclType $ dtName $ declType @($(pure t))|],
[|E.declRef @($(pure t))|]
)
KEnum ->
return
( [|T.EnumType $ etName $ enumType @ $(pure typ)|],
[|E.enum @ $(pure typ)|]
( [|T.EnumType $ etName $ enumType @($(pure typ))|],
[|E.enum @($(pure typ))|]
)
KRecord dataConName fields -> genDictWaspTypeAndEvaluationForRecord dataConName fields
KCustomEvaluation ->
return
( [|HasCustomEvaluation.waspType @ $(pure typ)|],
[|HasCustomEvaluation.evaluation @ $(pure typ)|]
( [|HasCustomEvaluation.waspType @($(pure typ))|],
[|HasCustomEvaluation.evaluation @($(pure typ))|]
)
KOptional _ -> fail "Maybe is only allowed in record fields"

Expand Down
1 change: 0 additions & 1 deletion waspc/src/Wasp/AppSpec/Core/Decl/JSON/TH.hs
Original file line number Diff line number Diff line change
@@ -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.

{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}

Expand Down
2 changes: 1 addition & 1 deletion waspc/waspc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ library
, aeson ^>= 1.5.6
, 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.

, unordered-containers ^>= 0.2.16
, mtl ^>= 2.2.2
, async ^>= 2.2.4
Expand Down