Skip to content

Commit c6259c8

Browse files
Merge pull request #336 from reflex-frp/phadej-haskell-ci
* phadej's haskell-ci setup * Some refactoring for hlint * Bump to v0.6.2.2 * Update version bounds * Add flag to decide if to use the new split-these package
2 parents eeeae5f + bf8a772 commit c6259c8

File tree

34 files changed

+319
-101
lines changed

34 files changed

+319
-101
lines changed

.travis.yml

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# This Travis job script has been generated by a script via
2+
#
3+
# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
4+
#
5+
# For more information, see https://github.com/haskell-CI/haskell-ci
6+
#
7+
# version: 0.3.20190804.2
8+
#
9+
language: c
10+
dist: xenial
11+
sudo: required
12+
git:
13+
# whether to recursively clone submodules
14+
submodules: false
15+
cache:
16+
directories:
17+
- $HOME/.cabal/packages
18+
- $HOME/.cabal/store
19+
before_cache:
20+
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
21+
# remove files that are regenerated by 'cabal update'
22+
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
23+
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
24+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
25+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
26+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
27+
- rm -rfv $CABALHOME/packages/head.hackage
28+
29+
matrix:
30+
include:
31+
- compiler: ghcjs-8.4
32+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
33+
env: GHCJS_PACKAGE="ghcjs-8.4"
34+
- compiler: ghc-8.6.5
35+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
36+
- compiler: ghc-8.4.4
37+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
38+
- compiler: ghc-8.2.2
39+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
40+
- compiler: ghc-8.0.2
41+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
42+
allow_failures:
43+
- compiler: "ghcjs-8.4" # This hits the travis 50min time limit and fails
44+
45+
before_install:
46+
- |
47+
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ ! -z "$GHCJS_PACKAGE" ]; then
48+
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -;
49+
sudo sh -c "echo deb https://deb.nodesource.com/node_8.x xenial main > /etc/apt/sources.list.d/nodesource.list";
50+
sudo add-apt-repository -y ppa:hvr/ghcjs;
51+
sudo apt-get update;
52+
sudo apt-get install nodejs;
53+
sudo apt-get install "$GHCJS_PACKAGE";
54+
fi
55+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
56+
- WITHCOMPILER="-w $HC"
57+
- |
58+
if echo $CC | grep -q ghcjs; then
59+
GHCJS=true
60+
HC=${HC}js
61+
WITHCOMPILER="--ghcjs ${WITHCOMPILER}js"
62+
else
63+
GHCJS=false;
64+
fi
65+
- if $GHCJS ; then sudo apt-get install -y ghc-8.6.5 ; fi
66+
- if $GHCJS ; then PATH="/opt/ghc/8.6.5/bin:$PATH" ; fi
67+
- HCPKG="$HC-pkg"
68+
- unset CC
69+
- CABAL=/opt/ghc/bin/cabal
70+
- CABALHOME=$HOME/.cabal
71+
- export PATH="$CABALHOME/bin:$PATH"
72+
- TOP=$(pwd)
73+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
74+
- echo $HCNUMVER
75+
- CABAL="$CABAL -vnormal+nowrap+markoutput"
76+
- set -o pipefail
77+
- |
78+
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
79+
echo 'BEGIN { state = "output"; }' >> .colorful.awk
80+
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
81+
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
82+
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
83+
echo ' if (state == "cabal") {' >> .colorful.awk
84+
echo ' print blue($0)' >> .colorful.awk
85+
echo ' } else {' >> .colorful.awk
86+
echo ' print $0' >> .colorful.awk
87+
echo ' }' >> .colorful.awk
88+
echo '}' >> .colorful.awk
89+
- cat .colorful.awk
90+
- |
91+
color_cabal_output () {
92+
awk -f $TOP/.colorful.awk
93+
}
94+
- echo text | color_cabal_output
95+
install:
96+
- ${CABAL} --version
97+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
98+
- node --version
99+
- echo $GHCJS
100+
- TEST=--enable-tests
101+
- BENCH=--enable-benchmarks
102+
- HEADHACKAGE=false
103+
- rm -f $CABALHOME/config
104+
- |
105+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
106+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
107+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
108+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
109+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
110+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
111+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
112+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
113+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
114+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
115+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
116+
echo "install-dirs user" >> $CABALHOME/config
117+
echo " prefix: $CABALHOME" >> $CABALHOME/config
118+
echo "repository hackage.haskell.org" >> $CABALHOME/config
119+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
120+
- cat $CABALHOME/config
121+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
122+
- travis_retry ${CABAL} v2-update -v
123+
- if $GHCJS ; then (cd /tmp && ${CABAL} v2-install -w ghc-8.6.5 happy) ; fi
124+
# Generate cabal.project
125+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
126+
- touch cabal.project
127+
- |
128+
echo "packages: ." >> cabal.project
129+
- cat cabal.project || true
130+
- cat cabal.project.local || true
131+
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
132+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
133+
- ${CABAL} v2-configure $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
134+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
135+
- rm cabal.project.freeze || true
136+
- rm cabal.project.local || true
137+
script:
138+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
139+
# Packaging...
140+
- ${CABAL} v2-sdist all | color_cabal_output
141+
# Unpacking...
142+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
143+
- cd ${DISTDIR} || false
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_reflex="$(find . -maxdepth 1 -type d -regex '.*/reflex-[0-9.]*')"
147+
# Generate cabal.project
148+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
149+
- touch cabal.project
150+
- |
151+
echo "packages: ${PKGDIR_reflex}" >> cabal.project
152+
- |
153+
- cat cabal.project || true
154+
- cat cabal.project.local || true
155+
- rm cabal.project.local || true
156+
# Building...
157+
# this builds all libraries and executables (without tests/benchmarks)
158+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
159+
# Building with tests and benchmarks...
160+
# build & run tests, build benchmarks
161+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
162+
# Testing...
163+
- if ! $GHCJS && [ $HCNUMVER -ge 80000 ] && [ $HCNUMVER -lt 80606 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
164+
# cabal check...
165+
- (cd ${PKGDIR_reflex} && ${CABAL} -vnormal check)
166+
# haddock...
167+
- if ! $GHCJS && [ $HCNUMVER -ge 80000 ] && [ $HCNUMVER -lt 80606 ] ; then ${CABAL} v2-haddock $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
168+
# Building without installed constraints for packages in global-db...
169+
- rm -f cabal.project.local || true
170+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
171+
# Constraint sets
172+
- rm -rf cabal.project.local || true
173+
# Constraint set no-th
174+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -use-template-haskell' all | color_cabal_output
175+
# Constraint sets
176+
- rm -rf cabal.project.local || true
177+
# Constraint set don't use split these/semialign
178+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -split-these' all | color_cabal_output
179+
180+
# REGENDATA ["--config=cabal.haskell-ci","cabal.project"]
181+
# EOF
182+

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Revision history for reflex
22

3+
## 0.6.2.2
4+
5+
* Support these >= 1. Add `split-these` flag to control whether to use new these/semialign combination or not.
6+
* Update version bounds to fix some CI failures
7+
* Add travis CI configuration
8+
39
## 0.6.2.1
410

511
* Generalize `fan` to `fanG` to take a `DMap` with non-`Identity`

cabal.haskell-ci

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
distribution: xenial
2+
3+
-- https://github.com/haskell/cabal/issues/6106
4+
install-dependencies: False
5+
benchmarks: False
6+
7+
constraint-set no-th
8+
constraints: reflex -use-template-haskell

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: .

default.nix

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
, transformers-compat, unbounded-delays, prim-uniq
88
, data-default, filepath, directory, filemanip, ghcjs-base
99
, monoidal-containers, witherable
10+
, semialign ? null, splitThese ? (semialign != null)
1011
, useTemplateHaskell ? true
1112
}:
1213
mkDerivation {
1314
pname = "reflex";
14-
version = "0.6.2.1";
15+
version = "0.6.2.2";
1516
src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
1617
libraryHaskellDepends = [
1718
base bifunctors containers dependent-map dependent-sum
@@ -27,13 +28,15 @@ mkDerivation {
2728
ghcjs-base
2829
] else []) ++ (if !useTemplateHaskell then [] else [
2930
haskell-src-exts haskell-src-meta
30-
]);
31+
]) ++ (if splitThese then [
32+
semialign
33+
] else []);
3134
testHaskellDepends = if ghc.isGhcjs or false then [] else [
3235
hlint filepath directory filemanip
3336
];
34-
configureFlags = if useTemplateHaskell then [] else [
35-
"-f-use-template-haskell"
36-
];
37+
configureFlags =
38+
stdenv.lib.optional (!useTemplateHaskell) [ "-f-use-template-haskell" ] ++
39+
stdenv.lib.optional (!splitThese) [ "-f-split-these" ];
3740
homepage = "https://github.com/reflex-frp/reflex";
3841
description = "Higher-order Functional Reactive Programming";
3942
license = stdenv.lib.licenses.bsd3;

0 commit comments

Comments
 (0)