From 6ad784fd7c86ac1b45d103cce736d1b5695b0e05 Mon Sep 17 00:00:00 2001 From: Edsko de Vries Date: Wed, 20 Nov 2024 16:02:37 +0100 Subject: [PATCH] Preliminary support for ghc 9.12 --- .github/workflows/haskell-ci.yml | 116 ++++++++++++++++++++++++++----- cabal.project | 68 +++++++++++++++--- cabal.project.ci | 54 +++++++++++++- grapesy/grapesy.cabal | 5 +- grpc-spec/grpc-spec.cabal | 5 +- 5 files changed, 216 insertions(+), 32 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 5657729a..c0a00139 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.19.20240708 +# version: 0.19.20241114 # -# REGENDATA ("0.19.20240708",["github","cabal.project.ci"]) +# REGENDATA ("0.19.20241114",["github","cabal.project.ci"]) # name: Haskell-CI on: @@ -32,6 +32,11 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.12.0.20241031 + compilerKind: ghc + compilerVersion: 9.12.0.20241031 + setup-method: ghcup-prerelease + allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 @@ -64,42 +69,61 @@ jobs: 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 + apt-get install -y libsnappy-dev protobuf-compiler + - 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" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - apt-get update - apt-get install -y libsnappy-dev protobuf-compiler + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -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 }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-prerelease' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; + "$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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" 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" + if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -126,6 +150,18 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + if $HEADHACKAGE; then + cat >> $CABAL_CONFIG <> $CABAL_CONFIG <> cabal.project <> cabal.project + fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(basics-tutorial|conduit-tutorial|grapesy|grpc-spec|lowlevel-tutorial|metadata-tutorial|monadstack-tutorial|quickstart-tutorial|trailers-only-tutorial)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local @@ -313,8 +395,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/cabal.project b/cabal.project index 7123e82b..f2e7984a 100644 --- a/cabal.project +++ b/cabal.project @@ -1,13 +1,13 @@ -packages: +packages: ./grpc-spec , ./grapesy - , ./tutorials/quickstart - , ./tutorials/basics - , ./tutorials/lowlevel - , ./tutorials/metadata - , ./tutorials/monadstack - , ./tutorials/conduit - , ./tutorials/trailers-only +-- , ./tutorials/quickstart +-- , ./tutorials/basics +-- , ./tutorials/lowlevel +-- , ./tutorials/metadata +-- , ./tutorials/monadstack +-- , ./tutorials/conduit +-- , ./tutorials/trailers-only package grpc-spec tests: True @@ -16,7 +16,7 @@ package grpc-spec package grapesy tests: True benchmarks: True - flags: +build-demo +build-stress-test + flags: +build-demo +build-stress-test -- -- ghc 9.10 @@ -24,3 +24,53 @@ package grapesy allow-newer: proto-lens:base allow-newer: proto-lens-runtime:base + +-- +-- ghc 9.12 +-- + +allow-newer: active:base +allow-newer: assoc:base +allow-newer: binary-orphans:base +allow-newer: blaze-svg:base +allow-newer: cborg:base +allow-newer: data-fix:base +allow-newer: diagrams-core:base +allow-newer: diagrams-lib:base +allow-newer: diagrams-postscript:base +allow-newer: diagrams-svg:base +allow-newer: dual-tree:base +allow-newer: ghc-events:base +allow-newer: hashable:base +allow-newer: indexed-traversable-instances:base +allow-newer: indexed-traversable:base +allow-newer: integer-conversion:base +allow-newer: integer-logarithms:base +allow-newer: monoid-extras:base +allow-newer: OneTuple:base +allow-newer: quickcheck-instances:base +allow-newer: scientific:base +allow-newer: semialign:base +allow-newer: serialise:base +allow-newer: snappy-c:base +allow-newer: splitmix:base +allow-newer: statestack:base +allow-newer: svg-builder:base +allow-newer: text-short:base +allow-newer: these:base +allow-newer: time-compat:base +allow-newer: tree-diff:base +allow-newer: zlib:base + +allow-newer: assoc:template-haskell +allow-newer: splitmix:template-haskell + +allow-newer: bytes:time +allow-newer: Chart-diagrams:time +allow-newer: time-compat:time +allow-newer: tree-diff:time + +source-repository-package + type: git + location: https://github.com/haskell-fswatch/hfsnotify.git + tag: eea82a54558933f8cf292ca07ed29a454742ecc0 \ No newline at end of file diff --git a/cabal.project.ci b/cabal.project.ci index 9ffcd013..9f78a9c7 100644 --- a/cabal.project.ci +++ b/cabal.project.ci @@ -1,4 +1,4 @@ -packages: +packages: ./grpc-spec , ./grapesy , ./tutorials/quickstart @@ -17,7 +17,7 @@ package grpc-spec package grapesy tests: True benchmarks: True - flags: +build-demo +build-stress-test + flags: +build-demo +build-stress-test ghc-options: -Werror package quickstart-tutorial @@ -47,3 +47,53 @@ package trailers-only-tutorial allow-newer: proto-lens:base allow-newer: proto-lens-runtime:base + +-- +-- ghc 9.12 +-- + +allow-newer: active:base +allow-newer: assoc:base +allow-newer: binary-orphans:base +allow-newer: blaze-svg:base +allow-newer: cborg:base +allow-newer: data-fix:base +allow-newer: diagrams-core:base +allow-newer: diagrams-lib:base +allow-newer: diagrams-postscript:base +allow-newer: diagrams-svg:base +allow-newer: dual-tree:base +allow-newer: ghc-events:base +allow-newer: hashable:base +allow-newer: indexed-traversable-instances:base +allow-newer: indexed-traversable:base +allow-newer: integer-conversion:base +allow-newer: integer-logarithms:base +allow-newer: monoid-extras:base +allow-newer: OneTuple:base +allow-newer: quickcheck-instances:base +allow-newer: scientific:base +allow-newer: semialign:base +allow-newer: serialise:base +allow-newer: snappy-c:base +allow-newer: splitmix:base +allow-newer: statestack:base +allow-newer: svg-builder:base +allow-newer: text-short:base +allow-newer: these:base +allow-newer: time-compat:base +allow-newer: tree-diff:base +allow-newer: zlib:base + +allow-newer: assoc:template-haskell +allow-newer: splitmix:template-haskell + +allow-newer: bytes:time +allow-newer: Chart-diagrams:time +allow-newer: time-compat:time +allow-newer: tree-diff:time + +source-repository-package + type: git + location: https://github.com/haskell-fswatch/hfsnotify.git + tag: eea82a54558933f8cf292ca07ed29a454742ecc0 \ No newline at end of file diff --git a/grapesy/grapesy.cabal b/grapesy/grapesy.cabal index 7e0fa0e6..dbbf1753 100644 --- a/grapesy/grapesy.cabal +++ b/grapesy/grapesy.cabal @@ -25,6 +25,7 @@ tested-with: GHC==8.10.7 , GHC==9.6.6 , GHC==9.8.2 , GHC==9.10.1 + , GHC==9.12.1 source-repository head type: git @@ -39,7 +40,7 @@ common lang -Widentities -Wmissing-export-lists build-depends: - base >= 4.14 && < 4.21 + base >= 4.14 && < 4.22 default-language: Haskell2010 default-extensions: @@ -426,7 +427,7 @@ benchmark grapesy-kvstore -- Additional dependencies , base16-bytestring >= 1.0 && < 1.1 , base64-bytestring >= 1.2 && < 1.3 - , hashable >= 1.3 && < 1.5 + , hashable >= 1.3 && < 1.6 , optparse-applicative >= 0.16 && < 0.19 , proto-lens-runtime >= 0.7 && < 0.8 , splitmix >= 0.1 && < 0.2 diff --git a/grpc-spec/grpc-spec.cabal b/grpc-spec/grpc-spec.cabal index 21df49fe..dccf04a3 100644 --- a/grpc-spec/grpc-spec.cabal +++ b/grpc-spec/grpc-spec.cabal @@ -20,6 +20,7 @@ tested-with: GHC==8.10.7 , GHC==9.6.6 , GHC==9.8.2 , GHC==9.10.1 + , GHC==9.12.1 source-repository head type: git @@ -34,7 +35,7 @@ common lang -Widentities -Wmissing-export-lists build-depends: - base >= 4.14 && < 4.21 + base >= 4.14 && < 4.22 default-language: Haskell2010 default-extensions: @@ -134,7 +135,7 @@ library , data-default >= 0.7 && < 0.9 , deepseq >= 1.4 && < 1.6 , exceptions >= 0.10 && < 0.11 - , hashable >= 1.3 && < 1.5 + , hashable >= 1.3 && < 1.6 , http-types >= 0.12 && < 0.13 , lens >= 5.0 && < 5.4 , mtl >= 2.2 && < 2.4