From 61111178f05c7b961f0ba814f595ec89de4dc045 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Mon, 5 Apr 2021 17:35:39 +0300 Subject: [PATCH 1/5] Support GHC-9.0.1 --- .github/workflows/master.yml | 3 ++- cabal.project | 16 ++++++++-------- doc/tutorial/tutorial.cabal | 4 ++-- servant-client-core/servant-client-core.cabal | 6 +++--- servant-client/servant-client.cabal | 4 ++-- servant-docs/servant-docs.cabal | 4 ++-- servant-foreign/servant-foreign.cabal | 4 ++-- servant-http-streams/servant-http-streams.cabal | 4 ++-- servant-pipes/example/Main.hs | 2 +- servant-server/servant-server.cabal | 6 +++--- servant/servant.cabal | 8 ++++---- servant/src/Servant/API/UVerb/Union.hs | 2 +- servant/test/Servant/API/StreamSpec.hs | 2 +- 13 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 6a50181c..afb66384 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - cabal: ["3.2"] + cabal: ["3.4"] ghc: - "8.0.2" - "8.2.2" @@ -21,6 +21,7 @@ jobs: - "8.6.5" - "8.8.4" - "8.10.2" + - "9.0.1" steps: - uses: actions/checkout@v2 diff --git a/cabal.project b/cabal.project index da0f60ad..8b35bf64 100644 --- a/cabal.project +++ b/cabal.project @@ -3,8 +3,7 @@ packages: servant-client/ servant-client-core/ servant-http-streams/ --- Tests failing with Cabal (TODO: investigate) --- servant-docs/ + servant-docs/ servant-foreign/ servant-server/ doc/tutorial/ @@ -26,7 +25,8 @@ packages: doc/cookbook/custom-errors doc/cookbook/basic-streaming doc/cookbook/db-postgres-pool - doc/cookbook/db-sqlite-simple + --doc/cookbook/db-sqlite-simple + -- ^ BROKEN blaze-textual doc/cookbook/file-upload doc/cookbook/generic doc/cookbook/hoist-server-with-context @@ -36,7 +36,8 @@ packages: -- doc/cookbook/sentry -- Commented out because servant-quickcheck currently doesn't build. -- doc/cookbook/testing - doc/cookbook/uverb + --doc/cookbook/uverb + -- ^ BROKEN servant-swagger -> optics-th doc/cookbook/structuring-apis doc/cookbook/using-custom-monad doc/cookbook/using-free-client @@ -64,8 +65,7 @@ write-ghc-environment-files: always allow-newer: servant-pagination-2.2.2:servant allow-newer: servant-pagination-2.2.2:servant-server --- https://github.com/haskell-servant/servant-multipart/pull/41 -allow-newer: servant-multipart:servant -allow-newer: servant-multipart:servant-server -allow-newer: servant-multipart:servant-client-core allow-newer: servant-js:servant + +-- ghc 9 +allow-newer: tdigest:base diff --git a/doc/tutorial/tutorial.cabal b/doc/tutorial/tutorial.cabal index 82162ffd..a97770cb 100644 --- a/doc/tutorial/tutorial.cabal +++ b/doc/tutorial/tutorial.cabal @@ -68,9 +68,9 @@ library , cookie >= 0.4.3 && < 0.5 , js-jquery >= 3.3.1 && < 3.4 , lucid >= 2.9.11 && < 2.10 - , random >= 1.1 && < 1.2 + , random >= 1.1 && < 1.3 , servant-js >= 0.9 && < 0.10 - , time >= 1.6.0.1 && < 1.10 + , time >= 1.6.0.1 && < 1.13 -- For legacy tools, we need to specify build-depends too build-depends: markdown-unlit >= 0.5.0 && <0.6 diff --git a/servant-client-core/servant-client-core.cabal b/servant-client-core/servant-client-core.cabal index 61de0ce8..eaec86fa 100644 --- a/servant-client-core/servant-client-core.cabal +++ b/servant-client-core/servant-client-core.cabal @@ -16,7 +16,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 , GHCJS == 8.4 extra-source-files: @@ -50,13 +50,13 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , bytestring >= 0.10.8.1 && < 0.12 , containers >= 0.5.7.1 && < 0.7 , deepseq >= 1.4.2.0 && < 1.5 , text >= 1.2.3.0 && < 1.3 , transformers >= 0.5.2.0 && < 0.6 - , template-haskell >= 2.11.1.0 && < 2.17 + , template-haskell >= 2.11.1.0 && < 2.18 if !impl(ghc >= 8.2) build-depends: diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index 7c350257..207bb35e 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -20,7 +20,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 extra-source-files: CHANGELOG.md @@ -40,7 +40,7 @@ library -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , bytestring >= 0.10.8.1 && < 0.12 , containers >= 0.5.7.1 && < 0.7 , deepseq >= 1.4.2.0 && < 1.5 diff --git a/servant-docs/servant-docs.cabal b/servant-docs/servant-docs.cabal index 87699f37..4b42ba90 100644 --- a/servant-docs/servant-docs.cabal +++ b/servant-docs/servant-docs.cabal @@ -19,7 +19,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 extra-source-files: CHANGELOG.md @@ -41,7 +41,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , bytestring >= 0.10.8.1 && < 0.12 , text >= 1.2.3.0 && < 1.3 diff --git a/servant-foreign/servant-foreign.cabal b/servant-foreign/servant-foreign.cabal index 53c3fb2e..f8b37baa 100644 --- a/servant-foreign/servant-foreign.cabal +++ b/servant-foreign/servant-foreign.cabal @@ -21,7 +21,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2015-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 extra-source-files: CHANGELOG.md @@ -41,7 +41,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , text >= 1.2.3.0 && < 1.3 -- Servant dependencies diff --git a/servant-http-streams/servant-http-streams.cabal b/servant-http-streams/servant-http-streams.cabal index ecdee5c6..31d1b8ad 100644 --- a/servant-http-streams/servant-http-streams.cabal +++ b/servant-http-streams/servant-http-streams.cabal @@ -20,7 +20,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 extra-source-files: CHANGELOG.md @@ -38,7 +38,7 @@ library -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , bytestring >= 0.10.8.1 && < 0.12 , containers >= 0.5.7.1 && < 0.7 , deepseq >= 1.4.2.0 && < 1.5 diff --git a/servant-pipes/example/Main.hs b/servant-pipes/example/Main.hs index 157ac2e7..8683f651 100644 --- a/servant-pipes/example/Main.hs +++ b/servant-pipes/example/Main.hs @@ -64,7 +64,7 @@ server = fast :<|> slow :<|> readme :<|> proxy readme = liftIO $ do putStrLn "/readme" - return $ P.withFile "README.md" ReadMode PBS.fromHandle + return $ P.withFile "README.md" ReadMode $ \h -> PBS.fromHandle h proxy c = liftIO $ do putStrLn "/proxy" diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index a2a95540..e8007b20 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -23,7 +23,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 extra-source-files: CHANGELOG.md @@ -60,7 +60,7 @@ library -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , bytestring >= 0.10.8.1 && < 0.12 , containers >= 0.5.7.1 && < 0.7 , mtl >= 2.2.2 && < 2.3 @@ -72,7 +72,7 @@ library -- strict dependency as we re-export 'servant' things. build-depends: servant >= 0.18.2 && < 0.18.3 - , http-api-data >= 0.4.1 && < 0.4.3 + , http-api-data >= 0.4.1 && < 0.4.4 -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. diff --git a/servant/servant.cabal b/servant/servant.cabal index cff41c41..662133f1 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -1,6 +1,6 @@ cabal-version: >=1.10 name: servant -version: 0.18.2 +version: 0.18.2.1 synopsis: A family of combinators for defining webservices APIs category: Servant, Web @@ -20,7 +20,7 @@ maintainer: haskell-servant-maintainers@googlegroups.com copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 , GHCJS == 8.4 extra-source-files: @@ -78,7 +78,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.15 + base >= 4.9 && < 4.16 , bytestring >= 0.10.8.1 && < 0.12 , mtl >= 2.2.2 && < 2.3 , sop-core >= 0.4.0.0 && < 0.6 @@ -89,7 +89,7 @@ library -- We depend (heavily) on the API of these packages: -- i.e. re-export, or allow using without direct dependency build-depends: - http-api-data >= 0.4.1 && < 0.4.3 + http-api-data >= 0.4.1 && < 0.4.4 , singleton-bool >= 0.1.4 && < 0.1.7 -- Other dependencies: Lower bound around what is in the latest Stackage LTS. diff --git a/servant/src/Servant/API/UVerb/Union.hs b/servant/src/Servant/API/UVerb/Union.hs index 774cf628..11d93e74 100644 --- a/servant/src/Servant/API/UVerb/Union.hs +++ b/servant/src/Servant/API/UVerb/Union.hs @@ -144,4 +144,4 @@ _testNubbed :: ( ( Nubbed '[Bool, Int, Int] ~ 'False , Nubbed '[Int, Bool] ~ 'True ) => a) -> a -_testNubbed = id +_testNubbed a = a diff --git a/servant/test/Servant/API/StreamSpec.hs b/servant/test/Servant/API/StreamSpec.hs index 74eac52a..fc5c5046 100644 --- a/servant/test/Servant/API/StreamSpec.hs +++ b/servant/test/Servant/API/StreamSpec.hs @@ -90,7 +90,7 @@ runRenderFrames :: (SourceT Identity a -> SourceT Identity LBS.ByteString) -> [a runRenderFrames f = fmap mconcat . runExcept . runSourceT . f . source runUnrenderFrames :: (SourceT Identity b -> SourceT Identity a) -> [b] -> [Either String a] -runUnrenderFrames f = go . Effect . flip unSourceT return . f . source where +runUnrenderFrames f = go . Effect . (\x -> unSourceT x return) . f . source where go :: StepT Identity a -> [Either String a] go Stop = [] go (Error err) = [Left err] From 4c05338876be1decac66153235a927f693b7abf0 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Mon, 5 Apr 2021 17:41:06 +0300 Subject: [PATCH 2/5] doctest 0.18 --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index afb66384..eee1f47a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -50,7 +50,7 @@ jobs: - name: Configure run: | - cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.17' + cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.18' - name: Build run: | From 6cf2da8b64ef1cef7de753c95508271bdaf454fb Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Mon, 21 Jun 2021 23:47:10 +0200 Subject: [PATCH 3/5] Update GHC 8.10 to 8.10.4 in GitHub actions --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index eee1f47a..8d6f554a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -20,7 +20,7 @@ jobs: - "8.4.4" - "8.6.5" - "8.8.4" - - "8.10.2" + - "8.10.4" - "9.0.1" steps: From 2eba8866b7d4583e03707fd009f0d3e259353c7e Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Tue, 22 Jun 2021 10:27:01 +0200 Subject: [PATCH 4/5] Fix doctest running in CI --- .github/workflows/master.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 8d6f554a..63e9d4ff 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -50,7 +50,10 @@ jobs: - name: Configure run: | - cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.18' + # Using separate store-dir because default one already has 'ghc-paths' package installed + # with hardcoded path to ghcup's GHC path (which it was built with). This leads to failure in + # doctest, as it tries to invoke that GHC, and it doesn't exist here. + cabal --store-dir /tmp/cabal-store install --ignore-project -j2 doctest --constraint='doctest ^>=0.18' - name: Build run: | From f527f09ac33b8360782e3797d73276f9772b71b6 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Tue, 22 Jun 2021 15:41:13 +0200 Subject: [PATCH 5/5] continue-on-error for doctest on GHC 9 --- .github/workflows/master.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 63e9d4ff..b4776d41 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -64,6 +64,9 @@ jobs: cabal test all - name: Run doctests + # doctests are broken on GHC 9 due to compiler bug: + # https://gitlab.haskell.org/ghc/ghc/-/issues/19460 + continue-on-error: ${{ matrix.ghc == '9.0.1' }} run: | # Necessary for doctest to be found in $PATH export PATH="$HOME/.cabal/bin:$PATH"