Skip to content

Commit fd2f4ad

Browse files
authored
Merge pull request #401 from phadej/ghc-8.8.1
Support ghc-8.8.1
2 parents 6a44ccc + e850e83 commit fd2f4ad

File tree

8 files changed

+197
-339
lines changed

8 files changed

+197
-339
lines changed

.travis.yml

Lines changed: 45 additions & 41 deletions
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 '--branches' 'master' '-o' '.travis.yml' 'github.cabal'
3+
# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
7-
# version: 0.3.20190521
7+
# version: 0.5.20190908
88
#
99
language: c
1010
dist: xenial
@@ -31,30 +31,29 @@ matrix:
3131
include:
3232
- compiler: ghc-8.8.1
3333
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
34-
env: GHCHEAD=true
3534
- compiler: ghc-8.6.5
36-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
35+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
3736
- compiler: ghc-8.4.4
38-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
37+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
3938
- compiler: ghc-8.2.2
40-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
39+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
4140
- compiler: ghc-8.0.2
42-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
41+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
4342
- compiler: ghc-7.10.3
44-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-2.4"]}}
43+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-3.0"]}}
4544
- compiler: ghc-7.8.4
46-
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-2.4"]}}
47-
allow_failures:
48-
- compiler: ghc-8.8.1
45+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-3.0"]}}
4946
before_install:
5047
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
48+
- WITHCOMPILER="-w $HC"
49+
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
5150
- HCPKG="$HC-pkg"
5251
- unset CC
5352
- CABAL=/opt/ghc/bin/cabal
5453
- CABALHOME=$HOME/.cabal
5554
- export PATH="$CABALHOME/bin:$PATH"
5655
- TOP=$(pwd)
57-
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
56+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
5857
- echo $HCNUMVER
5958
- CABAL="$CABAL -vnormal+nowrap+markoutput"
6059
- set -o pipefail
@@ -81,11 +80,12 @@ install:
8180
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
8281
- TEST=--enable-tests
8382
- BENCH=--enable-benchmarks
84-
- GHCHEAD=${GHCHEAD-false}
83+
- HEADHACKAGE=false
8584
- rm -f $CABALHOME/config
8685
- |
8786
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
8887
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
88+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
8989
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
9090
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
9191
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
@@ -99,69 +99,73 @@ install:
9999
echo "repository hackage.haskell.org" >> $CABALHOME/config
100100
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
101101
- |
102-
if $GHCHEAD; then
103-
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config
104-
105-
echo "repository head.hackage" >> $CABALHOME/config
106-
echo " url: http://head.hackage.haskell.org/" >> $CABALHOME/config
107-
echo " secure: True" >> $CABALHOME/config
108-
echo " root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740" >> $CABALHOME/config
109-
echo " 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb" >> $CABALHOME/config
110-
echo " 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e" >> $CABALHOME/config
111-
echo " key-threshold: 3" >> $CABALHOME/config
112-
fi
102+
echo "program-default-options" >> $CABALHOME/config
103+
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
113104
- cat $CABALHOME/config
114105
- rm -fv cabal.project cabal.project.local cabal.project.freeze
115106
- travis_retry ${CABAL} v2-update -v
116107
# Generate cabal.project
117108
- rm -rf cabal.project cabal.project.local cabal.project.freeze
118109
- touch cabal.project
119110
- |
120-
echo 'packages: "."' >> cabal.project
111+
echo "packages: ." >> cabal.project
112+
echo "packages: samples" >> cabal.project
121113
- |
122-
echo "write-ghc-environment-files: always" >> cabal.project
123-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(github)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
114+
echo "constraints: hashable ^>=1.3" >> cabal.project
115+
echo "constraints: semigroups ^>=0.19" >> cabal.project
116+
echo "constraints: github +openssl" >> cabal.project
117+
echo "optimization: False" >> cabal.project
118+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(github|github-samples)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
124119
- cat cabal.project || true
125120
- cat cabal.project.local || true
126121
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
127-
- ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
122+
- if [ -f "samples/configure.ac" ]; then (cd "samples" && autoreconf -i); fi
123+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
128124
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
129125
- rm cabal.project.freeze
130-
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
131-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
126+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
127+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
132128
script:
133129
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
134130
# Packaging...
135131
- ${CABAL} v2-sdist all | color_cabal_output
136132
# Unpacking...
137133
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
138134
- cd ${DISTDIR} || false
139-
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
135+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
136+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
137+
- PKGDIR_github="$(find . -maxdepth 1 -type d -regex '.*/github-[0-9.]*')"
138+
- PKGDIR_github_samples="$(find . -maxdepth 1 -type d -regex '.*/github-samples-[0-9.]*')"
140139
# Generate cabal.project
141140
- rm -rf cabal.project cabal.project.local cabal.project.freeze
142141
- touch cabal.project
143142
- |
144-
echo 'packages: "github-*/*.cabal"' >> cabal.project
143+
echo "packages: ${PKGDIR_github}" >> cabal.project
144+
echo "packages: ${PKGDIR_github_samples}" >> cabal.project
145145
- |
146-
echo "write-ghc-environment-files: always" >> cabal.project
147-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(github)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
146+
echo "constraints: hashable ^>=1.3" >> cabal.project
147+
echo "constraints: semigroups ^>=0.19" >> cabal.project
148+
echo "constraints: github +openssl" >> cabal.project
149+
echo "optimization: False" >> cabal.project
150+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(github|github-samples)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
148151
- cat cabal.project || true
149152
- cat cabal.project.local || true
150153
# Building...
151154
# this builds all libraries and executables (without tests/benchmarks)
152-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
155+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
153156
# Building with tests and benchmarks...
154157
# build & run tests, build benchmarks
155-
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
158+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
156159
# Testing...
157-
- ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
160+
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
158161
# cabal check...
159-
- (cd github-* && ${CABAL} -vnormal check)
162+
- (cd ${PKGDIR_github} && ${CABAL} -vnormal check)
163+
- (cd ${PKGDIR_github_samples} && ${CABAL} -vnormal check)
160164
# haddock...
161-
- ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
165+
- if [ $HCNUMVER -ge 80600 ] ; then ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output ; fi
162166
# Building without installed constraints for packages in global-db...
163167
- rm -f cabal.project.local
164-
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
168+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
165169

