Skip to content

Commit ce35032

Browse files
committed
Use GHC.Generics, drop generics-sop and MemoTrie, GPLd
1 parent 97541f9 commit ce35032

File tree

11 files changed

+630
-174
lines changed

11 files changed

+630
-174
lines changed

.travis.yml

+62-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# haskell-ci '--doctest' '--doctest-options' '--fast -D__DOCTEST__' '--output' '.travis.yml' '--branches' 'master' 'tree-diff.cabal'
3+
# haskell-ci '--doctest' '--doctest-options' '--fast -D__DOCTEST__' '--output' '.travis.yml' '--branches' 'master' '--tests-jobs=>=7.6' 'tree-diff.cabal'
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
7-
# version: 0.3.20190325
7+
# version: 0.3.20190521
88
#
99
language: c
1010
dist: xenial
@@ -29,8 +29,11 @@ before_cache:
2929
- rm -rfv $CABALHOME/packages/head.hackage
3030
matrix:
3131
include:
32-
- compiler: ghc-8.6.4
33-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}}
32+
- compiler: ghc-8.8.1
33+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
34+
env: GHCHEAD=true
35+
- compiler: ghc-8.6.5
36+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
3437
- compiler: ghc-8.4.4
3538
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
3639
- compiler: ghc-8.2.2
@@ -41,20 +44,47 @@ matrix:
4144
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-2.4"]}}
4245
- compiler: ghc-7.8.4
4346
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-2.4"]}}
47+
- compiler: ghc-7.6.3
48+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.6.3","cabal-install-2.4"]}}
49+
- compiler: ghc-7.4.2
50+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.4.2","cabal-install-2.4"]}}
51+
allow_failures:
52+
- compiler: ghc-8.8.1
4453
before_install:
4554
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
4655
- HCPKG="$HC-pkg"
4756
- unset CC
4857
- CABAL=/opt/ghc/bin/cabal
4958
- CABALHOME=$HOME/.cabal
5059
- export PATH="$CABALHOME/bin:$PATH"
51-
- ROOTDIR=$(pwd)
60+
- TOP=$(pwd)
5261
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
5362
- echo $HCNUMVER
63+
- CABAL="$CABAL -vnormal+nowrap+markoutput"
64+
- set -o pipefail
65+
- |
66+
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
67+
echo 'BEGIN { state = "output"; }' >> .colorful.awk
68+
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
69+
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
70+
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
71+
echo ' if (state == "cabal") {' >> .colorful.awk
72+
echo ' print blue($0)' >> .colorful.awk
73+
echo ' } else {' >> .colorful.awk
74+
echo ' print $0' >> .colorful.awk
75+
echo ' }' >> .colorful.awk
76+
echo '}' >> .colorful.awk
77+
- cat .colorful.awk
78+
- |
79+
color_cabal_output () {
80+
awk -f $TOP/.colorful.awk
81+
}
82+
- echo text | color_cabal_output
5483
install:
5584
- ${CABAL} --version
5685
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
5786
- TEST=--enable-tests
87+
- if [ $HCNUMVER -lt 70600 ] ; then TEST=--disable-tests ; fi
5888
- BENCH=--enable-benchmarks
5989
- GHCHEAD=${GHCHEAD-false}
6090
- rm -f $CABALHOME/config
@@ -66,36 +96,49 @@ install:
6696
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
6797
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
6898
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
99+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
69100
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
70101
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
71102
echo "install-dirs user" >> $CABALHOME/config
72103
echo " prefix: $CABALHOME" >> $CABALHOME/config
73104
echo "repository hackage.haskell.org" >> $CABALHOME/config
74105
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
106+
- |
107+
if $GHCHEAD; then
108+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config
109+
110+
echo "repository head.hackage" >> $CABALHOME/config
111+
echo " url: http://head.hackage.haskell.org/" >> $CABALHOME/config
112+
echo " secure: True" >> $CABALHOME/config
113+
echo " root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740" >> $CABALHOME/config
114+
echo " 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb" >> $CABALHOME/config
115+
echo " 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e" >> $CABALHOME/config
116+
echo " key-threshold: 3" >> $CABALHOME/config
117+
fi
75118
- cat $CABALHOME/config
76119
- rm -fv cabal.project cabal.project.local cabal.project.freeze
77120
- travis_retry ${CABAL} v2-update -v
78-
- if [ $HCNUMVER -ge 80000 ] ; then ${CABAL} new-install -w ${HC} -j2 doctest --constraint='doctest ==0.16.*' ; fi
121+
- if [ $HCNUMVER -ge 80000 ] ; then ${CABAL} v2-install -w ${HC} -j2 doctest --constraint='doctest ==0.16.*' | color_cabal_output ; fi
79122
# Generate cabal.project
80123
- rm -rf cabal.project cabal.project.local cabal.project.freeze
81124
- touch cabal.project
82125
- |
83126
echo 'packages: "."' >> cabal.project
84127
- |
85128
echo "write-ghc-environment-files: always" >> cabal.project
86-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(tree-diff)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
129+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(tree-diff)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
87130
- cat cabal.project || true
88131
- cat cabal.project.local || true
89132
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
90-
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH}
133+
- ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
91134
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
92135
- rm cabal.project.freeze
93-
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
94-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
136+
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
137+
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
95138
script:
96139
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
97140
# Packaging...
98-
- ${CABAL} new-sdist all
141+
- ${CABAL} v2-sdist all | color_cabal_output
99142
# Unpacking...
100143
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
101144
- cd ${DISTDIR} || false
@@ -107,26 +150,26 @@ script:
107150
echo 'packages: "tree-diff-*/*.cabal"' >> cabal.project
108151
- |
109152
echo "write-ghc-environment-files: always" >> cabal.project
110-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(tree-diff)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
153+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(tree-diff)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
111154
- cat cabal.project || true
112155
- cat cabal.project.local || true
113156
# Building...
114157
# this builds all libraries and executables (without tests/benchmarks)
115-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
158+
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
116159
# Building with tests and benchmarks...
117160
# build & run tests, build benchmarks
118-
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
161+
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
119162
# Testing...
120-
- ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all
163+
- if [ $HCNUMVER -ge 70600 ] ; then ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output ; fi
121164
# Doctest...
122165
- if [ $HCNUMVER -ge 80000 ] ; then (cd tree-diff-* && doctest --fast -D__DOCTEST__ src) ; fi
123166
# cabal check...
124-
- (cd tree-diff-* && ${CABAL} check)
167+
- (cd tree-diff-* && ${CABAL} -vnormal check)
125168
# haddock...
126-
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
169+
- ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
127170
# Building without installed constraints for packages in global-db...
128171
- rm -f cabal.project.local
129-
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
172+
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
130173

131-
# REGENDATA ["--doctest","--doctest-options","--fast -D__DOCTEST__","--output",".travis.yml","--branches","master","tree-diff.cabal"]
174+
# REGENDATA ["--doctest","--doctest-options","--fast -D__DOCTEST__","--output",".travis.yml","--branches","master","--tests-jobs=>=7.6","tree-diff.cabal"]
132175
# EOF

ChangeLog.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Revision history for tree-diff
1+
## 0.1
2+
3+
- Support GHC-7.4 ... 8.8 (use allow-newer for GHC-8.8-alpha).
4+
- Use raw GHC.Generics (drop `generics-sop` dependency)
5+
- Use own memoising (Vector lookup, drop `MemoTrie` dependency)
6+
- Singleton data-types (both `data` and `newtype`s) are printed in App form (i.e. no-record).
7+
- Change license to GPL-2.0-or-later
28

39
## 0.0.2.1
410

0 commit comments

Comments
 (0)