From f910b12cb17ec99bfc417a568eaedf5df63fae8f Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Tue, 31 Oct 2023 14:19:35 +1100 Subject: [PATCH 1/2] Make it build with ghc-9.8 and update dependencies Main compiler related issue was the absence of a `MonadFail Gen` instance. --- .../binary-serialise-cbor.cabal | 2 +- cbor-tool/cbor-tool.cabal | 8 +-- cborg-json/cborg-json.cabal | 22 ++++---- cborg/cborg.cabal | 28 +++++----- cborg/tests/Tests/Properties.hs | 6 +- serialise/serialise.cabal | 56 +++++++++---------- serialise/tests/Tests/Serialise.hs | 5 +- 7 files changed, 65 insertions(+), 62 deletions(-) diff --git a/binary-serialise-cbor/binary-serialise-cbor.cabal b/binary-serialise-cbor/binary-serialise-cbor.cabal index 6125ff9..ca51b60 100644 --- a/binary-serialise-cbor/binary-serialise-cbor.cabal +++ b/binary-serialise-cbor/binary-serialise-cbor.cabal @@ -51,7 +51,7 @@ library exposed-modules: Data.Binary.Serialise.CBOR.Read build-depends: - base >= 4.11 && < 4.19, + base >= 4.11 && < 4.20, bytestring < 1.0, cborg == 0.2.*, diff --git a/cbor-tool/cbor-tool.cabal b/cbor-tool/cbor-tool.cabal index e965b65..ab63b95 100644 --- a/cbor-tool/cbor-tool.cabal +++ b/cbor-tool/cbor-tool.cabal @@ -29,14 +29,14 @@ executable cbor-tool other-extensions: CPP, BangPatterns ghc-options: -Wall build-depends: - base >=4.11 && <4.19, + base >=4.11 && <4.20, filepath >=1.0 && <1.5, - aeson >=0.7 && <2.2, + aeson >=0.7 && <2.3, aeson-pretty >=0.8 && <0.9, scientific >=0.3 && <0.4, - bytestring >=0.10 && <0.12, + bytestring >=0.10 && <0.13, unordered-containers >=0.2 && <0.3, - text >=1.1 && <2.1, + text >=1.1 && <2.2, vector >=0.10 && <0.14, cborg ==0.2.*, diff --git a/cborg-json/cborg-json.cabal b/cborg-json/cborg-json.cabal index 39b0ccf..2bbbf12 100644 --- a/cborg-json/cborg-json.cabal +++ b/cborg-json/cborg-json.cabal @@ -30,13 +30,13 @@ library exposed-modules: Codec.CBOR.JSON ghc-options: -Wall build-depends: - base >=4.11 && < 4.19, - aeson >=0.7 && <2.2, + base >=4.11 && < 4.20, + aeson >=0.7 && <2.3, aeson-pretty >=0.8 && <0.9, base64-bytestring >=1.0 && <1.3, unordered-containers >=0.2 && <0.3, scientific >=0.3 && <0.4, - text >=1.1 && <2.1, + text >=1.1 && <2.2, vector >=0.10 && <0.14, cborg ==0.2.* @@ -61,10 +61,10 @@ benchmark bench other-modules: build-depends: - base >= 4.11 && < 4.19, - bytestring >= 0.10.4 && < 0.12, + base >= 4.11 && < 4.20, + bytestring >= 0.10.4 && < 0.13, criterion >= 1.0 && < 1.7, - deepseq >= 1.0 && < 1.5, + deepseq >= 1.0 && < 1.6, zlib >= 0.5 && < 0.7, directory, process, @@ -87,17 +87,17 @@ test-suite tests other-modules: build-depends: - base >= 4.7 && < 4.19, + base >= 4.7 && < 4.20, base-orphans, base16-bytestring >= 1.0 && < 1.1, - bytestring >= 0.10.4 && < 0.12, + bytestring >= 0.10.4 && < 0.13, cborg, cborg-json, - aeson >= 0.7 && < 2.2, + aeson >= 0.7 && < 2.3, QuickCheck >= 2.9 && < 2.15, - tasty >= 0.11 && < 1.5, + tasty >= 0.11 && < 1.6, tasty-hunit >= 0.9 && < 0.11, - text >= 1.1 && < 2.1 + text >= 1.1 && < 2.2 if !impl(ghc >= 8.0) build-depends: fail >= 4.9.0.0 && < 4.10 diff --git a/cborg/cborg.cabal b/cborg/cborg.cabal index 16bcb1d..4ea6536 100644 --- a/cborg/cborg.cabal +++ b/cborg/cborg.cabal @@ -90,14 +90,14 @@ library build-depends: array >= 0.4 && < 0.6, - base >= 4.11 && < 4.19, - bytestring >= 0.10.4 && < 0.12, - containers >= 0.5 && < 0.7, - deepseq >= 1.0 && < 1.5, - ghc-prim >= 0.3.1.0 && < 0.11, + base >= 4.11 && < 4.20, + bytestring >= 0.10.4 && < 0.13, + containers >= 0.5 && < 0.8, + deepseq >= 1.0 && < 1.6, + ghc-prim >= 0.3.1.0 && < 0.12, half >= 0.2.2.3 && < 0.4, - primitive >= 0.5 && < 0.9, - text >= 1.1 && < 1.3 || >= 2.0 && <2.1 + primitive >= 0.5 && < 0.10, + text >= 1.1 && < 1.3 || >= 2.0 && <2.2 if flag(optimize-gmp) cpp-options: -DOPTIMIZE_GMP @@ -148,21 +148,21 @@ test-suite tests build-depends: array >= 0.4 && < 0.6, - base >= 4.11 && < 4.19, + base >= 4.11 && < 4.20, base-orphans, - bytestring >= 0.10.4 && < 0.12, - text >= 1.1 && < 2.1, - primitive >= 0.5 && < 0.9, + bytestring >= 0.10.4 && < 0.13, + text >= 1.1 && < 2.2, + primitive >= 0.5 && < 0.10, cborg, - aeson >= 0.7 && < 2.2, + aeson >= 0.7 && < 2.3, base64-bytestring >= 1.0 && < 1.3, base16-bytestring >= 1.0 && < 1.1, - deepseq >= 1.0 && < 1.5, + deepseq >= 1.0 && < 1.6, half >= 0.2.2.3 && < 0.4, QuickCheck >= 2.9 && < 2.15, random, scientific >= 0.3 && < 0.4, - tasty >= 0.11 && < 1.5, + tasty >= 0.11 && < 1.6, tasty-hunit >= 0.9 && < 0.11, tasty-quickcheck >= 0.8 && < 0.11, vector >= 0.10 && < 0.14 diff --git a/cborg/tests/Tests/Properties.hs b/cborg/tests/Tests/Properties.hs index 64ee36d..f30b688 100644 --- a/cborg/tests/Tests/Properties.hs +++ b/cborg/tests/Tests/Properties.hs @@ -1042,8 +1042,10 @@ instance Arbitrary Sliced.SlicedByteArray where genByteArray :: Int -> Gen Prim.ByteArray genByteArray n = do - SBS.SBS ba <- genShortByteString n - pure (Prim.ByteArray ba) + bss <- genShortByteString n + case bss of + SBS.SBS ba -> pure $ Prim.ByteArray ba + -------------------------------------------------------------------------------- -- TestTree API diff --git a/serialise/serialise.cabal b/serialise/serialise.cabal index 0993765..eb58a8d 100644 --- a/serialise/serialise.cabal +++ b/serialise/serialise.cabal @@ -69,18 +69,18 @@ library Codec.Serialise.Internal.GeneralisedUTF8 build-depends: - base >= 4.11 && < 4.19, + base >= 4.11 && < 4.20, array >= 0.4 && < 0.6, - bytestring >= 0.10.4 && < 0.12, + bytestring >= 0.10.4 && < 0.13, cborg == 0.2.*, - containers >= 0.5 && < 0.7, - ghc-prim >= 0.3.1.0 && < 0.11, + containers >= 0.5 && < 0.8, + ghc-prim >= 0.3.1.0 && < 0.12, half >= 0.2.2.3 && < 0.4, hashable >= 1.2 && < 2.0, - primitive >= 0.5 && < 0.9, + primitive >= 0.5 && < 0.10, strict >= 0.4 && < 0.6, - text >= 1.1 && < 2.1, - these >= 1.1 && < 1.3, + text >= 1.1 && < 2.2, + these >= 1.1 && < 2.2, unordered-containers >= 0.2 && < 0.3, vector >= 0.10 && < 0.14 @@ -124,19 +124,19 @@ test-suite tests Tests.GeneralisedUTF8 build-depends: - base >= 4.11 && < 4.19, - bytestring >= 0.10.4 && < 0.12, + base >= 4.11 && < 4.20, + bytestring >= 0.10.4 && < 0.13, directory >= 1.0 && < 1.4, filepath >= 1.0 && < 1.5, - text >= 1.1 && < 2.1, + text >= 1.1 && < 2.2, time >= 1.4 && < 1.14, - containers >= 0.5 && < 0.7, + containers >= 0.5 && < 0.8, unordered-containers >= 0.2 && < 0.3, - primitive >= 0.5 && < 0.9, + primitive >= 0.5 && < 0.10, cborg, serialise, QuickCheck >= 2.9 && < 2.15, - tasty >= 0.11 && < 1.5, + tasty >= 0.11 && < 1.6, tasty-hunit >= 0.9 && < 0.11, tasty-quickcheck >= 0.8 && < 0.11, quickcheck-instances >= 0.3.12 && < 0.4, @@ -161,14 +161,14 @@ benchmark instances Instances.Time build-depends: - base >= 4.11 && < 4.19, + base >= 4.11 && < 4.20, binary >= 0.7 && < 0.11, - bytestring >= 0.10.4 && < 0.12, + bytestring >= 0.10.4 && < 0.13, vector >= 0.10 && < 0.14, cborg, serialise, - deepseq >= 1.0 && < 1.5, + deepseq >= 1.0 && < 1.6, criterion >= 1.0 && < 1.7 if flag(newtime15) @@ -205,16 +205,16 @@ benchmark micro SimpleVersus build-depends: - base >= 4.11 && < 4.19, + base >= 4.11 && < 4.20, binary >= 0.7 && < 0.11, - bytestring >= 0.10.4 && < 0.12, - ghc-prim >= 0.3.1.0 && < 0.11, + bytestring >= 0.10.4 && < 0.13, + ghc-prim >= 0.3.1.0 && < 0.12, vector >= 0.10 && < 0.14, cborg, serialise, - aeson >= 0.7 && < 2.2, - deepseq >= 1.0 && < 1.5, + aeson >= 0.7 && < 2.3, + deepseq >= 1.0 && < 1.6, criterion >= 1.0 && < 1.7, cereal >= 0.5.2.0 && < 0.6, cereal-vector >= 0.2 && < 0.3, @@ -251,22 +251,22 @@ benchmark versus Macro.CBOR build-depends: - base >= 4.11 && < 4.19, + base >= 4.11 && < 4.20, array >= 0.4 && < 0.6, binary >= 0.7 && < 0.11, - bytestring >= 0.10.4 && < 0.12, + bytestring >= 0.10.4 && < 0.13, directory >= 1.0 && < 1.4, - ghc-prim >= 0.3.1.0 && < 0.11, + ghc-prim >= 0.3.1.0 && < 0.12, fail >= 4.9.0.0 && < 4.10, - text >= 1.1 && < 2.1, + text >= 1.1 && < 2.2, vector >= 0.10 && < 0.14, cborg, serialise, filepath >= 1.0 && < 1.5, - containers >= 0.5 && < 0.7, - deepseq >= 1.0 && < 1.5, - aeson >= 0.7 && < 2.2, + containers >= 0.5 && < 0.8, + deepseq >= 1.0 && < 1.6, + aeson >= 0.7 && < 2.3, cereal >= 0.5.2.0 && < 0.6, half >= 0.2.2.3 && < 0.4, tar >= 0.4 && < 0.6, diff --git a/serialise/tests/Tests/Serialise.hs b/serialise/tests/Tests/Serialise.hs index ff8cd46..375ef5a 100644 --- a/serialise/tests/Tests/Serialise.hs +++ b/serialise/tests/Tests/Serialise.hs @@ -434,5 +434,6 @@ instance Serialise Utf8ByteArray where instance Arbitrary Utf8ByteArray where arbitrary = do - BSS.SBS ba <- BSS.toShort . Text.encodeUtf8 <$> arbitrary - return $ Utf8BA $ CBOR.BA.BA $ Prim.ByteArray ba + bss <- BSS.toShort . Text.encodeUtf8 <$> arbitrary + case bss of + BSS.SBS ba -> return $ Utf8BA $ CBOR.BA.BA $ Prim.ByteArray ba From 286de8277ca02ff4ff9a9485945fe01c1d536237 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Mon, 13 Nov 2023 07:47:16 +1100 Subject: [PATCH 2/2] CI: Include more recent GHC versions --- .github/workflows/haskell-ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 3e33cf4..9d37dd4 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -28,14 +28,19 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.6.1 + - compiler: ghc-9.8.1 compilerKind: ghc - compilerVersion: 9.6.1 + compilerVersion: 9.8.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.2 + - compiler: ghc-9.6.3 compilerKind: ghc - compilerVersion: 9.4.2 + compilerVersion: 9.6.3 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.4.7 + compilerKind: ghc + compilerVersion: 9.4.7 setup-method: ghcup allow-failure: false - compiler: ghc-9.2.2