Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit e4b8456

Browse files
committed
Update Travis-CI build instructions.
- Update ghc-8.6.x o version 8.6.3 and ghc-8.4.x to version 8.4.4 - We don't use installed constraints, so we don't need a separate build step that builds without them. - Use latest make-travis-yml generator and drop the container-based build environment. Closes #10. - Enable install-examples flag to make sure the examples get built. - Fix failing doctests with cabal-install 2.4.1.x.
1 parent ee578da commit e4b8456

File tree

2 files changed

+40
-46
lines changed

2 files changed

+40
-46
lines changed

.travis.yml

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# runghc make_travis_yml_2.hs '--no-installed' '--doctest' '--hlint' '-o' '.travis.yml' 'hackage-db.cabal'
3+
# runghc make_travis_yml_2.hs '--doctest' '--hlint' '-o' '.travis.yml' 'hackage-db.cabal' '--no-unconstrained'
44
#
5-
# For more information, see https://github.com/hvr/multi-ghc-travis
5+
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
77
language: c
8-
sudo: false
98

109
git:
1110
submodules: false # whether to recursively clone submodules
@@ -28,27 +27,27 @@ before_cache:
2827

2928
matrix:
3029
include:
31-
- compiler: "ghc-7.6.3"
30+
- compiler: "ghc-8.6.3"
3231
# env: TEST=--disable-tests BENCH=--disable-benchmarks
33-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3], sources: [hvr-ghc]}}
34-
- compiler: "ghc-7.8.4"
32+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
33+
- compiler: "ghc-8.4.4"
3534
# env: TEST=--disable-tests BENCH=--disable-benchmarks
36-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
37-
- compiler: "ghc-7.10.3"
35+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
36+
- compiler: "ghc-8.2.2"
3837
# env: TEST=--disable-tests BENCH=--disable-benchmarks
39-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
38+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
4039
- compiler: "ghc-8.0.2"
4140
# env: TEST=--disable-tests BENCH=--disable-benchmarks
42-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
43-
- compiler: "ghc-8.2.2"
41+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
42+
- compiler: "ghc-7.10.3"
4443
# env: TEST=--disable-tests BENCH=--disable-benchmarks
45-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
46-
- compiler: "ghc-8.4.1"
47-
env: GHCHEAD=true
48-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
49-
50-
allow_failures:
51-
- compiler: "ghc-8.4.1"
44+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
45+
- compiler: "ghc-7.8.4"
46+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
47+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}}
48+
- compiler: "ghc-7.6.3"
49+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
50+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3], sources: [hvr-ghc]}}
5251

5352
before_install:
5453
- HC=${CC}
@@ -66,31 +65,23 @@ install:
6665
- BENCH=${BENCH---enable-benchmarks}
6766
- TEST=${TEST---enable-tests}
6867
- HADDOCK=${HADDOCK-true}
69-
- INSTALLED=${INSTALLED-true}
68+
- UNCONSTRAINED=${UNCONSTRAINED-true}
69+
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-true}
7070
- GHCHEAD=${GHCHEAD-false}
7171
- travis_retry cabal update -v
7272
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
7373
- rm -fv cabal.project cabal.project.local
74-
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
75-
- |
76-
if $GHCHEAD; then
77-
sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
78-
79-
echo 'repository head.hackage' >> ${HOME}/.cabal/config
80-
echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
81-
echo ' secure: True' >> ${HOME}/.cabal/config
82-
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
83-
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
84-
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
85-
echo ' key-threshold: 3' >> ${HOME}/.cabal.config
86-
87-
cabal new-update head.hackage -v
88-
fi
8974
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
90-
- if [ $HCNUMVER -ge 80000 ]; then cabal new-install -w ${HC} --symlink-bindir=$HOME/.local/bin doctest --constraint='doctest ==0.13.*'; fi
91-
- if [ $HCNUMVER -eq 80202 ]; then cabal new-install -w ${HC} --symlink-bindir=$HOME/.local/bin hlint --constraint='hlint ==2.0.*'; fi
75+
- (cd /tmp && echo '' | cabal new-repl -w ${HC} --build-dep fail)
76+
- if [ $HCNUMVER -ge 80000 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin doctest --constraint='doctest ==0.16.*'; fi
77+
- if [ $HCNUMVER -eq 80603 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin hlint --constraint='hlint ==2.1.*'; fi
9278
- "printf 'packages: \".\"\\n' > cabal.project"
93-
- cat cabal.project
79+
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
80+
- "printf 'package hackage-db\\n flags: +install-examples\\n' >> cabal.project"
81+
- touch cabal.project.local
82+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- hackage-db | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
83+
- cat cabal.project || true
84+
- cat cabal.project.local || true
9485
- if [ -f "./configure.ac" ]; then
9586
(cd "." && autoreconf -i);
9687
fi
@@ -104,31 +95,34 @@ install:
10495
# any command which exits with a non-zero exit code causes the build to fail.
10596
script:
10697
# test that source-distributions can be generated
107-
- (cd "." && cabal sdist)
108-
- mv "."/dist/hackage-db-*.tar.gz ${DISTDIR}/
98+
- cabal new-sdist all
99+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
109100
- cd ${DISTDIR} || false
110101
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
111102
- "printf 'packages: hackage-db-*/*.cabal\\n' > cabal.project"
112-
- cat cabal.project
103+
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
104+
- "printf 'package hackage-db\\n flags: +install-examples\\n' >> cabal.project"
105+
- touch cabal.project.local
106+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- hackage-db | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
107+
- cat cabal.project || true
108+
- cat cabal.project.local || true
113109
# this builds all libraries and executables (without tests/benchmarks)
114110
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
115111

116-
117112
# build & run tests, build benchmarks
118113
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
119114

120115
# doctest
121116
- if [ $HCNUMVER -ge 80000 ]; then (cd hackage-db-* && doctest src); fi
122117

123118
# hlint
124-
- if [ $HCNUMVER -eq 80202 ]; then (cd hackage-db-* && hlint src); fi
119+
- if [ $HCNUMVER -eq 80603 ]; then (cd hackage-db-* && hlint src); fi
125120

126121
# cabal check
127122
- (cd hackage-db-* && cabal check)
128123

129124
# haddock
130-
- rm -rf ./dist-newstyle
131125
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
132126

133-
# REGENDATA ["--no-installed","--doctest","--hlint","-o",".travis.yml","hackage-db.cabal"]
127+
# REGENDATA ["--doctest","--hlint","-o",".travis.yml","hackage-db.cabal","--no-unconstrained"]
134128
# EOF

hackage-db.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ category: Distribution
1010
synopsis: Access cabal-install's Hackage database via Data.Map
1111
cabal-version: >= 1.10
1212
build-type: Simple
13-
tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3
14-
, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
13+
tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2
14+
, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.3
1515

1616
description:
1717
This library provides convenient access to the local copy of the Hackage

0 commit comments

Comments
 (0)