diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 16b821b..663bb73 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.20241219 # -# REGENDATA ("0.19.20240708",["github","--config=cabal.haskell-ci","cabal.project"]) +# REGENDATA ("0.19.20241219",["github","--config=cabal.haskell-ci","cabal.project"]) # name: Haskell-CI on: @@ -38,14 +38,19 @@ jobs: 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.2 + - compiler: ghc-9.8.4 compilerKind: ghc - compilerVersion: 9.8.2 + compilerVersion: 9.8.4 setup-method: ghcup allow-failure: false - compiler: ghc-9.6.6 @@ -75,15 +80,30 @@ 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 + - 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 (prerelease) + run: | + "$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 cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -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) - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (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 }} @@ -94,21 +114,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 - 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" 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 }} @@ -164,8 +175,8 @@ jobs: - name: initial cabal.project for sdist run: | touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/consumers" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/consumers-metrics-prometheus" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/consumers" >> cabal.project cat cabal.project - name: sdist run: | @@ -177,22 +188,22 @@ jobs: find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - name: generate cabal.project run: | - PKGDIR_consumers="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/consumers-[0-9.]*')" - echo "PKGDIR_consumers=${PKGDIR_consumers}" >> "$GITHUB_ENV" PKGDIR_consumers_metrics_prometheus="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/consumers-metrics-prometheus-[0-9.]*')" echo "PKGDIR_consumers_metrics_prometheus=${PKGDIR_consumers_metrics_prometheus}" >> "$GITHUB_ENV" + PKGDIR_consumers="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/consumers-[0-9.]*')" + echo "PKGDIR_consumers=${PKGDIR_consumers}" >> "$GITHUB_ENV" rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local - echo "packages: ${PKGDIR_consumers}" >> cabal.project echo "packages: ${PKGDIR_consumers_metrics_prometheus}" >> cabal.project - echo "package consumers" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "packages: ${PKGDIR_consumers}" >> cabal.project echo "package consumers-metrics-prometheus" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo "package consumers" >> 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 /^(consumers|consumers-metrics-prometheus)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -220,10 +231,10 @@ jobs: $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: cabal check run: | - cd ${PKGDIR_consumers} || false - ${CABAL} -vnormal check cd ${PKGDIR_consumers_metrics_prometheus} || false ${CABAL} -vnormal check + cd ${PKGDIR_consumers} || false + ${CABAL} -vnormal check - name: haddock run: | $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all @@ -232,8 +243,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/consumers-metrics-prometheus/consumers-metrics-prometheus.cabal b/consumers-metrics-prometheus/consumers-metrics-prometheus.cabal index 248dc38..938283e 100644 --- a/consumers-metrics-prometheus/consumers-metrics-prometheus.cabal +++ b/consumers-metrics-prometheus/consumers-metrics-prometheus.cabal @@ -16,7 +16,7 @@ maintainer: Andrzej Rybczak , copyright: Scrive AB category: Concurrency, Database build-type: Simple -tested-with: GHC == { 8.10.7, 9.0.2, 9.2.8, 9.4.8, 9.6.6, 9.8.2, 9.10.1 } +tested-with: GHC == { 8.10.7, 9.0.2, 9.2.8, 9.4.8, 9.6.6, 9.8.4, 9.10.1, 9.12.1 } bug-reports: https://github.com/scrive/consumers/issues source-repository head diff --git a/consumers/consumers.cabal b/consumers/consumers.cabal index 7cc23e9..6e061a7 100644 --- a/consumers/consumers.cabal +++ b/consumers/consumers.cabal @@ -17,7 +17,7 @@ maintainer: Andrzej Rybczak , copyright: Scrive AB category: Concurrency, Database build-type: Simple -tested-with: GHC == { 8.10.7, 9.0.2, 9.2.8, 9.4.8, 9.6.6, 9.8.2, 9.10.1 } +tested-with: GHC == { 8.10.7, 9.0.2, 9.2.8, 9.4.8, 9.6.6, 9.8.4, 9.10.1, 9.12.1 } bug-reports: https://github.com/scrive/consumers/issues source-repository head diff --git a/consumers/src/Database/PostgreSQL/Consumers/Utils.hs b/consumers/src/Database/PostgreSQL/Consumers/Utils.hs index 5b953a6..bd7a830 100644 --- a/consumers/src/Database/PostgreSQL/Consumers/Utils.hs +++ b/consumers/src/Database/PostgreSQL/Consumers/Utils.hs @@ -16,7 +16,6 @@ import Control.Monad.Catch import Control.Monad.Trans.Control import Data.Maybe import Data.Text qualified as T -import Data.Typeable import Database.PostgreSQL.PQTypes.Class import Database.PostgreSQL.PQTypes.SQL.Raw @@ -36,7 +35,7 @@ finalize m action = do -- All exceptions other than 'StopExecution' thrown to threads spawned by -- 'forkP' and 'gforkP' are propagated back to the parent thread. data StopExecution = StopExecution - deriving (Show, Typeable) + deriving (Show) instance Exception StopExecution where toException = E.asyncExceptionToException @@ -44,7 +43,7 @@ instance Exception StopExecution where -- | Exception thrown from a child thread. data ThrownFrom = ThrownFrom String SomeException - deriving (Show, Typeable) + deriving (Show) instance Exception ThrownFrom