166-
# REGENDATA ["--branches","master","-o",".travis.yml","github.cabal"]
170+
# REGENDATA ["--config=cabal.haskell-ci","cabal.project"]
167171
# EOF

cabal.haskell-ci

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
branches: master
2+
haddock: >=8.6

cabal.project

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
packages:
2-
"."
3-
samples
1+
packages: .
2+
packages: samples
43

54
optimization: False
65
tests: True
76

87
constraints: hashable ^>=1.3
98
constraints: semigroups ^>=0.19
109

11-
allow-newer: aeson-1.4.3.0:hashable
12-
allow-newer: aeson-1.4.3.0:semigroups
13-
1410
constraints: github +openssl

github.cabal

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: >=1.10
22
name: github
3-
version: 0.22
3+
version: 0.23
44
synopsis: Access to the GitHub API, v3.
55
category: Network
66
description:
@@ -30,7 +30,13 @@ copyright:
3030
Copyright 2012-2013 Mike Burns, Copyright 2013-2015 John Wiegley, Copyright 2016-2019 Oleg Grenrus
3131

3232
tested-with:
33-
GHC ==7.8.4 || ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1
33+
GHC ==7.8.4
34+
|| ==7.10.3
35+
|| ==8.0.2
36+
|| ==8.2.2
37+
|| ==8.4.4
38+
|| ==8.6.5
39+
|| ==8.8.1
3440

3541
extra-source-files:
3642
README.md
@@ -49,8 +55,8 @@ source-repository head
4955

5056
flag openssl
5157
description: "Use http-client-openssl"
52-
manual: True
53-
default: False
58+
manual: True
59+
default: False
5460

