Skip to content

Commit 9eab895

Browse files
authored
Merge pull request #44 from biocad/maksbotan/ghc-9.6
GHC 9.6 compatibility
2 parents 90f7a44 + 6d8256b commit 9eab895

File tree

6 files changed

+57
-30
lines changed

6 files changed

+57
-30
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 26 additions & 19 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.15.20230128
11+
# version: 0.16.3
1212
#
13-
# REGENDATA ("0.15.20230128",["github","cabal.project","--config","cabal.haskell-ci"])
13+
# REGENDATA ("0.16.3",["github","cabal.project","--config","cabal.haskell-ci"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -32,14 +32,19 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.4.4
35+
- compiler: ghc-9.6.2
3636
compilerKind: ghc
37-
compilerVersion: 9.4.4
37+
compilerVersion: 9.6.2
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.2.5
40+
- compiler: ghc-9.4.5
4141
compilerKind: ghc
42-
compilerVersion: 9.2.5
42+
compilerVersion: 9.4.5
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.2.7
46+
compilerKind: ghc
47+
compilerVersion: 9.2.7
4348
setup-method: ghcup
4449
allow-failure: false
4550
- compiler: ghc-9.0.2
@@ -70,20 +75,18 @@ jobs:
7075
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
7176
if [ "${{ matrix.setup-method }}" = ghcup ]; then
7277
mkdir -p "$HOME/.ghcup/bin"
73-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
78+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
7479
chmod a+x "$HOME/.ghcup/bin/ghcup"
75-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
7680
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
77-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
81+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
7882
else
7983
apt-add-repository -y 'ppa:hvr/ghc'
8084
apt-get update
8185
apt-get install -y "$HCNAME"
8286
mkdir -p "$HOME/.ghcup/bin"
83-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
87+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
8488
chmod a+x "$HOME/.ghcup/bin/ghcup"
85-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
86-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
89+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
8790
fi
8891
env:
8992
HCKIND: ${{ matrix.compilerKind }}
@@ -101,13 +104,13 @@ jobs:
101104
echo "HC=$HC" >> "$GITHUB_ENV"
102105
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
103106
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
104-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
107+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
105108
else
106109
HC=$HCDIR/bin/$HCKIND
107110
echo "HC=$HC" >> "$GITHUB_ENV"
108111
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
109112
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
110-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
113+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
111114
fi
112115
113116
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
@@ -159,8 +162,8 @@ jobs:
159162
- name: install cabal-plan
160163
run: |
161164
mkdir -p $HOME/.cabal/bin
162-
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
163-
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
165+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
166+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
164167
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
165168
rm -f cabal-plan.xz
166169
chmod a+x $HOME/.cabal/bin/cabal-plan
@@ -234,18 +237,22 @@ jobs:
234237
${CABAL} -vnormal check
235238
- name: haddock
236239
run: |
237-
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
240+
if [ $((HCNUMVER < 90000 || HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
238241
- name: unconstrained build
239242
run: |
240243
rm -f cabal.project.local
241244
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
242245
- name: prepare for constraint sets
243246
run: |
244247
rm -f cabal.project.local
248+
- name: constraint set servant-0.20
249+
run: |
250+
if [ $((HCNUMVER >= 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.20.*' --dependencies-only -j2 all ; fi
251+
if [ $((HCNUMVER >= 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.20.*' all ; fi
245252
- name: constraint set servant-0.19
246253
run: |
247-
if [ $((HCNUMVER >= 80800 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19' --dependencies-only -j2 all ; fi
248-
if [ $((HCNUMVER >= 80800 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19' all ; fi
254+
if [ $((HCNUMVER >= 80800 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19.*' --dependencies-only -j2 all ; fi
255+
if [ $((HCNUMVER >= 80800 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.19.*' all ; fi
249256
- name: constraint set servant-0.18.2
250257
run: |
251258
if [ $((HCNUMVER >= 80800 && HCNUMVER < 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.18.2' --dependencies-only -j2 all ; fi

cabal.haskell-ci

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ branches: master
22

33
distribution: focal
44

5+
-- https://github.com/haskell-CI/haskell-ci/issues/658#issuecomment-1513692337
6+
haddock-components: libs
7+
8+
-- Building docs on GHC 9.2 and 9.4 leads to myriad of different errors.
9+
-- See https://github.com/haskell/cabal/issues/7462, https://github.com/haskell/cabal/issues/8707
10+
-- and https://github.com/haskell/cabal/issues/8707
11+
haddock: < 9.0 || >= 9.4
12+
513
constraint-set servant-0.17
614
ghc: >= 8.0 && <8.10
715
constraints: servant ==0.17.*
@@ -19,5 +27,9 @@ constraint-set servant-0.18.2
1927
constraints: servant ==0.18.2
2028

2129
constraint-set servant-0.19
22-
ghc: >= 8.8 && <9.4
23-
constraints: servant ==0.19
30+
ghc: >= 8.8 && <9.6
31+
constraints: servant ==0.19.*
32+
33+
constraint-set servant-0.20
34+
ghc: >= 8.10 && <9.8
35+
constraints: servant ==0.20.*

example/example.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ tested-with:
1818
|| ==8.8.4
1919
|| ==8.10.7
2020
|| ==9.0.2
21-
|| ==9.2.5
22-
|| ==9.4.4
21+
|| ==9.2.7
22+
|| ==9.4.5
23+
|| ==9.6.2
2324

2425
library
2526
ghc-options: -Wall

servant-openapi3.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ tested-with:
3333
|| ==8.8.4
3434
|| ==8.10.7
3535
|| ==9.0.2
36-
|| ==9.2.5
37-
|| ==9.4.4
36+
|| ==9.2.7
37+
|| ==9.4.5
38+
|| ==9.6.2
3839

3940
extra-source-files:
4041
README.md
@@ -55,8 +56,8 @@ source-repository head
5556

5657
custom-setup
5758
setup-depends:
58-
base >=4.9 && <4.18,
59-
Cabal >= 1.24,
59+
base >=4.9 && <4.19,
60+
Cabal >= 1.24 && < 4,
6061
cabal-doctest >=1.0.6 && <1.1
6162

6263
library
@@ -77,13 +78,13 @@ library
7778
hs-source-dirs: src
7879
build-depends: aeson >=1.4.2.0 && <1.6 || >=2.0.1.0 && <2.2
7980
, aeson-pretty >=0.8.7 && <0.9
80-
, base >=4.9.1.0 && <4.18
81+
, base >=4.9.1.0 && <4.19
8182
, base-compat >=0.10.5 && <0.14
8283
, bytestring >=0.10.8.1 && <0.12
8384
, http-media >=0.7.1.3 && <0.9
8485
, insert-ordered-containers >=0.2.1.0 && <0.3
8586
, lens >=4.17 && <5.3
86-
, servant >=0.17 && <0.20
87+
, servant >=0.17 && <0.21
8788
, singleton-bool >=0.1.4 && <0.2
8889
, openapi3 >=3.2.3 && <3.3
8990
, text >=1.2.3.0 && <3

src/Servant/OpenApi/Internal.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ instance (HasOpenApi sub) => HasOpenApi (RemoteHost :> sub) where
287287
instance (HasOpenApi sub) => HasOpenApi (HttpVersion :> sub) where
288288
toOpenApi _ = toOpenApi (Proxy :: Proxy sub)
289289

290+
#if MIN_VERSION_servant(0,20,0)
291+
-- | @'WithResource'@ combinator does not change our specification at all.
292+
instance (HasOpenApi sub) => HasOpenApi (WithResource res :> sub) where
293+
toOpenApi _ = toOpenApi (Proxy :: Proxy sub)
294+
#endif
295+
290296
-- | @'WithNamedContext'@ combinator does not change our specification at all.
291297
instance (HasOpenApi sub) => HasOpenApi (WithNamedContext x c sub) where
292298
toOpenApi _ = toOpenApi (Proxy :: Proxy sub)

src/Servant/OpenApi/Internal/Test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import Servant.OpenApi.Internal.TypeLevel
7373
-- >>> type ContactAPI = Get '[JSON] Contact
7474
-- >>> hspec $ validateEveryToJSON (Proxy :: Proxy ContactAPI)
7575
-- ...
76-
-- ...No instance for (Arbitrary Contact)
76+
-- ...No instance for ...Arbitrary Contact...
7777
-- ... arising from a use of ‘validateEveryToJSON’
7878
-- ...
7979
validateEveryToJSON

0 commit comments

Comments
 (0)