Skip to content

Commit 6005247

Browse files
authored
Merge pull request #111 from haskell-servant/ghc-8.8
Support ghc-8.8 dependencies
2 parents 9c0ceb9 + 062cebe commit 6005247

File tree

4 files changed

+49
-33
lines changed

4 files changed

+49
-33
lines changed

.travis.yml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# haskell-ci '--config=cabal.haskell-ci' 'servant-swagger.cabal'
3+
# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
7-
# version: 0.3.20190521
7+
# version: 0.5.20190908
88
#
99
language: c
1010
dist: xenial
@@ -29,23 +29,27 @@ before_cache:
2929
- rm -rfv $CABALHOME/packages/head.hackage
3030
matrix:
3131
include:
32+
- compiler: ghc-8.8.1
33+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
3234
- compiler: ghc-8.6.5
33-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
35+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
3436
- compiler: ghc-8.4.4
35-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
37+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
3638
- compiler: ghc-8.2.2
37-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
39+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
3840
- compiler: ghc-8.0.2
39-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
41+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
4042
before_install:
4143
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
44+
- WITHCOMPILER="-w $HC"
45+
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
4246
- HCPKG="$HC-pkg"
4347
- unset CC
4448
- CABAL=/opt/ghc/bin/cabal
4549
- CABALHOME=$HOME/.cabal
4650
- export PATH="$CABALHOME/bin:$PATH"
4751
- TOP=$(pwd)
48-
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
52+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
4953
- echo $HCNUMVER
5054
- CABAL="$CABAL -vnormal+nowrap+markoutput"
5155
- set -o pipefail
@@ -72,11 +76,12 @@ install:
7276
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
7377
- TEST=--enable-tests
7478
- BENCH=--enable-benchmarks
75-
- GHCHEAD=${GHCHEAD-false}
79+
- HEADHACKAGE=false
7680
- rm -f $CABALHOME/config
7781
- |
7882
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
7983
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
84+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
8085
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
8186
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
8287
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
@@ -89,68 +94,73 @@ install:
8994
echo " prefix: $CABALHOME" >> $CABALHOME/config
9095
echo "repository hackage.haskell.org" >> $CABALHOME/config
9196
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
97+
- |
98+
echo "program-default-options" >> $CABALHOME/config
99+
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
92100
- cat $CABALHOME/config
93101
- rm -fv cabal.project cabal.project.local cabal.project.freeze
94102
- travis_retry ${CABAL} v2-update -v
95103
# Generate cabal.project
96104
- rm -rf cabal.project cabal.project.local cabal.project.freeze
97105
- touch cabal.project
98106
- |
99-
echo 'packages: "."' >> cabal.project
107+
echo "packages: ." >> cabal.project
100108
- |
101-
echo "write-ghc-environment-files: always" >> cabal.project
109+
echo "allow-newer: aeson-pretty-0.8.7:base-compat" >> cabal.project
102110
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-swagger)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
103111
- cat cabal.project || true
104112
- cat cabal.project.local || true
105113
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
106-
- ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
114+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
107115
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
108116
- rm cabal.project.freeze
109-
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
110-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
117+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
118+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
111119
script:
112120
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
113121
# Packaging...
114122
- ${CABAL} v2-sdist all | color_cabal_output
115123
# Unpacking...
116124
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
117125
- cd ${DISTDIR} || false
118-
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
126+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
127+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
128+
- PKGDIR_servant_swagger="$(find . -maxdepth 1 -type d -regex '.*/servant-swagger-[0-9.]*')"
119129
# Generate cabal.project
120130
- rm -rf cabal.project cabal.project.local cabal.project.freeze
121131
- touch cabal.project
122132
- |
123-
echo 'packages: "servant-swagger-*/*.cabal"' >> cabal.project
133+
echo "packages: ${PKGDIR_servant_swagger}" >> cabal.project
124134
- |
125-
echo "write-ghc-environment-files: always" >> cabal.project
135+
echo "allow-newer: aeson-pretty-0.8.7:base-compat" >> cabal.project
126136
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-swagger)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
127137
- cat cabal.project || true
128138
- cat cabal.project.local || true
129139
# Building...
130140
# this builds all libraries and executables (without tests/benchmarks)
131-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
141+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
132142
# Building with tests and benchmarks...
133143
# build & run tests, build benchmarks
134-
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
144+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
135145
# Testing...
136-
- ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
146+
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
137147
# cabal check...
138-
- (cd servant-swagger-* && ${CABAL} -vnormal check)
148+
- (cd ${PKGDIR_servant_swagger} && ${CABAL} -vnormal check)
139149
# haddock...
140-
- ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
150+
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output
141151
# Building without installed constraints for packages in global-db...
142152
- rm -f cabal.project.local
143-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
153+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
144154
# Constraint sets
145155
- rm -rf cabal.project.local
146156
# Constraint set swagger2-2.3
147-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --constraint='swagger2 ==2.3.*' all | color_cabal_output
157+
- if [ $HCNUMVER -lt 80800 ] ; then ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='swagger2 ==2.3.*' all | color_cabal_output ; fi
148158
# Constraint set swagger2-2.4
149-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --constraint='swagger2 ==2.4.*' all | color_cabal_output
159+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='swagger2 ==2.4.*' all | color_cabal_output
150160
# Constraint set servant-0.15
151-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant == 0.15.*' all | color_cabal_output
161+
- if [ $HCNUMVER -lt 80800 ] ; then ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant == 0.15.*' all | color_cabal_output ; fi
152162
# Constraint set servant-0.16
153-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant == 0.16.*' all | color_cabal_output
163+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant == 0.16.*' all | color_cabal_output
154164

