Skip to content

Commit 028a4ff

Browse files
committed
Allow base-4.13
1 parent 8b140d7 commit 028a4ff

File tree

3 files changed

+113
-77
lines changed

3 files changed

+113
-77
lines changed

.travis.yml

Lines changed: 104 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
7+
# version: 0.5.20190908
8+
#
79
language: c
810
dist: xenial
9-
1011
git:
11-
submodules: false # whether to recursively clone submodules
12-
12+
# whether to recursively clone submodules
13+
submodules: false
1314
branches:
1415
only:
1516
- master
16-
1717
cache:
1818
directories:
1919
- $HOME/.cabal/packages
2020
- $HOME/.cabal/store
21-
2221
before_cache:
2322
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2423
# remove files that are regenerated by 'cabal update'
@@ -27,103 +26,136 @@ before_cache:
2726
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
2827
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
2928
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
30-
3129
- rm -rfv $CABALHOME/packages/head.hackage
32-
3330
matrix:
3431
include:
35-
- compiler: "ghc-8.6.3"
36-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
37-
- compiler: "ghc-8.4.4"
38-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
39-
- compiler: "ghc-8.2.2"
40-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
41-
- compiler: "ghc-8.0.2"
42-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
43-
32+
- compiler: ghc-8.8.1
33+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
34+
- compiler: ghc-8.6.5
35+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
36+
- compiler: ghc-8.4.4
37+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
38+
- compiler: ghc-8.2.2
39+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
40+
- compiler: ghc-8.0.2
41+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
4442
before_install:
45-
- HC=/opt/ghc/bin/${CC}
46-
- HCVER=$(echo "$TRAVIS_COMPILER" | sed 's/ghc-//')
47-
- echo $HCVER
48-
- HCPKG=${HC/ghc/ghc-pkg}
43+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
44+
- WITHCOMPILER="-w $HC"
45+
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
46+
- HCPKG="$HC-pkg"
4947
- unset CC
5048
- CABAL=/opt/ghc/bin/cabal
5149
- CABALHOME=$HOME/.cabal
5250
- export PATH="$CABALHOME/bin:$PATH"
53-
- ROOTDIR=$(pwd)
54-
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
51+
- TOP=$(pwd)
52+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
5553
- echo $HCNUMVER
56-
54+
- CABAL="$CABAL -vnormal+nowrap+markoutput"
55+
- set -o pipefail
56+
- |
57+
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
58+
echo 'BEGIN { state = "output"; }' >> .colorful.awk
59+
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
60+
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
61+
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
62+
echo ' if (state == "cabal") {' >> .colorful.awk
63+
echo ' print blue($0)' >> .colorful.awk
64+
echo ' } else {' >> .colorful.awk
65+
echo ' print $0' >> .colorful.awk
66+
echo ' }' >> .colorful.awk
67+
echo '}' >> .colorful.awk
68+
- cat .colorful.awk
69+
- |
70+
color_cabal_output () {
71+
awk -f $TOP/.colorful.awk
72+
}
73+
- echo text | color_cabal_output
5774
install:
5875
- ${CABAL} --version
5976
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
6077
- TEST=--enable-tests
78+
- if [ $HCNUMVER -ge 80800 ] ; then TEST=--disable-tests ; fi
6179
- BENCH=--enable-benchmarks
62-
- GHCHEAD=${GHCHEAD-false}
63-
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export CABALHOME=$APPDATA/cabal; else export CABALHOME=$HOME/.cabal; fi
64-
- travis_retry ${CABAL} update -v
65-
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
66-
- rm -fv cabal.project cabal.project.local
67-
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
68-
- rm -f cabal.project
80+
- HEADHACKAGE=false
81+
- rm -f $CABALHOME/config
82+
- |
83+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
84+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
85+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
86+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
87+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
88+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
89+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
90+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
91+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
92+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
93+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
94+
echo "install-dirs user" >> $CABALHOME/config
95+
echo " prefix: $CABALHOME" >> $CABALHOME/config
96+
echo "repository hackage.haskell.org" >> $CABALHOME/config
97+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
98+
- |
99+
echo "program-default-options" >> $CABALHOME/config
100+
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
101+
- cat $CABALHOME/config
102+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
103+
- travis_retry ${CABAL} v2-update -v
104+
# Generate cabal.project
105+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
69106
- touch cabal.project
70-
- "printf 'packages: \".\"\\n' >> cabal.project"
71-
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
72-
- touch cabal.project.local
73-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(servant-js)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
107+
- |
108+
echo "packages: ." >> cabal.project
109+
- |
110+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-js)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
74111
- cat cabal.project || true
75112
- cat cabal.project.local || true
76113
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
77-
- rm -f cabal.project.freeze
78-
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
79-
- "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
80-
- rm "cabal.project.freeze"
81-
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
82-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
83-
- rm -rf .ghc.environment.* "."/dist
84-
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
85-
86-
# Here starts the actual work to be performed for the package under test;
87-
# any command which exits with a non-zero exit code causes the build to fail.
114+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
115+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
116+
- rm cabal.project.freeze
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
88119
script:
89-
# test that source-distributions can be generated
90-
- ${CABAL} new-sdist all
120+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
121+
# Packaging...
122+
- ${CABAL} v2-sdist all | color_cabal_output
123+
# Unpacking...
91124
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
92125
- cd ${DISTDIR} || false
93-
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
94-
- rm -f cabal.project
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_js="$(find . -maxdepth 1 -type d -regex '.*/servant-js-[0-9.]*')"
129+
# Generate cabal.project
130+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
95131
- touch cabal.project
96-
- "printf 'packages: \"servant-js-*/*.cabal\"\\n' >> cabal.project"
97-
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
98-
- touch cabal.project.local
99-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(servant-js)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
132+
- |
133+
echo "packages: ${PKGDIR_servant_js}" >> cabal.project
134+
- |
135+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-js)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
100136
- cat cabal.project || true
101137
- cat cabal.project.local || true
138+
# Building...
102139
# this builds all libraries and executables (without tests/benchmarks)
103-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
104-
140+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
141+
# Building with tests and benchmarks...
105142
# build & run tests, build benchmarks
106-
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
107-
- if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi
108-
109-
# cabal check
110-
- (cd servant-js-* && ${CABAL} check)
111-
112-
# haddock
113-
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
114-
115-
# Build without installed constraints for packages in global-db
116-
- rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;
117-
143+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
144+
# Testing...
145+
- if [ $HCNUMVER -lt 80800 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
146+
# cabal check...
147+
- (cd ${PKGDIR_servant_js} && ${CABAL} -vnormal check)
148+
# haddock...
149+
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output
150+
# Building without installed constraints for packages in global-db...
151+
- rm -f cabal.project.local
152+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
118153
# Constraint sets
119154
- rm -rf cabal.project.local
120-
121155
# Constraint set servant-0.15
122-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant ==0.15.*' all
123-
156+
- if [ $HCNUMVER -lt 80800 ] ; then ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.15.*' all | color_cabal_output ; fi
124157
# Constraint set servant-0.16
125-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all
126-
158+
- if [ $HCNUMVER -lt 80800 ] ; then ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all | color_cabal_output ; fi
127159

128160
# REGENDATA ["--output",".travis.yml","--config=cabal.haskell-ci","servant-js.cabal"]
129161
# EOF

cabal.haskell-ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
branches: master
22

3+
-- language-ecmascript doesn't work with GHC-8.8
4+
tests: <8.8
5+
36
constraint-set servant-0.15
47
ghc: >= 8.0 && <8.8
58
constraints: servant ==0.15.*

servant-js.cabal

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: servant-js
22
version: 0.9.4
3-
x-revision: 1
3+
x-revision: 2
44

55
synopsis: Automatically derive javascript functions to query servant webservices.
66
category: Web, Servant
@@ -28,7 +28,8 @@ tested-with:
2828
GHC ==8.0.2
2929
|| ==8.2.2
3030
|| ==8.4.4
31-
|| ==8.6.3
31+
|| ==8.6.5
32+
|| ==8.8.1
3233

3334
extra-source-files:
3435
include/*.h
@@ -50,10 +51,10 @@ library
5051
Servant.JS.Internal
5152
Servant.JS.JQuery
5253
Servant.JS.Vanilla
53-
build-depends: base >= 4.9 && <4.13
54-
, base-compat >= 0.10.5 && <0.11
54+
build-depends: base >= 4.9 && <4.14
55+
, base-compat >= 0.10.5 && <0.12
5556
, charset >= 0.3.7.1 && <0.4
56-
, lens >= 4.17 && <4.18
57+
, lens >= 4.17 && <4.19
5758
, servant-foreign >= 0.15 && <0.16
5859
, servant >= 0.15 && <0.17
5960
, text >= 1.2.3.0 && < 1.3

0 commit comments

Comments
 (0)