From f2164d9d6057d4f22f38dd2d18e834d83fe955f2 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Tue, 14 May 2024 01:08:15 +0300 Subject: [PATCH] Allow base-4.20 --- .github/workflows/haskell-ci.yml | 74 +++++++++++++------------------- .github/workflows/simple.yml | 11 ++--- postgresql-libpq.cabal | 8 ++-- 3 files changed, 41 insertions(+), 52 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 4c038f2..f951169 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.17.20231110 +# version: 0.19.20240708 # -# REGENDATA ("0.17.20231110",["github","postgresql-libpq.cabal"]) +# REGENDATA ("0.19.20240708",["github","postgresql-libpq.cabal"]) # name: Haskell-CI on: @@ -27,7 +27,7 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy services: postgres: image: postgres:14 @@ -38,14 +38,19 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.8.1 + - compiler: ghc-9.10.1 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.3 + - compiler: ghc-9.8.2 compilerKind: ghc - compilerVersion: 9.6.3 + compilerVersion: 9.8.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.5 + compilerKind: ghc + compilerVersion: 9.6.5 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.8 @@ -71,12 +76,12 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - 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 fail-fast: false steps: @@ -84,21 +89,11 @@ jobs: 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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$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.2.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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + 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) + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -110,22 +105,13 @@ jobs: 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/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.10.2.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.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - + 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" @@ -182,7 +168,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 @@ -210,7 +196,7 @@ jobs: 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 /^(postgresql-libpq)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -218,7 +204,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 @@ -248,7 +234,7 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 if: always() with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} diff --git a/.github/workflows/simple.yml b/.github/workflows/simple.yml index 2636402..4f80765 100644 --- a/.github/workflows/simple.yml +++ b/.github/workflows/simple.yml @@ -14,7 +14,8 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest] - ghc: ['8.10','9.0','9.2','9.4.8','9.6.3','9.8.1'] + # Older GHCs need LLVM on macos-latest (ARM) + ghc: ['9.2','9.4.8','9.6.6','9.8.2','9.10.1'] fail-fast: false timeout-minutes: 60 @@ -26,13 +27,13 @@ jobs: - name: Set up Haskell id: setup-haskell - uses: haskell/actions/setup@v2 + uses: haskell-actions/setup@v2 with: ghc-version: ${{ matrix.ghc }} cabal-version: '3.10.2.0' - name: Set up PostgreSQL - uses: ikalnytskyi/action-setup-postgres@v3 + uses: ikalnytskyi/action-setup-postgres@v6 id: postgres with: username: ci @@ -40,10 +41,10 @@ jobs: database: test - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v4 - name: Cache - uses: actions/cache@v2.1.3 + uses: actions/cache@v4 with: path: ${{ steps.setup-haskell.outputs.cabal-store }} key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} diff --git a/postgresql-libpq.cabal b/postgresql-libpq.cabal index e9cfd9b..6292857 100644 --- a/postgresql-libpq.cabal +++ b/postgresql-libpq.cabal @@ -1,6 +1,7 @@ cabal-version: 2.4 name: postgresql-libpq version: 0.10.1.0 +x-revision: 1 synopsis: low-level binding to libpq description: This is a binding to libpq: the C application @@ -32,13 +33,14 @@ tested-with: || ==9.4.8 || ==9.6.5 || ==9.8.2 + || ==9.10.1 extra-source-files: CHANGELOG.md custom-setup setup-depends: , base >=4.12.0.0 && <5 - , Cabal >=2.4 && <3.11 + , Cabal >=2.4 && <3.13 -- If true, use pkg-config, otherwise use the pg_config based build -- configuration @@ -75,14 +77,14 @@ library Database.PostgreSQL.LibPQ.Ptr build-depends: - , base >=4.12.0.0 && <4.20 + , base >=4.12.0.0 && <4.21 , bytestring >=0.10.8.2 && <0.13 if !os(windows) build-depends: unix >=2.7.2.2 && <2.9 if os(windows) - build-depends: Win32 >=2.2.0.2 && <2.14 + build-depends: Win32 >=2.2.0.2 && <2.15 if flag(use-pkg-config) pkgconfig-depends: libpq >=10.22