Skip to content

Commit 0d2241d

Browse files
committed
Preliminary ghc-9.14 support
Currently using ghc-9.14.0.20251007.
1 parent 0fc18b4 commit 0d2241d

File tree

19 files changed

+292
-26
lines changed

19 files changed

+292
-26
lines changed

acts-generic/src/Data/Act/Generic.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE FlexibleContexts #-}
23
{-# LANGUAGE FlexibleInstances #-}
34
{-# LANGUAGE MultiParamTypeClasses #-}
@@ -68,7 +69,13 @@ instance (GAct s f, GAct s g) => GAct s (f :+: g) where
6869
--
6970
newtype GenericAct s a = GenericAct { getGenericAct :: a }
7071

71-
instance (Generic s, Generic a, GAct s (Rep a), Semigroup s) => Act s (GenericAct s a) where
72+
instance (
73+
#if __GLASGOW_HASKELL__ < 914
74+
-- These constraints are REQUIRED for ghc < 9.14 but REDUNDANT for ghc >= 9.14
75+
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/26381#note_637863
76+
Generic s,
77+
#endif
78+
Generic a, GAct s (Rep a), Semigroup s) => Act s (GenericAct s a) where
7279
act s (GenericAct a) = GenericAct (s `gact` a)
7380

7481

cabal.project

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,154 @@ source-repository-package
6262
tag: 6d0f51fba415d3c641a8a8da37130e7adfc3ea01
6363
--sha256: sha256-qM8RgmKOGBMlizPtXw2YOboYIzM6T3kvG9/Rp1F+bYQ=
6464
subdir: kes-agent-crypto
65+
66+
if impl (ghc >= 9.14)
67+
constraints:
68+
, containers > 0.7
69+
, foldl >= 1.4.18
70+
, nothunks ^>= 0.2
71+
-- Newest version causes Arbitrary instance clashes in quickcheck-instances.
72+
, QuickCheck < 2.17.0.0
73+
74+
-- cabal-allow-newer
75+
if impl (ghc >= 9.14)
76+
allow-newer:
77+
, OneTuple:base
78+
, aeson:QuickCheck
79+
, aeson:base
80+
, aeson:bytestring
81+
, aeson:containers
82+
, aeson:deepseq
83+
, aeson:ghc-prim
84+
, aeson:template-haskell
85+
, aeson:text-iso8601
86+
, aeson:text-short
87+
, aeson:time
88+
, aeson:time-compat
89+
, aeson:witherable
90+
, assoc:base
91+
, async:base
92+
, bifunctors:template-haskell
93+
, bifunctors:th-abstraction
94+
, binary:containers
95+
, binary-orphans:base
96+
, boring:base
97+
, canonical-json:containers
98+
, cardano-diffusion:cborg
99+
, cardano-diffusion:io-classes
100+
, cardano-diffusion:typed-protocols
101+
, cardano-ping:time
102+
, cardano-prelude:canonical-json
103+
, cborg:base
104+
, cborg:bytestring
105+
, cborg:containers
106+
, criterion:microstache
107+
, data-fix:base
108+
, directory:time
109+
, dmq-node:time
110+
, exceptions:mtl
111+
, filepath:base
112+
, free:base
113+
, free:exceptions
114+
, free:mtl
115+
, free:template-haskell
116+
, generic-data:base
117+
, generically:base
118+
, ghc-heap:base
119+
, ghc-heap:containers
120+
, ghc-heap:ghc-internal
121+
, ghc-heap:ghc-prim
122+
, hashable:base
123+
, hashable:containers
124+
, hashable:ghc-bignum
125+
, hsc2hs:base
126+
, indexed-traversable:base
127+
, indexed-traversable:containers
128+
, indexed-traversable-instances:base
129+
, integer-conversion:base
130+
, integer-logarithms:base
131+
, integer-logarithms:ghc-bignum
132+
, io-classes:async
133+
, io-classes:base
134+
, io-classes:time
135+
, io-sim:base
136+
, io-sim:time
137+
, kes-agent-crypto:base
138+
, microstache:aeson
139+
, microstache:base
140+
, microstache:bytestring
141+
, microstache:containers
142+
, network-mux:containers
143+
, network-mux:time
144+
, network-uri:th-compat
145+
, nothunks:containers
146+
, nothunks:time
147+
, nothunks:wherefrom-compat
148+
, ntp-client:time
149+
, os-string:bytestring
150+
, os-string:exceptions
151+
, os-string:template-haskell
152+
, ouroboros-network:time
153+
, parallel:base
154+
, parsec:bytestring
155+
, primitive:base
156+
, process:base
157+
, quickcheck-instances:array
158+
, quickcheck-instances:base
159+
, quickcheck-instances:bytestring
160+
, quickcheck-instances:containers
161+
, recursion-schemes:containers
162+
, recursion-schemes:data-fix
163+
, recursion-schemes:free
164+
, recursion-schemes:template-haskell
165+
, scientific:base
166+
, scientific:containers
167+
, scientific:integer-logarithms
168+
, scientific:template-haskell
169+
, semialign:base
170+
, semialign:containers
171+
, semigroupoids:bifunctors
172+
, serialise:base
173+
, serialise:bytestring
174+
, serialise:containers
175+
, serialise:ghc-prim
176+
, serialise:hashable
177+
, serialise:these
178+
, serialise:time
179+
, singletons:base
180+
, splitmix:base
181+
, statistics:parallel
182+
, tagged:template-haskell
183+
, tdigest:base
184+
, text:array
185+
, text:binary
186+
, text-iso8601:time
187+
, text-short:base
188+
, text-short:ghc-prim
189+
, text-short:template-haskell
190+
, th-abstraction:template-haskell
191+
, th-compat:template-haskell
192+
, these:base
193+
, time-compat:base
194+
, time-compat:deepseq
195+
, time-compat:time
196+
, tree-diff:aeson
197+
, tree-diff:base
198+
, tree-diff:containers
199+
, tree-diff:deepseq
200+
, tree-diff:scientific
201+
, tree-diff:tagged
202+
, tree-diff:time
203+
, tree-diff:uuid-types
204+
, typed-protocols:base
205+
, typed-protocols:singletons
206+
, unix:base
207+
, unordered-containers:base
208+
, unordered-containers:hashable
209+
, unordered-containers:template-haskell
210+
, uuid-types:template-haskell
211+
, vector-th-unbox:base
212+
, vector-th-unbox:template-haskell
213+
, wherefrom-compat:base
214+
, with-utf8:base
215+
, witherable:containers

cardano-diffusion/tests/lib/Test/Cardano/Network/PeerSelection.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,11 @@ prop_governor_peershare_1hr env@GovernorMockEnvironment {
10791079
)
10801080
in counterexample ( intercalate "\n"
10811081
. map (ppSimEvent 20 20 20)
1082-
. takeWhile (\e -> seTime e <= Time (60*60))
1082+
. takeWhile (\e ->
1083+
case e of
1084+
SimEvent {seTime} -> seTime < Time (60*60)
1085+
SimPOREvent {seTime} -> seTime < Time (60*60)
1086+
_ -> False)
10831087
. Trace.toList
10841088
$ ioSimTrace) $
10851089
subsetProperty found reachable

cardano-ping/cardano-ping.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ library
3737
network-mux ^>=0.9,
3838
tdigest ^>=0.3,
3939
text >=1.2.4 && <2.2,
40-
time >=1.9.1 && <1.16,
40+
time >=1.9.1 && <1.14,
4141
transformers >=0.5 && <0.7,
4242

4343
if flag(asserts)

dmq-node/dmq-node.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ library
107107
random ^>=1.2,
108108
singletons,
109109
text >=1.2.4 && <2.2,
110-
time >=1.12 && <1.16,
110+
time ^>=1.12,
111111
typed-protocols:{typed-protocols, cborg} ^>=1.1,
112112

113113
hs-source-dirs: src

network-mux/src/Network/Mux.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE CPP #-}
23
{-# LANGUAGE DataKinds #-}
34
{-# LANGUAGE ExistentialQuantification #-}
45
{-# LANGUAGE FlexibleContexts #-}
@@ -66,7 +67,11 @@ import Data.Map (Map)
6667
import Data.Map.Strict qualified as Map
6768
import Data.Maybe (isNothing)
6869
import Data.Monoid.Synchronisation (FirstToFinish (..))
70+
#if __GLASGOW_HASKELL__ < 914
6971
import Data.Strict.Tuple (pattern (:!:))
72+
#else
73+
import Data.Strict.Tuple (data (:!:))
74+
#endif
7075

7176
import Control.Applicative
7277
import Control.Concurrent.Class.MonadSTM.Strict

network-mux/src/Network/Mux/Ingress.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE CPP #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE MultiParamTypeClasses #-}
45
{-# LANGUAGE NamedFieldPuns #-}
@@ -17,7 +18,11 @@ import Data.ByteString.Builder.Internal (lazyByteStringInsert,
1718
lazyByteStringThreshold)
1819
import Data.ByteString.Lazy qualified as BL
1920
import Data.List (nub)
21+
#if __GLASGOW_HASKELL__ < 914
2022
import Data.Strict.Tuple (pattern (:!:))
23+
#else
24+
import Data.Strict.Tuple (data (:!:))
25+
#endif
2126

2227
import Control.Concurrent.Class.MonadSTM.Strict
2328
import Control.Monad

ntp-client/ntp-client.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ library
3636
contra-tracer >=0.1 && <0.2,
3737
network ^>=3.2.7,
3838
stm >=2.4 && <2.6,
39-
time >=1.9.1 && <1.16,
39+
time >=1.9.1 && <1.14,
4040

4141
hs-source-dirs: src
4242
default-language: Haskell2010
@@ -67,7 +67,7 @@ test-suite test
6767
binary >=0.8 && <0.11,
6868
tasty,
6969
tasty-quickcheck,
70-
time >=1.9.1 && <1.16,
70+
time >=1.9.1 && <1.14,
7171

7272
default-language: Haskell2010
7373
default-extensions: ImportQualifiedPost

ouroboros-network/api/lib/Ouroboros/Network/Block.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveAnyClass #-}
23
{-# LANGUAGE DeriveGeneric #-}
34
{-# LANGUAGE DeriveTraversable #-}
@@ -40,8 +41,13 @@ module Ouroboros.Network.Block
4041
, pointHash
4142
, castPoint
4243
, blockPoint
44+
#if __GLASGOW_HASKELL__ < 914
4345
, pattern GenesisPoint
4446
, pattern BlockPoint
47+
#else
48+
, data GenesisPoint
49+
, data BlockPoint
50+
#endif
4551
, atSlot
4652
, withHash
4753
, Tip (..)

ouroboros-network/api/tests/Test/Ouroboros/Network/Chain.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE GADTs #-}
@@ -15,7 +16,13 @@ import Test.QuickCheck
1516
import Test.Tasty (TestTree, testGroup)
1617
import Test.Tasty.QuickCheck (testProperty)
1718

18-
import Ouroboros.Network.Block (blockPrevHash, pattern GenesisPoint, pointHash)
19+
import Ouroboros.Network.Block (blockPrevHash,
20+
#if __GLASGOW_HASKELL__ < 914
21+
pattern GenesisPoint,
22+
#else
23+
data GenesisPoint,
24+
#endif
25+
pointHash)
1926
import Ouroboros.Network.Mock.Chain (Chain (..))
2027
import Ouroboros.Network.Mock.Chain qualified as Chain
2128
import Ouroboros.Network.Mock.ChainGenerators hiding (tests)

0 commit comments

Comments
 (0)