Skip to content

Commit 3492f55

Browse files
committed
Compatibility with newer ghc versions
* Add `cabal.project` * Add ghc-9.10, ghc-9.12 and disable ghc-8.0 on CI * Make test suite compatible with ghc-9.12
1 parent fb45e2e commit 3492f55

File tree

9 files changed

+59
-23
lines changed

9 files changed

+59
-23
lines changed

Diff for: .github/workflows/haskell.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
os: [ubuntu-latest, macOS-13, windows-latest]
31-
resolver: [lts-11, lts-12, lts-14, lts-16, lts-18, lts-19, lts-20, lts-21, lts-22, nightly]
31+
resolver: [lts-11, lts-12, lts-14, lts-16, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23, nightly]
3232
include:
3333
- resolver: lts-11
3434
ghc: '8.2.2'
35+
stack-version: '2.15.5'
3536
- resolver: lts-12
3637
ghc: '8.4.4'
3738
- resolver: lts-14
@@ -47,9 +48,11 @@ jobs:
4748
- resolver: lts-21
4849
ghc: '9.4.8'
4950
- resolver: lts-22
50-
ghc: '9.6.5'
51+
ghc: '9.6.6'
52+
- resolver: lts-23
53+
ghc: '9.8.4'
5154
- resolver: nightly
52-
ghc: '9.8.2'
55+
ghc: '9.10.1'
5356
# exclude:
5457
# - resolver: lts-12
5558
# os: windows-latest
@@ -73,7 +76,7 @@ jobs:
7376
with:
7477
ghc-version: ${{ matrix.ghc }}
7578
enable-stack: true
76-
stack-version: '2.15.5'
79+
stack-version: ${{ matrix.stack-version || 'latest' }}
7780

7881
- name: Cache
7982
id: cache
@@ -134,7 +137,7 @@ jobs:
134137
fail-fast: false
135138
matrix:
136139
include:
137-
- { os: ubuntu-latest, ghc: "8.0.2" }
140+
# - { os: ubuntu-latest, ghc: "8.0.2" }
138141
- { os: ubuntu-latest, ghc: "8.2.2" }
139142
- { os: ubuntu-latest, ghc: "8.4.4" }
140143
- { os: ubuntu-latest, ghc: "8.6.5" }
@@ -144,8 +147,9 @@ jobs:
144147
- { os: ubuntu-latest, ghc: "9.2.8" }
145148
- { os: ubuntu-latest, ghc: "9.4.8" }
146149
- { os: ubuntu-latest, ghc: "9.6.5" }
147-
- { os: ubuntu-latest, ghc: "9.8.2" }
150+
- { os: ubuntu-latest, ghc: "9.8.4" }
148151
- { os: ubuntu-latest, ghc: "9.10.1" }
152+
- { os: ubuntu-latest, ghc: "9.12.1" }
149153
# - { os: windows-latest, ghc: "8.0.2" } # Linker errors
150154
# - { os: windows-latest, ghc: "8.2.2" } # Linker errors
151155
- { os: windows-latest, ghc: "8.4.4" }
@@ -156,9 +160,10 @@ jobs:
156160
- { os: windows-latest, ghc: "9.2.8" }
157161
- { os: windows-latest, ghc: "9.4.8" }
158162
- { os: windows-latest, ghc: "9.6.5" }
159-
- { os: windows-latest, ghc: "9.8.2" }
163+
- { os: windows-latest, ghc: "9.8.4" }
160164
- { os: windows-latest, ghc: "9.10.1" }
161-
- { os: macOS-13, ghc: "8.0.2" }
165+
- { os: windows-latest, ghc: "9.12.1" }
166+
# - { os: macOS-13, ghc: "8.0.2" }
162167
- { os: macOS-13, ghc: "8.2.2" }
163168
- { os: macOS-13, ghc: "8.4.4" }
164169
- { os: macOS-13, ghc: "8.6.5" }
@@ -168,8 +173,9 @@ jobs:
168173
- { os: macOS-latest, ghc: "9.2.8" }
169174
- { os: macOS-latest, ghc: "9.4.8" }
170175
- { os: macOS-latest, ghc: "9.6.5" }
171-
- { os: macOS-latest, ghc: "9.8.2" }
176+
- { os: macOS-latest, ghc: "9.8.4" }
172177
- { os: macOS-latest, ghc: "9.10.1" }
178+
- { os: macOS-latest, ghc: "9.12.1" }
173179

174180
env:
175181
cache-version: v3 # bump up this version to invalidate currently stored cache
@@ -220,7 +226,7 @@ jobs:
220226
resolver: [lts-22]
221227
include:
222228
- resolver: lts-22
223-
ghc: 9.6.5
229+
ghc: 9.6.6
224230

225231
env:
226232
STACK_ARGS: '--resolver ${{ matrix.resolver }} --system-ghc'
@@ -267,7 +273,7 @@ jobs:
267273
fail-fast: false
268274
matrix:
269275
os: [ubuntu-latest]
270-
ghc: [9.6.5]
276+
ghc: [9.6.6]
271277

272278
env:
273279
STACK_ARGS: '--system-ghc'

Diff for: cabal.project

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
packages:
2+
massiv
3+
--massiv-bench
4+
massiv-test
5+
6+
write-ghc-environment-files: always
7+
-- Always build tests and benchmarks.
8+
tests: true
9+
benchmarks: true
10+
-- The only sensible test display option
11+
test-show-details: streaming