155-
# REGENDATA ["--config=cabal.haskell-ci","servant-swagger.cabal"]
165+
# REGENDATA ["--config=cabal.haskell-ci","cabal.project"]
156166
# EOF

cabal.haskell-ci

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

33
constraint-set swagger2-2.3
4+
ghc: <8.8
45
constraints: swagger2 ==2.3.*
56

67
constraint-set swagger2-2.4
78
constraints: swagger2 ==2.4.*
89

910
constraint-set servant-0.15
11+
ghc: <8.8
1012
constraints: servant == 0.15.*
1113

1214
constraint-set servant-0.16

cabal.project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages: .
2+
allow-newer: aeson-pretty-0.8.7:base-compat

servant-swagger.cabal

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: servant-swagger
22
version: 1.1.7.1
3+
x-revision: 1
34
synopsis: Generate a Swagger/OpenAPI/OAS 2.0 specification for your servant API.
45
description:
56
Swagger is a project used to describe and document RESTful APIs. The core of the
@@ -33,6 +34,7 @@ tested-with:
3334
|| ==8.2.2
3435
|| ==8.4.4
3536
|| ==8.6.5
37+
|| ==8.8.1
3638

3739
extra-source-files:
3840
README.md
@@ -53,8 +55,8 @@ source-repository head
5355

5456
custom-setup
5557
setup-depends:
56-
base >=4.9 && <4.13,
57-
Cabal >= 1.24 && <2.5,
58+
base >=4.9 && <4.14,
59+
Cabal >= 1.24 && <3.1,
5860
cabal-doctest >=1.0.6 && <1.1
5961

6062
library
@@ -75,12 +77,12 @@ library
7577
hs-source-dirs: src
7678
build-depends: aeson >=1.4.2.0 && <1.5
7779
, aeson-pretty >=0.8.7 && <0.9
78-
, base >=4.9.1.0 && <4.13
79-
, base-compat >=0.10.5 && <0.11
80+
, base >=4.9.1.0 && <4.14
81+
, base-compat >=0.10.5 && <0.12
8082
, bytestring >=0.10.8.1 && <0.11
8183
, http-media >=0.7.1.3 && <0.9
8284
, insert-ordered-containers >=0.2.1.0 && <0.3
83-
, lens >=4.17 && <4.18
85+
, lens >=4.17 && <4.19
8486
, servant >=0.15 && <0.17
8587
, singleton-bool >=0.1.4 && <0.2
8688
, swagger2 >=2.3.0.1 && <2.5
@@ -117,7 +119,7 @@ test-suite spec
117119
, hspec >=2.6.0 && <2.8
118120
, QuickCheck
119121
, lens
120-
, lens-aeson >=1.0.2 && <1.1
122+
, lens-aeson >=1.0.2 && <1.2
121123
, servant
122124
, servant-swagger
123125
, swagger2

0 commit comments

Comments
 (0)