Skip to content

Commit e7d9153

Browse files
authored
Merge pull request #72 from haskellari/ghc-9.6b
GHC-9.6, primitive-0.8
2 parents 22d8148 + a140a45 commit e7d9153

File tree

5 files changed

+69
-35
lines changed

5 files changed

+69
-35
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.15.20221225
11+
# version: 0.15.20230321
1212
#
13-
# REGENDATA ("0.15.20221225",["github","cabal.project"])
13+
# REGENDATA ("0.15.20230321",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -37,25 +37,30 @@ jobs:
3737
compilerVersion: "8.4"
3838
setup-method: hvr-ppa
3939
allow-failure: false
40-
- compiler: ghc-9.4.1
40+
- compiler: ghc-9.6.1
4141
compilerKind: ghc
42-
compilerVersion: 9.4.1
42+
compilerVersion: 9.6.1
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.2.4
45+
- compiler: ghc-9.4.4
4646
compilerKind: ghc
47-
compilerVersion: 9.2.4
47+
compilerVersion: 9.4.4
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.2.7
51+
compilerKind: ghc
52+
compilerVersion: 9.2.7
4853
setup-method: ghcup
4954
allow-failure: false
5055
- compiler: ghc-9.0.2
5156
compilerKind: ghc
5257
compilerVersion: 9.0.2
5358
setup-method: ghcup
5459
allow-failure: false
55-
- compiler: ghc-8.10.4
60+
- compiler: ghc-8.10.7
5661
compilerKind: ghc
57-
compilerVersion: 8.10.4
58-
setup-method: hvr-ppa
62+
compilerVersion: 8.10.7
63+
setup-method: ghcup
5964
allow-failure: false
6065
- compiler: ghc-8.8.4
6166
compilerKind: ghc
@@ -123,10 +128,10 @@ jobs:
123128
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
124129
if [ "${{ matrix.setup-method }}" = ghcup ]; then
125130
mkdir -p "$HOME/.ghcup/bin"
126-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
131+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
127132
chmod a+x "$HOME/.ghcup/bin/ghcup"
128133
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
129-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
134+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
130135
else
131136
apt-add-repository -y 'ppa:hvr/ghc'
132137
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi
@@ -135,9 +140,9 @@ jobs:
135140
apt-get update
136141
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi
137142
mkdir -p "$HOME/.ghcup/bin"
138-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
143+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
139144
chmod a+x "$HOME/.ghcup/bin/ghcup"
140-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
145+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
141146
fi
142147
env:
143148
HCKIND: ${{ matrix.compilerKind }}
@@ -156,13 +161,13 @@ jobs:
156161
echo "HC=$HC" >> "$GITHUB_ENV"
157162
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
158163
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
159-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
164+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
160165
else
161166
HC=$HCDIR/bin/$HCKIND
162167
echo "HC=$HC" >> "$GITHUB_ENV"
163168
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
164169
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
165-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
170+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
166171
fi
167172
168173
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
@@ -231,7 +236,7 @@ jobs:
231236
chmod a+x $HOME/.cabal/bin/cabal-docspec
232237
cabal-docspec --version
233238
- name: checkout
234-
uses: actions/checkout@v2
239+
uses: actions/checkout@v3
235240
with:
236241
path: source
237242
- name: initial cabal.project for sdist
@@ -266,8 +271,8 @@ jobs:
266271
run: |
267272
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
268273
cabal-plan
269-
- name: cache
270-
uses: actions/cache@v2
274+
- name: restore cache
275+
uses: actions/cache/restore@v3
271276
with:
272277
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
273278
path: ~/.cabal/store
@@ -295,7 +300,7 @@ jobs:
295300
${CABAL} -vnormal check
296301
- name: haddock
297302
run: |
298-
if [ $((! GHCJSARITH && HCNUMVER >= 70800)) -ne 0 ] ; then $CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
303+
if [ $((! GHCJSARITH && HCNUMVER >= 70800)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
299304
- name: unconstrained build
300305
run: |
301306
rm -f cabal.project.local
@@ -305,6 +310,12 @@ jobs:
305310
rm -f cabal.project.local
306311
- name: constraint set random-hashable
307312
run: |
308-
if [ $((! GHCJSARITH && HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' --dependencies-only -j2 all ; fi
309-
if [ $((! GHCJSARITH && HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all ; fi
310-
if [ $((! GHCJSARITH && HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all ; fi
313+
if [ $((! GHCJSARITH && HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' --dependencies-only -j2 all ; fi
314+
if [ $((! GHCJSARITH && HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all ; fi
315+
if [ $((! GHCJSARITH && HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all ; fi
316+
- name: save cache
317+
uses: actions/cache/save@v3
318+
if: always()
319+
with:
320+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
321+
path: ~/.cabal/store

cabal.project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
packages: .
22

3+
tests: True
4+
35
package tree-diff
46
ghc-options: -Wall
57

src/Data/TreeDiff/Class.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ instance (ToExpr a, ToExpr b) => ToExpr (These a b) where
602602
instance ToExpr Prim.ByteArray where
603603
toExpr ba = App "Prim.byteArrayFromList" [toExpr (Prim.foldrByteArray (:) [] ba :: [Word8])]
604604

605-
#if MIN_VERSION_base(4,9,0)
605+
#if !MIN_VERSION_primitive(0,8,0) && MIN_VERSION_base(4,9,0)
606606
-- | @since 0.2.2
607607
instance ToExpr ByteArray where
608608
toExpr (ByteArray ba) = App "byteArrayFromList" [toExpr (Prim.foldrByteArray (:) [] (Prim.ByteArray ba) :: [Word8])]

tests/Tests.hs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveGeneric #-}
23
module Main (main) where
34

@@ -11,7 +12,12 @@ import Test.Tasty (TestTree, defaultMain, testGroup)
1112
import Test.Tasty.Golden.Advanced (goldenTest)
1213
import Test.Tasty.QuickCheck (testProperty)
1314

15+
#if MIN_VERSION_base(4,9,0)
16+
import Data.Array.Byte (ByteArray (..))
17+
#endif
18+
1419
import qualified Data.HashSet as HS
20+
import qualified Data.Primitive as Prim
1521
import qualified Text.Parsec as P
1622
import qualified Text.PrettyPrint.ANSI.Leijen as WL
1723
import qualified Text.Trifecta as T (eof, parseString)
@@ -152,6 +158,16 @@ instance ToExpr MyInt3
152158
instance ToExpr Positional
153159
instance ToExpr Empty
154160

161+
-- test that we have both instances.
162+
data ByteArrays = ByteArrays
163+
Prim.ByteArray
164+
#if MIN_VERSION_base(4,9,0)
165+
ByteArray
166+
#endif
167+
deriving Generic
168+
169+
instance ToExpr ByteArrays
170+
155171
goldenTests :: TestTree
156172
goldenTests = testGroup "Golden"
157173
[ ediffGolden goldenTest "exFoo" "fixtures/exfoo.expr" $

tree-diff.cabal

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.2
22
name: tree-diff
3-
version: 0.3
3+
version: 0.3.0.1
44
synopsis: Diffing of (expression) trees.
55
category: Data, Testing
66
description:
@@ -53,10 +53,11 @@ tested-with:
5353
|| ==8.4.4
5454
|| ==8.6.5
5555
|| ==8.8.4
56-
|| ==8.10.4
56+
|| ==8.10.7
5757
|| ==9.0.2
58-
|| ==9.2.4
59-
|| ==9.4.1
58+
|| ==9.2.7
59+
|| ==9.4.4
60+
|| ==9.6.1
6061
, GHCJS ==8.4
6162

6263
extra-source-files:
@@ -85,7 +86,7 @@ library
8586

8687
-- GHC boot libraries
8788
build-depends:
88-
, base >=4.5 && <4.18
89+
, base >=4.5 && <4.19
8990
, bytestring ^>=0.9.2.1 || ^>=0.10.0.2 || ^>=0.11.0.0
9091
, containers ^>=0.4.2.1 || ^>=0.5.0.0 || ^>=0.6.0.1
9192
, deepseq ^>=1.3.0.0 || ^>=1.4.0.0
@@ -98,17 +99,17 @@ library
9899
, aeson ^>=1.4.6.0 || ^>=1.5.6.0 || ^>=2.0.0.0 || ^>=2.1.0.0
99100
, ansi-terminal >=0.10 && <0.12
100101
, ansi-wl-pprint ^>=0.6.8.2
101-
, base-compat >=0.10.5 && <0.11 || >=0.11.0 && <0.13
102+
, base-compat >=0 && <0.13 || ^>=0.13
102103
, bytestring-builder ^>=0.10.8.2.0
103104
, hashable ^>=1.2.7.0 || ^>=1.3.0.0 || ^>=1.4.0.1
104105
, parsers ^>=0.12.10
105-
, primitive ^>=0.7.1.0
106+
, primitive >=0.7.1.0 && <0.8 || ^>=0.8
106107
, QuickCheck ^>=2.14.2
107108
, scientific ^>=0.3.6.2
108-
, semialign ^>=1.2.0.1
109-
, strict ^>=0.4.0.1
109+
, semialign >=1.2.0.1 && <1.3 || ^>=1.3
110+
, strict >=0.4.0.1 && <0.5 || ^>=0.5
110111
, tagged ^>=0.8.6
111-
, these ^>=1.1.1.1
112+
, these >=1.1.1.1 && <1.2 || ^>=1.2
112113
, unordered-containers ^>=0.2.8.0
113114
, uuid-types ^>=1.0.3
114115
, vector ^>=0.12.0.0 || ^>=0.13.0.0
@@ -125,10 +126,10 @@ library
125126
if !impl(ghc >=7.10)
126127
build-depends:
127128
, nats ^>=1.1.2
128-
, transformers ^>=0.3.0.0 || ^>=0.4.2.0 || ^>=0.5.2.0
129+
, transformers ^>=0.3.0.0 || ^>=0.4.2.0 || >=0.5.2.0 && <0.6 || ^>=0.6
129130
, void ^>=0.7.3
130131

131-
if impl(ghc >= 8) && !impl(ghc >=9.4)
132+
if (impl(ghc >=8) && !impl(ghc >=9.4))
132133
build-depends: data-array-byte >=0.1.0.1 && <0.2
133134

134135
other-extensions:
@@ -165,6 +166,9 @@ test-suite tree-diff-test
165166
, tree-diff
166167
, unordered-containers
167168

169+
if (impl(ghc >=8) && !impl(ghc >=9.4))
170+
build-depends: data-array-byte
171+
168172
if impl(ghc <7.5)
169173
build-depends: ghc-prim
170174

@@ -175,6 +179,7 @@ test-suite tree-diff-test
175179
, tasty-quickcheck ^>=0.10.1
176180
, trifecta >=2 && <2.2
177181

182+
178183
benchmark tree-diff-bench
179184
default-language: Haskell2010
180185
type: exitcode-stdio-1.0

0 commit comments

Comments
 (0)