5561
library
5662
default-language: Haskell2010
@@ -106,8 +112,8 @@ library
106112
GitHub.Data.Webhooks
107113
GitHub.Data.Webhooks.Validate
108114
GitHub.Endpoints.Activity.Events
109-
GitHub.Endpoints.Activity.Starring
110115
GitHub.Endpoints.Activity.Notifications
116+
GitHub.Endpoints.Activity.Starring
111117
GitHub.Endpoints.Activity.Watching
112118
GitHub.Endpoints.Gists
113119
GitHub.Endpoints.Gists.Comments
@@ -135,10 +141,10 @@ library
135141
GitHub.Endpoints.Repos.DeployKeys
136142
GitHub.Endpoints.Repos.Deployments
137143
GitHub.Endpoints.Repos.Forks
144+
GitHub.Endpoints.Repos.Invitations
138145
GitHub.Endpoints.Repos.Releases
139146
GitHub.Endpoints.Repos.Statuses
140147
GitHub.Endpoints.Repos.Webhooks
141-
GitHub.Endpoints.Repos.Invitations
142148
GitHub.Endpoints.Search
143149
GitHub.Endpoints.Users
144150
GitHub.Endpoints.Users.Emails
@@ -149,7 +155,7 @@ library
149155

150156
-- Packages bundles with GHC, mtl and text are also here
151157
build-depends:
152-
base >=4.7 && <4.13
158+
base >=4.7 && <4.14
153159
, binary >=0.7.1.0 && <0.11
154160
, bytestring >=0.10.4.0 && <0.11
155161
, containers >=0.5.5.1 && <0.7
@@ -162,7 +168,7 @@ library
162168
-- other packages
163169
build-depends:
164170
aeson >=1.4.0.0 && <1.5
165-
, base-compat >=0.10.4 && <0.11
171+
, base-compat >=0.10.4 && <0.12
166172
, base16-bytestring >=0.1.1.6 && <0.2
167173
, binary-instances >=1 && <1.1
168174
, cryptohash-sha1 >=0.11.100.1 && <0.12
@@ -182,17 +188,17 @@ library
182188

183189
if flag(openssl)
184190
build-depends:
185-
http-client-openssl >=0.3.0.0 && <0.4
186-
, HsOpenSSL >=0.11.4.16 && <0.12
187-
, HsOpenSSL-x509-system >=0.1.0.3 && <0.2
191+
HsOpenSSL >=0.11.4.16 && <0.12
192+
, HsOpenSSL-x509-system >=0.1.0.3 && <0.2
193+
, http-client-openssl >=0.2.2.0 && <0.4
194+
188195
else
189196
build-depends:
190-
http-client-tls >=0.3.5.3 && <0.4
191-
, tls >=1.4.1
197+
http-client-tls >=0.3.5.3 && <0.4
198+
, tls >=1.4.1
192199

193-
if !impl(ghc >= 8.0)
194-
build-depends:
195-
semigroups >=0.18.5 && <0.20
200+
if !impl(ghc >=8.0)
201+
build-depends: semigroups >=0.18.5 && <0.20
196202

197203
test-suite github-test
198204
default-language: Haskell2010
@@ -208,8 +214,8 @@ test-suite github-test
208214
GitHub.EventsSpec
209215
GitHub.IssuesSpec
210216
GitHub.OrganizationsSpec
211-
GitHub.PullRequestReviewsSpec
212217
GitHub.PublicSSHKeysSpec
218+
GitHub.PullRequestReviewsSpec
213219
GitHub.PullRequestsSpec
214220
GitHub.RateLimitSpec
215221
GitHub.ReleasesSpec
@@ -224,8 +230,8 @@ test-suite github-test
224230
, bytestring
225231
, file-embed
226232
, github
233+
, hspec >=2.6.1 && <2.8
227234
, tagged
228235
, text
229-
, hspec >=2.6.1 && <2.8
230236
, unordered-containers
231237
, vector

samples/LICENSE

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

samples/Users/Followers/Example.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
22
{-# LANGUAGE OverloadedStrings #-}
33

4+
import Prelude ()
45
import Prelude.Compat
56

67
import Data.Text (Text, pack)
78
import Data.Text.IO as T (putStrLn)
8-
import Data.Monoid ((<>))
99

1010
import qualified GitHub.Endpoints.Users.Followers as GitHub
1111

0 commit comments

Comments
 (0)