Skip to content

Commit 89199ee

Browse files
committed
Merge pull request #194 from haskell/travis-8.0.2
Updated the travis file for 8.0.1
2 parents 7132c2e + d8afad3 commit 89199ee

File tree

3 files changed

+87
-48
lines changed

3 files changed

+87
-48
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ include/HsNetworkConfig.h
1515
include/HsNetworkConfig.h.in
1616
network.buildinfo
1717
cabal.sandbox.config
18+
.cabal-sandbox

.travis.yml

+85-48
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,102 @@
1-
# NB: don't set `language: haskell` here
2-
# See also https://github.com/hvr/multi-ghc-travis for more information
3-
1+
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
2+
language: c
43
sudo: false
4+
5+
cache:
6+
directories:
7+
- $HOME/.cabsnap
8+
- $HOME/.cabal/packages
9+
10+
before_cache:
11+
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
12+
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
13+
514
matrix:
615
include:
7-
# we have to use CABALVER=1.16 for GHC<7.8 as well, as there's
8-
# no package for earlier cabal versions in the PPA
9-
- env: GHCVER=7.0.4 CABALVER=1.16
10-
addons: {apt: {packages: [ghc-7.0.4,cabal-install-1.16], sources: [hvr-ghc]}}
11-
- env: GHCVER=7.4.2 CABALVER=1.16
12-
addons: {apt: {packages: [ghc-7.4.2,cabal-install-1.16], sources: [hvr-ghc]}}
13-
- env: GHCVER=7.6.3 CABALVER=1.16
14-
addons: {apt: {packages: [ghc-7.6.3,cabal-install-1.16], sources: [hvr-ghc]}}
15-
- env: GHCVER=7.8.4 CABALVER=1.18
16-
addons: {apt: {packages: [ghc-7.8.4,cabal-install-1.18], sources: [hvr-ghc]}}
17-
- env: GHCVER=7.10.2 CABALVER=1.22
18-
addons: {apt: {packages: [ghc-7.10.2,cabal-install-1.22], sources: [hvr-ghc]}}
19-
- env: GHCVER=head CABALVER=1.22
20-
addons: {apt: {packages: [ghc-head,cabal-install-1.22], sources: [hvr-ghc]}}
16+
- env: CABALVER=1.16 GHCVER=7.0.4
17+
compiler: ": #GHC 7.0.4"
18+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}}
19+
- env: CABALVER=1.16 GHCVER=7.4.2
20+
compiler: ": #GHC 7.4.2"
21+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
22+
- env: CABALVER=1.16 GHCVER=7.6.3
23+
compiler: ": #GHC 7.6.3"
24+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
25+
- env: CABALVER=1.18 GHCVER=7.8.4
26+
compiler: ": #GHC 7.8.4"
27+
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
28+
- env: CABALVER=1.22 GHCVER=7.10.1
29+
compiler: ": #GHC 7.10.1"
30+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
31+
- env: CABALVER=1.22 GHCVER=7.10.2
32+
compiler: ": #GHC 7.10.2"
33+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
34+
- env: CABALVER=1.24 GHCVER=8.0.1
35+
compiler: ": #GHC 8.0.1"
36+
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
37+
- env: CABALVER=1.24 GHCVER=head
38+
compiler: ": #GHC head"
39+
addons: {apt: {packages: [cabal-install-1.24,ghc-head], sources: [hvr-ghc]}}
2140
allow_failures:
22-
- env: GHCVER=7.0.4 CABALVER=1.16
23-
- env: GHCVER=7.4.2 CABALVER=1.16
24-
- env: GHCVER=head CABALVER=1.22
41+
- env: CABALVER=1.16 GHCVER=7.0.4
42+
- env: CABALVER=1.16 GHCVER=7.4.2
43+
- env: CABALVER=1.24 GHCVER=head
44+
2545

26-
# Note: the distinction between `before_install` and `install` is not
27-
# important.
2846
before_install:
47+
- unset CC
2948
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
30-
- cabal --version
3149

3250
install:
33-
- travis_retry cabal update
34-
- cabal install --only-dependencies --enable-tests --enable-benchmarks
35-
36-
# Here starts the actual work to be performed for the package under
37-
# test; any command which exits with a non-zero exit code causes the
38-
# build to fail.
39-
script:
40-
- autoreconf
51+
- cabal --version
52+
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
53+
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
54+
then
55+
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
56+
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
57+
fi
58+
- travis_retry cabal update -v
59+
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
60+
- cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
61+
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
4162

42-
# -v2 provides useful information for debugging
43-
- cabal configure --enable-tests --enable-benchmarks -v2
63+
# check whether current requested install-plan matches cached package-db snapshot
64+
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
65+
then
66+
echo "cabal build-cache HIT";
67+
rm -rfv .ghc;
68+
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
69+
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
70+
else
71+
echo "cabal build-cache MISS";
72+
rm -rf $HOME/.cabsnap;
73+
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
74+
cabal install --only-dependencies --enable-tests --enable-benchmarks;
75+
fi
4476

45-
# this builds all libraries and executables
46-
# (including tests/benchmarks)
47-
- cabal build
77+
# snapshot package-db on cache miss
78+
- if [ ! -d $HOME/.cabsnap ];
79+
then
80+
echo "snapshotting package-db to build-cache";
81+
mkdir $HOME/.cabsnap;
82+
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
83+
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
84+
fi
4885

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.
88+
script:
89+
- if [ -f configure.ac ]; then autoreconf -i; fi
90+
- cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
91+
- cabal build # this builds all libraries and executables (including tests/benchmarks)
4992
- cabal test
5093
- cabal check
94+
- cabal sdist # tests that a source-distribution can be generated
5195

52-
# tests that a source-distribution can be generated
53-
- cabal sdist
54-
55-
# check that the generated source-distribution can be built & installed
56-
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
57-
cd dist/;
58-
if [ -f "$SRC_TGZ" ]; then
59-
cabal install "$SRC_TGZ";
60-
else
61-
echo "expected '$SRC_TGZ' not found";
62-
exit 1;
63-
fi
96+
# Check that the resulting source distribution can be built & installed.
97+
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
98+
# `cabal install --force-reinstalls dist/*-*.tar.gz`
99+
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
100+
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
64101

65102
# EOF

network.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ extra-source-files:
4141
cbits/winSockErr.c
4242
homepage: https://github.com/haskell/network
4343
bug-reports: https://github.com/haskell/network/issues
44+
tested-with: GHC == 7.0.4, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1, GHC == 7.10.2, GHC == 8.0.1
4445

4546
library
4647
exposed-modules:

0 commit comments

Comments
 (0)