From 4b7091d3b1623c83dadd1b225611b6763e20cafe Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Wed, 29 Mar 2023 16:33:57 +0300 Subject: [PATCH] Allow GHC-9.6 bundled libs --- .github/workflows/haskell-ci.yml | 43 ++++++++++++++++++++------------ .github/workflows/simple.yml | 11 ++++++-- cabal.project.local.win | 6 +++-- postgresql-libpq.cabal | 9 ++++--- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index fd28d97..87c94fa 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.15.20221225 +# version: 0.15.20230321 # -# REGENDATA ("0.15.20221225",["github","postgresql-libpq.cabal"]) +# REGENDATA ("0.15.20230321",["github","postgresql-libpq.cabal"]) # name: Haskell-CI on: @@ -38,14 +38,19 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.4.2 + - compiler: ghc-9.6.1 compilerKind: ghc - compilerVersion: 9.4.2 + compilerVersion: 9.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.2.4 + - compiler: ghc-9.4.4 compilerKind: ghc - compilerVersion: 9.2.4 + compilerVersion: 9.4.4 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.2.7 + compilerKind: ghc + compilerVersion: 9.2.7 setup-method: ghcup allow-failure: false - compiler: ghc-9.0.2 @@ -76,18 +81,18 @@ jobs: 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.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" + 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.6.2.0 || (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.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" + 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.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) fi env: HCKIND: ${{ matrix.compilerKind }} @@ -105,13 +110,13 @@ jobs: 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.6.2.0 -vnormal+nowrap" >> "$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.6.2.0 -vnormal+nowrap" >> "$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))') @@ -170,7 +175,7 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: source - name: initial cabal.project for sdist @@ -205,8 +210,8 @@ jobs: run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - - name: cache - uses: actions/cache@v2 + - name: restore cache + uses: actions/cache/restore@v3 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -230,8 +235,14 @@ jobs: ${CABAL} -vnormal check - name: haddock run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: unconstrained build run: | 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() + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store diff --git a/.github/workflows/simple.yml b/.github/workflows/simple.yml index 6501909..8d37491 100644 --- a/.github/workflows/simple.yml +++ b/.github/workflows/simple.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest] - ghc: ['8.10','9.0','9.2','9.4.4'] + ghc: ['8.10','9.0','9.2','9.4.4','9.6.1'] fail-fast: false timeout-minutes: 60 @@ -29,7 +29,7 @@ jobs: uses: haskell/actions/setup@v1 with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.8.1.0' + cabal-version: '3.10.1.0' - name: Set up PostgreSQL uses: ikalnytskyi/action-setup-postgres@v3 @@ -49,6 +49,13 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- + - name: cabal.project.local + if: matrix.os == 'windows-latest' + run: cp cabal.project.local.win cabal.project.local + + - name: ghc-pkg dump + run: ghc-pkg list + - name: Build run: cabal build all --enable-tests diff --git a/cabal.project.local.win b/cabal.project.local.win index 4e6f4bc..aacb847 100644 --- a/cabal.project.local.win +++ b/cabal.project.local.win @@ -1,2 +1,4 @@ -package postgresql-libpq - flags: -use-pkg-config +constraints: Win32 installed + +-- package postgresql-libpq +-- flags: -use-pkg-config diff --git a/postgresql-libpq.cabal b/postgresql-libpq.cabal index 6aabfef..dd75544 100644 --- a/postgresql-libpq.cabal +++ b/postgresql-libpq.cabal @@ -1,6 +1,7 @@ cabal-version: 2.4 name: postgresql-libpq version: 0.9.5.0 +x-revision: 1 synopsis: low-level binding to libpq description: This is a binding to libpq: the C application @@ -24,14 +25,14 @@ category: Database build-type: Custom extra-source-files: cbits/hs-libpq.h tested-with: - GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.2 + GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.4 || ==9.6.1 extra-source-files: CHANGELOG.md custom-setup setup-depends: , base >=4.12.0.0 && <5 - , Cabal >=2.4 && <3.9 + , Cabal >=2.4 && <3.11 -- If true, use pkg-config, otherwise use the pg_config based build -- configuration @@ -67,11 +68,11 @@ library Database.PostgreSQL.LibPQ.Oid build-depends: - , base >=4.12.0.0 && <4.18 + , base >=4.12.0.0 && <4.19 , bytestring >=0.10.8.2 && <0.12 if !os(windows) - build-depends: unix >=2.7.2.2 && <2.8 + build-depends: unix >=2.7.2.2 && <2.9 if os(windows) build-depends: Win32 >=2.2.0.2 && <2.14