Skip to content

Commit fdf167e

Browse files
phadejhvr
authored andcommitted
Allow base-4.14, regenerate .travis.yml
Add a type signature in tests to make them compile also with GHC-8.10.1
1 parent 37b02ff commit fdf167e

File tree

3 files changed

+125
-87
lines changed

3 files changed

+125
-87
lines changed

.travis.yml

Lines changed: 120 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
7-
# version: 0.3
7+
# version: 0.9.20200325
88
#
9+
version: ~> 1.0
910
language: c
11+
os: linux
1012
dist: xenial
11-
1213
git:
13-
submodules: false # whether to recursively clone submodules
14-
14+
# whether to recursively clone submodules
15+
submodules: false
1516
notifications:
1617
irc:
1718
channels:
18-
- "irc.freenode.org#hackage"
19+
- irc.freenode.org#hackage
1920
skip_join: true
2021
template:
2122
- "\x0313zlib\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"
22-
2323
cache:
2424
directories:
2525
- $HOME/.cabal/packages
2626
- $HOME/.cabal/store
27-
27+
- $HOME/.hlint
2828
before_cache:
2929
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
3030
# remove files that are regenerated by 'cabal update'
@@ -33,105 +33,141 @@ before_cache:
3333
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
3434
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
3535
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
36-
3736
- rm -rfv $CABALHOME/packages/head.hackage
38-
39-
matrix:
37+
jobs:
4038
include:
41-
- compiler: "ghc-8.6.4"
42-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4,zlib1g-dev], sources: [hvr-ghc]}}
43-
- compiler: "ghc-8.4.4"
44-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4,zlib1g-dev], sources: [hvr-ghc]}}
45-
- compiler: "ghc-8.2.2"
46-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2,zlib1g-dev], sources: [hvr-ghc]}}
47-
- compiler: "ghc-8.0.2"
48-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2,zlib1g-dev], sources: [hvr-ghc]}}
49-
- compiler: "ghc-8.0.1"
50-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.1,zlib1g-dev], sources: [hvr-ghc]}}
51-
- compiler: "ghc-7.10.3"
52-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3,zlib1g-dev], sources: [hvr-ghc]}}
53-
- compiler: "ghc-7.8.4"
54-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4,zlib1g-dev], sources: [hvr-ghc]}}
55-
- compiler: "ghc-7.6.3"
56-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3,zlib1g-dev], sources: [hvr-ghc]}}
57-
- compiler: "ghc-7.4.2"
58-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2,zlib1g-dev], sources: [hvr-ghc]}}
59-
- compiler: "ghc-7.2.2"
60-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.2.2,zlib1g-dev], sources: [hvr-ghc]}}
61-
- compiler: "ghc-7.0.4"
62-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.4,zlib1g-dev], sources: [hvr-ghc]}}
63-
39+
- compiler: ghc-8.10.1
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.10.1","cabal-install-3.2","zlib1g-dev"]}}
41+
os: linux
42+
- compiler: ghc-8.8.3
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.8.3","cabal-install-3.0","zlib1g-dev"]}}
44+
os: linux
45+
- compiler: ghc-8.6.5
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.6.5","cabal-install-3.0","zlib1g-dev"]}}
47+
os: linux
48+
- compiler: ghc-8.4.4
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.4.4","cabal-install-3.0","zlib1g-dev"]}}
50+
os: linux
51+
- compiler: ghc-8.2.2
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.2.2","cabal-install-3.0","zlib1g-dev"]}}
53+
os: linux
54+
- compiler: ghc-8.0.2
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-8.0.2","cabal-install-3.0","zlib1g-dev"]}}
56+
os: linux
57+
- compiler: ghc-8.0.1
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-8.0.1","cabal-install-3.0","zlib1g-dev"]}}
59+
os: linux
60+
- compiler: ghc-7.10.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.10.3","cabal-install-3.0","zlib1g-dev"]}}
62+
os: linux
63+
- compiler: ghc-7.8.4
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.8.4","cabal-install-3.0","zlib1g-dev"]}}
65+
os: linux
66+
- compiler: ghc-7.6.3
67+
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.0","zlib1g-dev"]}}
68+
os: linux
69+
- compiler: ghc-7.4.2
70+
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.0","zlib1g-dev"]}}
71+
os: linux
72+
- compiler: ghc-7.2.2
73+
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.2.2","cabal-install-3.0","zlib1g-dev"]}}
74+
os: linux
75+
- compiler: ghc-7.0.4
76+
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.0.4","cabal-install-3.0","zlib1g-dev"]}}
77+
os: linux
6478
before_install:
65-
- HC=/opt/ghc/bin/${CC}
66-
- HCPKG=${HC/ghc/ghc-pkg}
79+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
80+
- WITHCOMPILER="-w $HC"
81+
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
82+
- HCPKG="$HC-pkg"
6783
- unset CC
6884
- CABAL=/opt/ghc/bin/cabal
6985
- CABALHOME=$HOME/.cabal
7086
- export PATH="$CABALHOME/bin:$PATH"
71-
- ROOTDIR=$(pwd)
72-
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
87+
- TOP=$(pwd)
88+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
7389
- echo $HCNUMVER
74-
75-
install:
76-
- ${CABAL} --version
77-
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
90+
- CABAL="$CABAL -vnormal+nowrap"
91+
- set -o pipefail
7892
- TEST=--enable-tests
7993
- if [ $HCNUMVER -lt 70400 ] ; then TEST=--disable-tests ; fi
8094
- BENCH=--enable-benchmarks
81-
- GHCHEAD=${GHCHEAD-false}
82-
- travis_retry ${CABAL} update -v
83-
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
84-
- rm -fv cabal.project cabal.project.local
85-
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
86-
- rm -f cabal.project
95+
- HEADHACKAGE=false
96+
- rm -f $CABALHOME/config
97+
- |
98+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
99+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
100+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
101+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
102+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
103+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
104+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
105+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
106+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
107+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
108+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
109+
echo "install-dirs user" >> $CABALHOME/config
110+
echo " prefix: $CABALHOME" >> $CABALHOME/config
111+
echo "repository hackage.haskell.org" >> $CABALHOME/config
112+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
113+
install:
114+
- ${CABAL} --version
115+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
116+
- |
117+
echo "program-default-options" >> $CABALHOME/config
118+
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
119+
- cat $CABALHOME/config
120+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
121+
- travis_retry ${CABAL} v2-update -v
122+
# Generate cabal.project
123+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
87124
- touch cabal.project
88-
- "printf 'packages: \".\"\\n' >> cabal.project"
89-
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
90-
- touch cabal.project.local
91-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(zlib)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
125+
- |
126+
echo "packages: ." >> cabal.project
127+
- |
128+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(zlib)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
92129
- cat cabal.project || true
93130
- cat cabal.project.local || true
94131
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
95-
- rm -f cabal.project.freeze
96-
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
97-
- "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
98-
- rm "cabal.project.freeze"
99-
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
100-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
101-
- rm -rf .ghc.environment.* "."/dist
102-
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
103-
104-
# Here starts the actual work to be performed for the package under test;
105-
# any command which exits with a non-zero exit code causes the build to fail.
132+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
133+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
134+
- rm cabal.project.freeze
135+
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
136+
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
106137
script:
107-
# test that source-distributions can be generated
108-
- ${CABAL} new-sdist all
138+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
139+
# Packaging...
140+
- ${CABAL} v2-sdist all
141+
# Unpacking...
109142
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
110143
- cd ${DISTDIR} || false
111-
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
112-
- rm -f cabal.project
144+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
145+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
146+
- PKGDIR_zlib="$(find . -maxdepth 1 -type d -regex '.*/zlib-[0-9.]*')"
147+
# Generate cabal.project
148+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
113149
- touch cabal.project
114-
- "printf 'packages: \"zlib-*/*.cabal\"\\n' >> cabal.project"
115-
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
116-
- touch cabal.project.local
117-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(zlib)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
150+
- |
151+
echo "packages: ${PKGDIR_zlib}" >> cabal.project
152+
- |
153+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(zlib)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
118154
- cat cabal.project || true
119155
- cat cabal.project.local || true
156+
# Building...
120157
# this builds all libraries and executables (without tests/benchmarks)
121-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
122-
158+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
159+
# Building with tests and benchmarks...
123160
# build & run tests, build benchmarks
124-
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
125-
- if [ $HCNUMVER -ge 70400 ] ; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all ; fi
126-
127-
# cabal check
128-
- (cd zlib-* && ${CABAL} check)
129-
130-
# haddock
131-
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
132-
133-
# Build without installed constraints for packages in global-db
134-
- rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;
161+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
162+
# Testing...
163+
- if [ $HCNUMVER -ge 70400 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all ; fi
164+
# cabal check...
165+
- (cd ${PKGDIR_zlib} && ${CABAL} -vnormal check)
166+
# haddock...
167+
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
168+
# Building without installed constraints for packages in global-db...
169+
- rm -f cabal.project.local
170+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
135171

136-
# REGENDATA ["-o",".travis.yml","--irc-channels=irc.freenode.org#hackage","zlib.cabal","--apt=zlib1g-dev","--tests-jobs=>=7.4"]
172+
# REGENDATA ("0.9.20200325",["-o",".travis.yml","--irc-channels=irc.freenode.org#hackage","zlib.cabal","--apt=zlib1g-dev","--tests-jobs=>=7.4"])
137173
# EOF

test/Test.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-# LANGUAGE CPP #-}
2-
2+
{-# LANGUAGE RankNTypes #-}
33
module Main where
44

55
import Codec.Compression.Zlib.Internal
@@ -17,6 +17,7 @@ import Test.Tasty.HUnit
1717
import Utils ()
1818

1919
import Control.Monad
20+
import Control.Monad.ST.Lazy (ST)
2021
import Control.Exception
2122
import qualified Data.ByteString.Char8 as BS.Char8
2223
import qualified Data.ByteString.Lazy as BL
@@ -129,6 +130,7 @@ prop_truncated format =
129130
where
130131
comp = compress format defaultCompressParams
131132
decomp = decompressST format defaultDecompressParams
133+
truncated :: (forall s. DecompressStream (ST s)) -> BL.ByteString -> Bool
132134
truncated = foldDecompressStreamWithInput (\_ r -> r) (\_ -> False)
133135
(\err -> case err of TruncatedInput -> True; _ -> False)
134136

zlib.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ description: This package provides a pure interface for compressing and
2121
tasks and for the few cases where more control is needed it
2222
provides access to the full zlib feature set.
2323
build-type: Simple
24-
tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3, GHC ==8.0.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.4, GHC==8.6.4
24+
tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3, GHC ==8.0.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.4, GHC==8.6.5, GHC==8.8.3, GHC==8.10.1
2525

2626
extra-source-files: changelog
2727
-- zlib C sources (for Windows)
@@ -68,7 +68,7 @@ library
6868
other-extensions: DeriveGeneric
6969
if impl(ghc >= 7.6)
7070
other-extensions: CApiFFI
71-
build-depends: base >= 4 && < 4.14,
71+
build-depends: base >= 4 && < 4.15,
7272
bytestring >= 0.9 && < 0.11
7373
if impl(ghc >= 7.2 && < 7.6)
7474
build-depends: ghc-prim

0 commit comments

Comments
 (0)