Skip to content

Commit 2576a99

Browse files
authored
Merge pull request #20 from snapframework/ghc810
Allow GHC 8.10
2 parents 6370f90 + 7fb3372 commit 2576a99

File tree

2 files changed

+137
-100
lines changed

2 files changed

+137
-100
lines changed

.travis.yml

Lines changed: 134 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,164 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# runghc make_travis_yml_2.hs 'io-streams-haproxy.cabal'
3+
# haskell-ci 'io-streams-haproxy.cabal'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
48
#
59
# For more information, see https://github.com/haskell-CI/haskell-ci
610
#
11+
# version: 0.10.1
12+
#
13+
version: ~> 1.0
714
language: c
8-
sudo: false
9-
15+
os: linux
16+
dist: xenial
1017
git:
11-
submodules: false # whether to recursively clone submodules
12-
18+
# whether to recursively clone submodules
19+
submodules: false
1320
cache:
1421
directories:
1522
- $HOME/.cabal/packages
1623
- $HOME/.cabal/store
17-
24+
- $HOME/.hlint
1825
before_cache:
19-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
26+
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2027
# remove files that are regenerated by 'cabal update'
21-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
26-
27-
- rm -rfv $HOME/.cabal/packages/head.hackage
28-
29-
matrix:
28+
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
29+
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
30+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
31+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
32+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
33+
- rm -rfv $CABALHOME/packages/head.hackage
34+
jobs:
3035
include:
31-
- compiler: "ghc-8.8.1"
32-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-3.0,ghc-8.8.1], sources: [hvr-ghc]}}
33-
- compiler: "ghc-8.6.1"
34-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
35-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
36-
- compiler: "ghc-8.4.3"
37-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
38-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.3], sources: [hvr-ghc]}}
39-
- compiler: "ghc-8.2.1"
40-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
41-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.1], sources: [hvr-ghc]}}
42-
- compiler: "ghc-8.0.1"
43-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
44-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.1], sources: [hvr-ghc]}}
45-
- compiler: "ghc-7.10.3"
46-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
47-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
48-
- compiler: "ghc-7.8.4"
49-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
50-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}}
51-
- compiler: "ghc-7.6.3"
52-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
53-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3], sources: [hvr-ghc]}}
54-
- compiler: "ghc-7.4.2"
55-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
56-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2], sources: [hvr-ghc]}}
57-
36+
- compiler: ghc-8.10.1
37+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.1","cabal-install-3.2"]}}
38+
os: linux
39+
- compiler: ghc-8.8.3
40+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.3","cabal-install-3.2"]}}
41+
os: linux
42+
- compiler: ghc-8.6.1
43+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.1","cabal-install-3.2"]}}
44+
os: linux
45+
- compiler: ghc-8.4.3
46+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.3","cabal-install-3.2"]}}
47+
os: linux
48+
- compiler: ghc-8.2.1
49+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.1","cabal-install-3.2"]}}
50+
os: linux
51+
- compiler: ghc-8.0.1
52+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.1","cabal-install-3.2"]}}
53+
os: linux
54+
- compiler: ghc-7.10.3
55+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.10.3","cabal-install-3.2"]}}
56+
os: linux
57+
- compiler: ghc-7.8.4
58+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.8.4","cabal-install-3.2"]}}
59+
os: linux
60+
- compiler: ghc-7.6.3
61+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.6.3","cabal-install-3.2"]}}
62+
os: linux
63+
- compiler: ghc-7.4.2
64+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.4.2","cabal-install-3.2"]}}
65+
os: linux
5866
before_install:
59-
- HC=${CC}
60-
- HCPKG=${HC/ghc/ghc-pkg}
67+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
68+
- WITHCOMPILER="-w $HC"
69+
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
70+
- HCPKG="$HC-pkg"
6171
- unset CC
62-
- ROOTDIR=$(pwd)
63-
- mkdir -p $HOME/.local/bin
64-
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
65-
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
72+
- CABAL=/opt/ghc/bin/cabal
73+
- CABALHOME=$HOME/.cabal
74+
- export PATH="$CABALHOME/bin:$PATH"
75+
- TOP=$(pwd)
76+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
6677
- echo $HCNUMVER
67-
78+
- CABAL="$CABAL -vnormal+nowrap"
79+
- set -o pipefail
80+
- TEST=--enable-tests
81+
- BENCH=--enable-benchmarks
82+
- HEADHACKAGE=false
83+
- rm -f $CABALHOME/config
84+
- |
85+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
86+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
87+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
88+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
89+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
90+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
91+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
92+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
93+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
94+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
95+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
96+
echo "install-dirs user" >> $CABALHOME/config
97+
echo " prefix: $CABALHOME" >> $CABALHOME/config
98+
echo "repository hackage.haskell.org" >> $CABALHOME/config
99+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
68100
install:
69-
- cabal --version
101+
- ${CABAL} --version
70102
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
71-
- BENCH=${BENCH---enable-benchmarks}
72-
- TEST=${TEST---enable-tests}
73-
- HADDOCK=${HADDOCK-true}
74-
- UNCONSTRAINED=${UNCONSTRAINED-true}
75-
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
76-
- GHCHEAD=${GHCHEAD-false}
77-
- travis_retry cabal update -v
78-
- cabal outdated --exit-code
79-
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
80-
- rm -fv cabal.project cabal.project.local
81-
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
82-
- "printf 'packages: \".\"\\n' > cabal.project"
83-
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
84-
- touch cabal.project.local
85-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- io-streams-haproxy | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
103+
- |
104+
echo "program-default-options" >> $CABALHOME/config
105+
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
106+
- cat $CABALHOME/config
107+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
108+
- travis_retry ${CABAL} v2-update -v
109+
# Generate cabal.project
110+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
111+
- touch cabal.project
112+
- |
113+
echo "packages: ." >> cabal.project
114+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package io-streams-haproxy' >> cabal.project ; fi
115+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
116+
- |
117+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(io-streams-haproxy)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
86118
- cat cabal.project || true
87119
- cat cabal.project.local || true
88-
- if [ -f "./configure.ac" ]; then
89-
(cd "." && autoreconf -i);
90-
fi
91-
- rm -f cabal.project.freeze
92-
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
93-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
94-
- rm -rf .ghc.environment.* "."/dist
95-
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
96-
97-
# Here starts the actual work to be performed for the package under test;
98-
# any command which exits with a non-zero exit code causes the build to fail.
120+
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
121+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
122+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
123+
- rm cabal.project.freeze
124+
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
125+
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
99126
script:
100-
# test that source-distributions can be generated
101-
- cabal new-sdist all
127+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
128+
# Packaging...
129+
- ${CABAL} v2-sdist all
130+
# Unpacking...
102131
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
103132
- cd ${DISTDIR} || false
104-
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
105-
- "printf 'packages: io-streams-haproxy-*/*.cabal\\n' > cabal.project"
106-
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
107-
- touch cabal.project.local
108-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- io-streams-haproxy | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
133+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
134+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
135+
- PKGDIR_io_streams_haproxy="$(find . -maxdepth 1 -type d -regex '.*/io-streams-haproxy-[0-9.]*')"
136+
# Generate cabal.project
137+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
138+
- touch cabal.project
139+
- |
140+
echo "packages: ${PKGDIR_io_streams_haproxy}" >> cabal.project
141+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package io-streams-haproxy' >> cabal.project ; fi
142+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
143+
- |
144+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(io-streams-haproxy)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
109145
- cat cabal.project || true
110146
- cat cabal.project.local || true
147+
# Building...
111148
# this builds all libraries and executables (without tests/benchmarks)
112-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
113-
149+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
150+
# Building with tests and benchmarks...
114151
# build & run tests, build benchmarks
115-
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
116-
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
117-
118-
# cabal check
119-
- (cd io-streams-haproxy-* && cabal check)
120-
121-
# haddock
122-
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
123-
124-
# Build without installed constraints for packages in global-db
125-
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
152+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
153+
# Testing...
154+
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
155+
# cabal check...
156+
- (cd ${PKGDIR_io_streams_haproxy} && ${CABAL} -vnormal check)
157+
# haddock...
158+
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
159+
# Building without installed constraints for packages in global-db...
160+
- rm -f cabal.project.local
161+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
126162

127-
# REGENDATA ["io-streams-haproxy.cabal"]
163+
# REGENDATA ("0.10.1",["io-streams-haproxy.cabal"])
128164
# EOF

io-streams-haproxy.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ extra-source-files:
2323
cabal-version: >=1.10
2424
Bug-Reports: https://github.com/snapframework/io-streams-haproxy/issues
2525
Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3,
26-
GHC == 8.0.1, GHC == 8.2.1, GHC == 8.4.3, GHC == 8.6.1, GHC == 8.8.1
26+
GHC == 8.0.1, GHC == 8.2.1, GHC == 8.4.3, GHC == 8.6.1,
27+
GHC == 8.8.3, GHC == 8.10.1
2728

2829
source-repository head
2930
type: git
@@ -35,7 +36,7 @@ library
3536
other-modules: System.IO.Streams.Network.Internal.Address
3637
c-sources: cbits/byteorder.c
3738

38-
build-depends: base >= 4.5 && < 4.14,
39+
build-depends: base >= 4.5 && < 4.15,
3940
attoparsec >= 0.7 && < 0.14,
4041
bytestring >= 0.9 && < 0.11,
4142
io-streams >= 1.3 && < 1.6,

0 commit comments

Comments
 (0)