diff --git a/.github/actions/setup-haskell/action.yaml b/.github/actions/setup-haskell/action.yaml index 24e0de3ac8..da1eb0ba6a 100644 --- a/.github/actions/setup-haskell/action.yaml +++ b/.github/actions/setup-haskell/action.yaml @@ -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: | diff --git a/.github/workflows/examples-e2e-tests.yaml b/.github/workflows/examples-e2e-tests.yaml index f8cd85adf8..fbb459e768 100644 --- a/.github/workflows/examples-e2e-tests.yaml +++ b/.github/workflows/examples-e2e-tests.yaml @@ -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 diff --git a/.github/workflows/starters-e2e-tests.yaml b/.github/workflows/starters-e2e-tests.yaml index fec7965eec..cfd2a4f5f5 100644 --- a/.github/workflows/starters-e2e-tests.yaml +++ b/.github/workflows/starters-e2e-tests.yaml @@ -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 diff --git a/.github/workflows/waspc-build.yaml b/.github/workflows/waspc-build.yaml index 317bb833e6..ea6c592b93 100644 --- a/.github/workflows/waspc-build.yaml +++ b/.github/workflows/waspc-build.yaml @@ -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" @@ -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: @@ -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 - - name: linux-x86_64-static runner: ubuntu-latest # actions/setup-node does not work in alpine. diff --git a/.github/workflows/waspc-ci.yaml b/.github/workflows/waspc-ci.yaml index 41fa7dbeac..514b3fd0a3 100644 --- a/.github/workflows/waspc-ci.yaml +++ b/.github/workflows/waspc-ci.yaml @@ -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 @@ -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: diff --git a/waspc/cabal.project b/waspc/cabal.project index a129678a11..cd53a90e0c 100644 --- a/waspc/cabal.project +++ b/waspc/cabal.project @@ -1,4 +1,4 @@ -with-compiler: ghc-8.10.7 +with-compiler: ghc-9.0.2 packages: . diff --git a/waspc/run b/waspc/run index 84f9f9394b..af421d02a9 100755 --- a/waspc/run +++ b/waspc/run @@ -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" 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" diff --git a/waspc/src/Wasp/Analyzer/TypeDefinitions/TH/Decl.hs b/waspc/src/Wasp/Analyzer/TypeDefinitions/TH/Decl.hs index 8e593b40c8..f1c0c2e463 100644 --- a/waspc/src/Wasp/Analyzer/TypeDefinitions/TH/Decl.hs +++ b/waspc/src/Wasp/Analyzer/TypeDefinitions/TH/Decl.hs @@ -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 (..)) @@ -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) @@ -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 } |], genVal 'declEvaluate evaluateE @@ -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" diff --git a/waspc/src/Wasp/AppSpec/Core/Decl/JSON/TH.hs b/waspc/src/Wasp/AppSpec/Core/Decl/JSON/TH.hs index 3872f63a51..d79807ea47 100644 --- a/waspc/src/Wasp/AppSpec/Core/Decl/JSON/TH.hs +++ b/waspc/src/Wasp/AppSpec/Core/Decl/JSON/TH.hs @@ -1,6 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE BlockArguments #-} -{-# LANGUAGE GADTs #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-unused-matches #-} diff --git a/waspc/waspc.cabal b/waspc/waspc.cabal index 248b402357..97f682caed 100644 --- a/waspc/waspc.cabal +++ b/waspc/waspc.cabal @@ -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 , unordered-containers ^>= 0.2.16 , mtl ^>= 2.2.2 , async ^>= 2.2.4