Skip to content

Commit 766e589

Browse files
committed
Support GHC-9.12
1 parent f8693c3 commit 766e589

File tree

5 files changed

+49
-32
lines changed

5 files changed

+49
-32
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20240708
11+
# version: 0.19.20250722
1212
#
13-
# REGENDATA ("0.19.20240708",["github","cabal.project"])
13+
# REGENDATA ("0.19.20250722",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727
timeout-minutes:
2828
60
2929
container:
@@ -38,19 +38,24 @@ jobs:
3838
strategy:
3939
matrix:
4040
include:
41-
- compiler: ghc-9.10.1
41+
- compiler: ghc-9.12.2
4242
compilerKind: ghc
43-
compilerVersion: 9.10.1
43+
compilerVersion: 9.12.2
4444
setup-method: ghcup
4545
allow-failure: false
46-
- compiler: ghc-9.8.2
46+
- compiler: ghc-9.10.2
4747
compilerKind: ghc
48-
compilerVersion: 9.8.2
48+
compilerVersion: 9.10.2
4949
setup-method: ghcup
5050
allow-failure: false
51-
- compiler: ghc-9.6.6
51+
- compiler: ghc-9.8.4
5252
compilerKind: ghc
53-
compilerVersion: 9.6.6
53+
compilerVersion: 9.8.4
54+
setup-method: ghcup
55+
allow-failure: false
56+
- compiler: ghc-9.6.7
57+
compilerKind: ghc
58+
compilerVersion: 9.6.7
5459
setup-method: ghcup
5560
allow-failure: false
5661
- compiler: ghc-9.4.8
@@ -85,15 +90,29 @@ jobs:
8590
allow-failure: false
8691
fail-fast: false
8792
steps:
88-
- name: apt
93+
- name: apt-get install
8994
run: |
9095
apt-get update
9196
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
97+
- name: Install GHCup
98+
run: |
9299
mkdir -p "$HOME/.ghcup/bin"
93-
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
100+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
94101
chmod a+x "$HOME/.ghcup/bin/ghcup"
102+
- name: Install cabal-install
103+
run: |
104+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
105+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
106+
- name: Install GHC (GHCup)
107+
if: matrix.setup-method == 'ghcup'
108+
run: |
95109
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
96-
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
110+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
111+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
112+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
113+
echo "HC=$HC" >> "$GITHUB_ENV"
114+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
115+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
97116
env:
98117
HCKIND: ${{ matrix.compilerKind }}
99118
HCNAME: ${{ matrix.compiler }}
@@ -104,21 +123,12 @@ jobs:
104123
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
105124
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
106125
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
107-
HCDIR=/opt/$HCKIND/$HCVER
108-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
109-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
110-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
111-
echo "HC=$HC" >> "$GITHUB_ENV"
112-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
113-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
114-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115126
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
116127
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
117128
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
118129
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
119130
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
120131
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
121-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
122132
env:
123133
HCKIND: ${{ matrix.compilerKind }}
124134
HCNAME: ${{ matrix.compiler }}
@@ -193,7 +203,11 @@ jobs:
193203
touch cabal.project.local
194204
echo "packages: ${PKGDIR_postgresql_simple}" >> cabal.project
195205
echo "package postgresql-simple" >> cabal.project
196-
echo " ghc-options: -Werror=missing-methods" >> cabal.project
206+
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
207+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package postgresql-simple" >> cabal.project ; fi
208+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
209+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package postgresql-simple" >> cabal.project ; fi
210+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
197211
cat >> cabal.project <<EOF
198212
EOF
199213
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(postgresql-simple)$/; }' >> cabal.project.local
@@ -234,8 +248,8 @@ jobs:
234248
rm -f cabal.project.local
235249
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
236250
- name: save cache
237-
uses: actions/cache/save@v4
238251
if: always()
252+
uses: actions/cache/save@v4
239253
with:
240254
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
241255
path: ~/.cabal/store

postgresql-simple.cabal

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cabal-version: 1.12
22
name: postgresql-simple
3-
version: 0.7.0.0
4-
x-revision: 3
3+
version: 0.7.0.1
54
synopsis: Mid-Level PostgreSQL client library
65
description:
76
Mid-Level PostgreSQL client library, forked from mysql-simple.
@@ -30,9 +29,10 @@ tested-with:
3029
|| ==9.0.2
3130
|| ==9.2.8
3231
|| ==9.4.8
33-
|| ==9.6.6
34-
|| ==9.8.2
35-
|| ==9.10.1
32+
|| ==9.6.7
33+
|| ==9.8.4
34+
|| ==9.10.2
35+
|| ==9.12.2
3636

3737
library
3838
default-language: Haskell2010
@@ -78,10 +78,10 @@ library
7878

7979
-- GHC bundled libs
8080
build-depends:
81-
base >=4.12.0.0 && <4.21
81+
base >=4.12.0.0 && <4.22
8282
, bytestring >=0.10.8.2 && <0.13
8383
, containers >=0.6.0.1 && <0.8
84-
, template-haskell >=2.14.0.0 && <2.23
84+
, template-haskell >=2.14.0.0 && <2.24
8585
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2
8686
, time-compat >=1.9.5 && <1.12
8787
, transformers >=0.5.6.2 && <0.7
@@ -118,7 +118,7 @@ test-suite inspection
118118
main-is: Inspection.hs
119119
build-depends:
120120
base
121-
, inspection-testing >=0.4.1.1 && <0.6
121+
, inspection-testing >=0.4.1.1 && <0.7
122122
, postgresql-libpq
123123
, postgresql-simple
124124
, tasty
@@ -156,7 +156,6 @@ test-suite test
156156
, containers
157157
, cryptohash-md5 >=0.11.100.1 && <0.12
158158
, filepath
159-
, HUnit
160159
, postgresql-simple
161160
, tasty
162161
, tasty-golden

src/Database/PostgreSQL/Simple/Copy.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ doCopy funcName conn template q = do
9191
PQ.BadResponse -> throwResultError funcName result status
9292
PQ.NonfatalError -> throwResultError funcName result status
9393
PQ.FatalError -> throwResultError funcName result status
94+
_ -> throwResultError funcName result status -- TODO
9495

9596
data CopyOutResult
9697
= CopyOutRow !B.ByteString -- ^ Data representing either exactly

src/Database/PostgreSQL/Simple/Internal.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ exec conn sql =
396396
PQ.BadResponse -> getResult h mres'
397397
PQ.NonfatalError -> getResult h mres'
398398
PQ.FatalError -> getResult h mres'
399+
_ -> error "incomplete match"
399400
#endif
400401

401402
-- | A version of 'execute' that does not perform query substitution.
@@ -431,6 +432,7 @@ finishExecute _conn q result = do
431432
PQ.BadResponse -> throwResultError "execute" result status
432433
PQ.NonfatalError -> throwResultError "execute" result status
433434
PQ.FatalError -> throwResultError "execute" result status
435+
_ -> throwResultError "execute: TODO" result status
434436
where
435437
mkInteger str = B8.foldl' delta 0 str
436438
where

src/Database/PostgreSQL/Simple/Internal/PQResultUtils.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ finishQueryWith' q result k = do
8181
PQ.BadResponse -> throwResultError "query" result status
8282
PQ.NonfatalError -> throwResultError "query" result status
8383
PQ.FatalError -> throwResultError "query" result status
84+
_ -> throwResultError "query: TODO" result status
8485
where
8586
queryErr msg = throwIO $ QueryError msg q
8687

0 commit comments

Comments
 (0)