From eae0740154805620c30b512429771bd967501c99 Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Sat, 12 Jun 2021 11:55:34 -0700 Subject: [PATCH 1/4] Add ghc 9 config --- .circleci/config.yml | 3 +++ stack-ghc-9.0.yaml | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 stack-ghc-9.0.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 0312068..4f08175 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,6 +231,9 @@ workflows: - run_build_and_test: name: test_latest latest: true + - run_build_and_test: + name: test_ghc_9.0 + stack_yaml: stack-ghc-9.0.yaml - run_build_and_test: name: test_ghc_8.10 stack_yaml: stack-ghc-8.10.yaml diff --git a/stack-ghc-9.0.yaml b/stack-ghc-9.0.yaml new file mode 100644 index 0000000..c0cdbb3 --- /dev/null +++ b/stack-ghc-9.0.yaml @@ -0,0 +1,5 @@ +resolver: nightly-2021-06-10 +compiler: ghc-9.0.1 + +ghc-options: + '$locals': -Werror From 2f8ac900551545a94dab4cad9eabcc95c7b1348b Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Sat, 12 Jun 2021 12:03:42 -0700 Subject: [PATCH 2/4] Bump template-haskell --- aeson-schemas.cabal | 10 +++++----- package.yaml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aeson-schemas.cabal b/aeson-schemas.cabal index 5dfed3d..24ef54f 100644 --- a/aeson-schemas.cabal +++ b/aeson-schemas.cabal @@ -1,10 +1,10 @@ cabal-version: >= 1.10 --- This file has been generated from package.yaml by hpack version 0.33.0. +-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack -- --- hash: 80faccce54f3481d8cd37abc188cd5c521e19f5f78f181e08be5c8acd2c0a432 +-- hash: 9c7dcbeb57bbc2a26ee2ae8f24e1858196b44eb7c24d47ebc635162318a75886 name: aeson-schemas version: 1.3.3 @@ -81,7 +81,7 @@ library , first-class-families >=0.3.0.0 && <0.9 , hashable >=1.2.7.0 && <1.4 , megaparsec >=6.0.0 && <10 - , template-haskell >=2.12.0.0 && <2.17 + , template-haskell >=2.12.0.0 && <2.18 , text >=1.2.2.2 && <1.3 , unordered-containers >=0.2.8.0 && <0.3 if impl(ghc >= 8.0) @@ -134,7 +134,7 @@ test-suite aeson-schemas-test , tasty-golden , tasty-hunit , tasty-quickcheck - , template-haskell >=2.12.0.0 && <2.17 + , template-haskell >=2.12.0.0 && <2.18 , text >=1.2.2.2 && <1.3 , th-orphans , th-test-utils @@ -170,7 +170,7 @@ benchmark aeson-schemas-bench , first-class-families >=0.3.0.0 && <0.9 , hashable >=1.2.7.0 && <1.4 , megaparsec >=6.0.0 && <10 - , template-haskell >=2.12.0.0 && <2.17 + , template-haskell >=2.12.0.0 && <2.18 , text >=1.2.2.2 && <1.3 , th-test-utils , unordered-containers >=0.2.8.0 && <0.3 diff --git a/package.yaml b/package.yaml index ed54d44..ad9b8db 100644 --- a/package.yaml +++ b/package.yaml @@ -40,7 +40,7 @@ dependencies: - first-class-families >= 0.3.0.0 && < 0.9 - hashable >= 1.2.7.0 && < 1.4 - megaparsec >= 6.0.0 && < 10 -- template-haskell >= 2.12.0.0 && < 2.17 +- template-haskell >= 2.12.0.0 && < 2.18 - text >= 1.2.2.2 && < 1.3 - unordered-containers >= 0.2.8.0 && < 0.3 From 505ba08ece2b0afd3ba42d38d758068d1cb4bff1 Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Mon, 14 Jun 2021 09:06:33 -0700 Subject: [PATCH 3/4] Fix for template-haskell-2.17 --- bench/Utils/DeepSeq.hs | 9 +++++++++ src/Data/Aeson/Schema/TH/Utils.hs | 3 +++ test/TestUtils/DeepSeq.hs | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/bench/Utils/DeepSeq.hs b/bench/Utils/DeepSeq.hs index c127218..64fb13c 100644 --- a/bench/Utils/DeepSeq.hs +++ b/bench/Utils/DeepSeq.hs @@ -55,7 +55,16 @@ instance NFData Type instance NFData TypeFamilyHead instance NFData TyLit instance NFData TySynEqn + +#if MIN_VERSION_template_haskell(2,17,0) +instance NFData Specificity +#endif + +#if MIN_VERSION_template_haskell(2,17,0) +instance NFData flag => NFData (TyVarBndr flag) +#else instance NFData TyVarBndr +#endif #if MIN_VERSION_template_haskell(2,16,0) instance NFData Bytes diff --git a/src/Data/Aeson/Schema/TH/Utils.hs b/src/Data/Aeson/Schema/TH/Utils.hs index a4ff6ac..8a16aab 100644 --- a/src/Data/Aeson/Schema/TH/Utils.hs +++ b/src/Data/Aeson/Schema/TH/Utils.hs @@ -214,6 +214,9 @@ stripKinds ty = UnboxedTupleT _ -> ty UnboxedSumT _ -> ty ArrowT -> ty +#if MIN_VERSION_template_haskell(2,17,0) + MulArrowT -> ty +#endif EqualityT -> ty ListT -> ty PromotedTupleT _ -> ty diff --git a/test/TestUtils/DeepSeq.hs b/test/TestUtils/DeepSeq.hs index e7113e6..82b0531 100644 --- a/test/TestUtils/DeepSeq.hs +++ b/test/TestUtils/DeepSeq.hs @@ -55,7 +55,16 @@ instance NFData Type instance NFData TypeFamilyHead instance NFData TyLit instance NFData TySynEqn + +#if MIN_VERSION_template_haskell(2,17,0) +instance NFData Specificity +#endif + +#if MIN_VERSION_template_haskell(2,17,0) +instance NFData flag => NFData (TyVarBndr flag) +#else instance NFData TyVarBndr +#endif #if MIN_VERSION_template_haskell(2,16,0) instance NFData Bytes From 319c02113b1128ad9f05a265548cbf93c73de386 Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Mon, 14 Jun 2021 09:32:52 -0700 Subject: [PATCH 4/4] Fix type application in splice https://gitlab.haskell.org/ghc/ghc/-/issues/19988 --- test/Tests/SchemaQQ/TH.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Tests/SchemaQQ/TH.hs b/test/Tests/SchemaQQ/TH.hs index 3165f6f..3a48d44 100644 --- a/test/Tests/SchemaQQ/TH.hs +++ b/test/Tests/SchemaQQ/TH.hs @@ -11,6 +11,7 @@ module Tests.SchemaQQ.TH where import Control.DeepSeq (deepseq) import Data.Aeson (FromJSON, ToJSON) import Foreign.C (CBool (..)) +import Language.Haskell.TH (appTypeE) import Language.Haskell.TH.Quote (QuasiQuoter (..)) import Language.Haskell.TH.TestUtils ( MockedMode (..), @@ -80,7 +81,8 @@ qState = schemaRep :: QuasiQuoter schemaRep = mkExpQQ $ \s -> let schemaType = quoteType schema s - in [|runTestQ qState (quoteType schema s) `deepseq` showSchema @ $schemaType|] + showSchemaQ = appTypeE [|showSchema|] schemaType + in [|runTestQ qState (quoteType schema s) `deepseq` $showSchemaQ|] schemaErr :: QuasiQuoter schemaErr = mkExpQQ $ \s -> [|runTestQErr qState (quoteType schema s)|]