diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index c61a312..58fdd5e 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.16 +# version: 0.19.20250104 # -# REGENDATA ("0.16",["github","cabal.project"]) +# REGENDATA ("0.19.20250104",["github","cabal.project"]) # name: Haskell-CI on: @@ -23,29 +23,34 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: + - compiler: ghc-9.12.1 + compilerKind: ghc + compilerVersion: 9.12.1 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.8.1 + - compiler: ghc-9.8.4 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.8.4 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.3 + - compiler: ghc-9.6.6 compilerKind: ghc - compilerVersion: 9.6.3 + compilerVersion: 9.6.6 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.7 + - compiler: ghc-9.4.8 compilerKind: ghc - compilerVersion: 9.4.7 + compilerVersion: 9.4.8 setup-method: ghcup allow-failure: false - compiler: ghc-9.2.2 @@ -56,7 +61,7 @@ jobs: - compiler: ghc-9.0.1 compilerKind: ghc compilerVersion: 9.0.1 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.10.7 compilerKind: ghc @@ -66,39 +71,43 @@ jobs: - compiler: ghc-8.8.3 compilerKind: ghc compilerVersion: 8.8.3 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.4.4 compilerKind: ghc compilerVersion: 8.4.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false fail-fast: false steps: - - name: apt + - name: apt-get install run: | apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y "$HCNAME" - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev + - name: Install GHCup + run: | + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + - name: Install cabal-install + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.1 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.1 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' + run: | + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -109,28 +118,12 @@ jobs: echo "LANG=C.UTF-8" >> "$GITHUB_ENV" echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" - HCDIR=/opt/$HCKIND/$HCVER - if [ "${{ matrix.setup-method }}" = ghcup ]; then - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -180,7 +173,7 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist @@ -188,8 +181,8 @@ jobs: touch cabal.project echo "packages: $GITHUB_WORKSPACE/source/cborg" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/cbor-tool" >> cabal.project - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/serialise" >> cabal.project ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/binary-serialise-cbor" >> cabal.project ; fi + echo "packages: $GITHUB_WORKSPACE/source/serialise" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/binary-serialise-cbor" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/cborg-json" >> cabal.project cat cabal.project - name: sdist @@ -217,23 +210,22 @@ jobs: touch cabal.project.local echo "packages: ${PKGDIR_cborg}" >> cabal.project echo "packages: ${PKGDIR_cbor_tool}" >> cabal.project - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_serialise}" >> cabal.project ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_binary_serialise_cbor}" >> cabal.project ; fi + echo "packages: ${PKGDIR_serialise}" >> cabal.project + echo "packages: ${PKGDIR_binary_serialise_cbor}" >> cabal.project echo "packages: ${PKGDIR_cborg_json}" >> cabal.project echo "package cborg" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project echo "package cbor-tool" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "package serialise" >> cabal.project ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "package binary-serialise-cbor" >> cabal.project ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + echo "package serialise" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package binary-serialise-cbor" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project echo "package cborg-json" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(binary-serialise-cbor|cbor-tool|cborg|cborg-json|serialise)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -241,7 +233,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -265,10 +257,10 @@ jobs: ${CABAL} -vnormal check cd ${PKGDIR_cbor_tool} || false ${CABAL} -vnormal check - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_serialise} || false ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_binary_serialise_cbor} || false ; fi - if [ $((HCNUMVER < 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi + cd ${PKGDIR_serialise} || false + ${CABAL} -vnormal check + cd ${PKGDIR_binary_serialise_cbor} || false + ${CABAL} -vnormal check cd ${PKGDIR_cborg_json} || false ${CABAL} -vnormal check - name: haddock @@ -279,8 +271,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v3 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/binary-serialise-cbor/binary-serialise-cbor.cabal b/binary-serialise-cbor/binary-serialise-cbor.cabal index 180b585..99a050b 100644 --- a/binary-serialise-cbor/binary-serialise-cbor.cabal +++ b/binary-serialise-cbor/binary-serialise-cbor.cabal @@ -19,7 +19,11 @@ tested-with: GHC == 8.10.7, GHC == 9.0.1, GHC == 9.2.2, - GHC == 9.4.2 + GHC == 9.4.8 + GHC == 9.6.6 + GHC == 9.8.4 + GHC == 9.10.1 + GHC == 9.12.1 extra-source-files: ChangeLog.md @@ -51,7 +55,7 @@ library exposed-modules: Data.Binary.Serialise.CBOR.Read build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, bytestring < 1.0, cborg == 0.2.*, diff --git a/cabal.project b/cabal.project index fe66065..a1cdef9 100644 --- a/cabal.project +++ b/cabal.project @@ -5,6 +5,8 @@ packages: binary-serialise-cbor/ cborg-json/ --- Needed for serialise benchmarks -allow-newer: - store-core:text +if impl (ghc >= 9.12) + allow-newer: + , aeson:ghc-prim + , aeson:template-haskell + , bytestring:ghc-prim diff --git a/cbor-tool/cbor-tool.cabal b/cbor-tool/cbor-tool.cabal index e9ea1d3..95494db 100644 --- a/cbor-tool/cbor-tool.cabal +++ b/cbor-tool/cbor-tool.cabal @@ -21,15 +21,18 @@ tested-with: GHC == 8.10.7, GHC == 9.0.1, GHC == 9.2.2, - GHC == 9.4.2, - GHC == 9.6.1 + GHC == 9.4.8 + GHC == 9.6.6 + GHC == 9.8.4 + GHC == 9.10.1 + GHC == 9.12.1 executable cbor-tool main-is: Main.hs other-extensions: CPP, BangPatterns ghc-options: -Wall build-depends: - base >=4.11 && <4.21, + base >=4.11 && <4.22, filepath >=1.0 && <1.6, aeson >=0.7 && <2.3, aeson-pretty >=0.8 && <0.9, diff --git a/cborg-json/cborg-json.cabal b/cborg-json/cborg-json.cabal index 62b0590..17d64ed 100644 --- a/cborg-json/cborg-json.cabal +++ b/cborg-json/cborg-json.cabal @@ -23,14 +23,17 @@ tested-with: GHC == 8.10.7, GHC == 9.0.1, GHC == 9.2.2, - GHC == 9.4.2, - GHC == 9.6.1 + GHC == 9.4.8 + GHC == 9.6.6 + GHC == 9.8.4 + GHC == 9.10.1 + GHC == 9.12.1 library exposed-modules: Codec.CBOR.JSON ghc-options: -Wall build-depends: - base >=4.11 && < 4.21, + base >=4.11 && < 4.22, aeson >=0.7 && <2.3, aeson-pretty >=0.8 && <0.9, base64-bytestring >=1.0 && <1.3, @@ -61,7 +64,7 @@ benchmark bench other-modules: build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, bytestring >= 0.10.4 && < 0.13, criterion >= 1.0 && < 1.7, deepseq >= 1.0 && < 1.6, @@ -87,7 +90,7 @@ test-suite tests other-modules: build-depends: - base >= 4.7 && < 4.21, + base >= 4.7 && < 4.22, base-orphans, base16-bytestring >= 1.0 && < 1.1, bytestring >= 0.10.4 && < 0.13, diff --git a/cborg/cborg.cabal b/cborg/cborg.cabal index 038b6fa..86bf84b 100644 --- a/cborg/cborg.cabal +++ b/cborg/cborg.cabal @@ -19,8 +19,11 @@ tested-with: GHC == 8.10.7, GHC == 9.0.1, GHC == 9.2.2, - GHC == 9.4.2, - GHC == 9.6.1 + GHC == 9.4.8 + GHC == 9.6.6 + GHC == 9.8.4 + GHC == 9.10.1 + GHC == 9.12.1 extra-source-files: ChangeLog.md @@ -90,11 +93,11 @@ library build-depends: array >= 0.4 && < 0.6, - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, bytestring >= 0.10.4 && < 0.13, containers >= 0.5 && < 0.8, deepseq >= 1.0 && < 1.6, - ghc-prim >= 0.3.1.0 && < 0.12, + ghc-prim >= 0.3.1.0 && < 0.14, half >= 0.2.2.3 && < 0.4, primitive >= 0.5 && < 0.10, text >= 1.1 && < 1.3 || >= 2.0 && <2.2 @@ -148,7 +151,7 @@ test-suite tests build-depends: array >= 0.4 && < 0.6, - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, base-orphans, bytestring >= 0.10.4 && < 0.13, text >= 1.1 && < 2.2, diff --git a/serialise/serialise.cabal b/serialise/serialise.cabal index 8c86caf..5bb4812 100644 --- a/serialise/serialise.cabal +++ b/serialise/serialise.cabal @@ -36,7 +36,11 @@ tested-with: GHC == 8.10.7, GHC == 9.0.1, GHC == 9.2.2, - GHC == 9.4.2 + GHC == 9.4.8 + GHC == 9.6.6 + GHC == 9.8.4 + GHC == 9.10.1 + GHC == 9.12.1 extra-source-files: ChangeLog.md @@ -69,12 +73,12 @@ library Codec.Serialise.Internal.GeneralisedUTF8 build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, array >= 0.4 && < 0.6, bytestring >= 0.10.4 && < 0.13, cborg == 0.2.*, containers >= 0.5 && < 0.8, - ghc-prim >= 0.3.1.0 && < 0.12, + ghc-prim >= 0.3.1.0 && < 0.14, half >= 0.2.2.3 && < 0.4, hashable >= 1.2 && < 2.0, primitive >= 0.5 && < 0.10, @@ -124,7 +128,7 @@ test-suite tests Tests.GeneralisedUTF8 build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, bytestring >= 0.10.4 && < 0.13, directory >= 1.0 && < 1.4, filepath >= 1.0 && < 1.6, @@ -161,7 +165,7 @@ benchmark instances Instances.Time build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, binary >= 0.7 && < 0.11, bytestring >= 0.10.4 && < 0.13, vector >= 0.10 && < 0.14, @@ -205,10 +209,10 @@ benchmark micro SimpleVersus build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, binary >= 0.7 && < 0.11, bytestring >= 0.10.4 && < 0.13, - ghc-prim >= 0.3.1.0 && < 0.12, + ghc-prim >= 0.3.1.0 && < 0.14, vector >= 0.10 && < 0.14, cborg, serialise, @@ -251,12 +255,12 @@ benchmark versus Macro.CBOR build-depends: - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, array >= 0.4 && < 0.6, binary >= 0.7 && < 0.11, bytestring >= 0.10.4 && < 0.13, directory >= 1.0 && < 1.4, - ghc-prim >= 0.3.1.0 && < 0.12, + ghc-prim >= 0.3.1.0 && < 0.14, fail >= 4.9.0.0 && < 4.10, text >= 1.1 && < 2.2, vector >= 0.10 && < 0.14, diff --git a/serialise/tests/Tests/Orphanage.hs b/serialise/tests/Tests/Orphanage.hs index d852c8f..0a984d3 100644 --- a/serialise/tests/Tests/Orphanage.hs +++ b/serialise/tests/Tests/Orphanage.hs @@ -195,9 +195,11 @@ instance Arbitrary BSS.ShortByteString where arbitrary = BSS.pack <$> arbitrary #endif +#if !MIN_VERSION_quickcheck_instances(0,3,32) instance (Vector.Primitive.Prim a, Arbitrary a ) => Arbitrary (Vector.Primitive.Vector a) where arbitrary = Vector.Primitive.fromList <$> arbitrary +#endif #if MIN_VERSION_base(4,7,0) && !MIN_VERSION_QuickCheck(2,10,0) instance Arbitrary (Proxy a) where