Diff for: massiv-test/src/Test/Massiv/Core/Index.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import Data.Massiv.Array.Unsafe (Sz (SafeSz))
4646
import Data.Massiv.Core.Index
4747
import Data.Proxy
4848
import Data.Typeable
49-
import GHC.Exception (ErrorCall (ErrorCallWithLocation))
49+
import GHC.Exception (ErrorCall (ErrorCall))
5050
import Test.Massiv.Utils
5151

5252
-- | Dimension that is always within bounds of an index
@@ -517,7 +517,7 @@ szNumSpec = do
517517
sz
518518
/= zeroSz
519519
==> assertDeepException
520-
(\(ErrorCallWithLocation err loc) -> err `deepseq` loc `deepseq` True)
520+
(\(ErrorCall err) -> err `deepseq` True)
521521
(negate sz :: Sz ix)
522522

523523
prop "abs" $ prop_UnaryNumSz @ix abs

Diff for: massiv-test/src/Test/Massiv/Utils.hs

+9-4
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ import Data.Maybe as X (fromMaybe, isJust, isNothing)
3838
import Data.Typeable as X
3939
import Test.Hspec as X
4040
import Test.Hspec.QuickCheck as X
41-
import Test.QuickCheck as X hiding ((.&.))
4241
import Test.QuickCheck.Classes.Base as X
42+
import Test.QuickCheck as X hiding ((.&.))
4343
import Test.QuickCheck.Function as X
44+
import UnliftIO.Exception (Exception (..), SomeException, catchAny)
45+
#if !MIN_VERSION_QuickCheck(2,15,0)
4446
import Test.QuickCheck.Monadic as X
45-
import UnliftIO.Exception (Exception (..), SomeException, catch, catchAny)
47+
import UnliftIO.Exception (catch)
48+
#else
49+
import Test.QuickCheck.Monadic (assertDeepException, assertDeepExceptionIO)
50+
import Test.QuickCheck.Monadic as X hiding (assertDeepException, assertDeepExceptionIO)
51+
#endif
4652
#if !MIN_VERSION_base(4,11,0)
4753
import Data.Semigroup as X ((<>))
4854
#endif
@@ -108,8 +114,7 @@ toStringException :: Either SomeException a -> Either String a
108114
toStringException = either (Left . displayException) Right
109115

110116
selectErrorCall :: ErrorCall -> Bool
111-
selectErrorCall = \case
112-
ErrorCallWithLocation err loc -> err `deepseq` loc `deepseq` True
117+
selectErrorCall (ErrorCall err) = err `deepseq` True
113118

114119
data ExpectedException = ExpectedException deriving (Show, Eq)
115120

Diff for: massiv-test/tests/Test/Massiv/Array/Ops/TransformSpec.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
module Test.Massiv.Array.Ops.TransformSpec (spec) where
1111

12-
import Data.Foldable as F (foldl', toList)
12+
import qualified Data.Foldable as F
1313
import Data.Massiv.Array as A
1414
import Data.Maybe
1515
import Data.Sequence as S
@@ -289,8 +289,8 @@ preJust m = isJust m ==> fromJust m
289289

290290
prop_ConsSnoc :: Array D Ix1 Int -> [SeqOp Int] -> Property
291291
prop_ConsSnoc arr ops =
292-
A.toList (computeAs U (foldl' applyArraySeqOp (toLoadArray arr) ops))
293-
=== F.toList (foldl' applySequenceSeqOp (S.fromList (A.toList arr)) ops)
292+
A.toList (computeAs U (F.foldl' applyArraySeqOp (toLoadArray arr) ops))
293+
=== F.toList (F.foldl' applySequenceSeqOp (S.fromList (A.toList arr)) ops)
294294

295295
data SeqOp e = Cons e | Snoc e deriving (Eq, Show)
296296

Diff for: massiv/massiv.cabal

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ tested-with: GHC == 8.0.2
2222
, GHC == 9.0.2
2323
, GHC == 9.2.8
2424
, GHC == 9.4.8
25-
, GHC == 9.6.5
26-
, GHC == 9.8.2
25+
, GHC == 9.6.6
26+
, GHC == 9.8.4
27+
, GHC == 9.10.1
28+
, GHC == 9.12.1
2729

2830
flag unsafe-checks
2931
description: Enable all the bounds checks for unsafe functions at the cost of

Diff for: stack.ghc-9.8.2.yaml renamed to stack.ghc-9.10.1.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
work-dir: ".stack-work-root"
2-
resolver: nightly-2024-06-28
2+
resolver: nightly-2025-01-10
33
packages:
44
- 'massiv/'
55
- 'massiv-test/'
File renamed without changes.

Diff for: stack.ghc-9.8.4.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
work-dir: ".stack-work-root"
2+
resolver: lts-23.3
3+
packages:
4+
- 'massiv/'
5+
- 'massiv-test/'
6+
flags: {}
7+
extra-deps:
8+
- random-1.3.0
9+
- github: haskell/mwc-random
10+
commit: 2cce257158befe52417433d1e7717f11ce718aec
11+
ghc-options:
12+
'$everything': -haddock

0 commit comments

Comments
 (0)