Skip to content

Commit 238b4c8

Browse files
authored
Merge pull request #6146 from IntersectMBO/erikd/ghc-9.12
Make it build with ghc-9.12
2 parents fa3fa2f + daf46b0 commit 238b4c8

File tree

9 files changed

+74
-41
lines changed

9 files changed

+74
-41
lines changed

.github/workflows/haskell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
# If you edit these versions, make sure the version in the lonely macos-latest job below is updated accordingly
3939
# TODO add 9.8 again to the versions list when GHC-9.8 gets released with stm > 2.5.2,
4040
# see https://github.com/haskell/stm/issues/76
41-
ghc: ["9.6", "9.10"]
41+
ghc: ["9.6", "9.12"]
4242
cabal: ["3.12"]
4343
sys:
4444
- { os: windows-latest, shell: 'C:/msys64/usr/bin/bash.exe -e {0}' }

bench/tx-generator/src/Cardano/Benchmarking/Command.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import Data.Aeson (fromJSON)
3434
import Data.ByteString.Lazy as BSL
3535
import Data.Foldable (for_)
3636
import Data.Maybe (catMaybes)
37-
import Data.Text as T
38-
import Data.Text.IO as T
37+
import qualified Data.Text as Text
38+
import qualified Data.Text.IO as Text
3939
import Options.Applicative as Opt
4040
import Ouroboros.Network.NodeToClient (IOManager, withIOManager)
4141

@@ -148,7 +148,7 @@ runCommand' iocp = do
148148
, show sigInfo ]
149149
errorToThrow :: IOError
150150
errorToThrow = userError labelStr
151-
tag = TraceBenchTxSubError . T.pack
151+
tag = TraceBenchTxSubError . Text.pack
152152
traceWith' msg = do
153153
mBenchTracer <- STM.atomically do readTVar benchTracers
154154
case mBenchTracer of
@@ -257,4 +257,4 @@ commandParser
257257
versionCmd = pure VersionCmd
258258

259259
runVersionCommand :: IO ()
260-
runVersionCommand = T.putStrLn $ multilineVersionMsg txGeneratorVersion
260+
runVersionCommand = Text.putStrLn $ multilineVersionMsg txGeneratorVersion

cabal.project

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ repository cardano-haskell-packages
1313
-- See CONTRIBUTING for information about these, including some Nix commands
1414
-- you need to run if you change them
1515
index-state:
16-
, hackage.haskell.org 2025-01-01T23:24:19Z
17-
, cardano-haskell-packages 2025-02-11T21:18:23Z
16+
, hackage.haskell.org 2025-03-13T00:45:00Z
17+
, cardano-haskell-packages 2025-03-13T02:33:54Z
1818

1919
packages:
2020
cardano-node
@@ -64,3 +64,30 @@ allow-newer:
6464
-- IMPORTANT
6565
-- Do NOT add more source-repository-package stanzas here unless they are strictly
6666
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
67+
68+
if impl (ghc >= 9.12)
69+
allow-newer:
70+
-- https://github.com/phadej/vec/issues/118
71+
, bin:base
72+
, fin:base
73+
, ral:base
74+
75+
-- https://github.com/haskellari/tree-diff/issues/97
76+
, tree-diff:base
77+
78+
-- https://github.com/kapralVV/Unique/issues/11
79+
, Unique:hashable
80+
81+
-- https://github.com/fizruk/http-api-data/pull/146
82+
, http-api-data:base
83+
84+
-- https://github.com/ocharles/libsystemd-journal/pull/32
85+
, libsystemd-journal:base
86+
87+
-- https://github.com/Gabriella439/Haskell-Pipes-Safe-Library/pull/70
88+
, pipes-safe:base
89+
90+
-- https://github.com/haskell-servant/servant/pull/1810
91+
, servant:base
92+
, servant-server:base
93+

cardano-tracer/test/Cardano/Tracer/Test/ForwardingStressTest/Types.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Control.Monad (guard)
1717
import Data.Aeson (FromJSON (..), Object, Value (..), withObject, (.=))
1818
import Data.Aeson.Types (Parser, parseFail, -- parseEither,
1919
parseField)
20-
import Data.Text hiding (empty, length, reverse)
20+
import Data.Text (Text)
2121
import qualified Data.Text as Text
2222
import Data.Vector (Vector)
2323
import qualified Data.Vector as Vector
@@ -63,7 +63,7 @@ parseFromObjInner :: Object -> Parser Message
6363
parseFromObjInner obj = do
6464
messageId_ <- parseField obj "mid"
6565
messageId <- maybe (parseFail "parseFromObjInner: No `mid' field found.") pure
66-
(stripBrackets messageId_ >>= readMaybe @MessageID . unpack)
66+
(stripBrackets messageId_ >>= readMaybe @MessageID . Text.unpack)
6767

6868
kind <- parseField @String obj "kind"
6969
workload <- parseField @String obj "workload"
@@ -73,7 +73,7 @@ parseFromObjInner obj = do
7373
Just workloadInt -> pure $ Message1 messageId workloadInt
7474
Nothing -> parseFail ("FromJSON Message: Could not parse 'workload' field: " ++ workload ++ "\n + " ++ show obj)
7575
"Message2" ->
76-
pure $ Message2 messageId (pack workload)
76+
pure $ Message2 messageId (Text.pack workload)
7777
"Message3" ->
7878
case readMaybe @Double workload of
7979
Just workloadDouble -> pure $ Message3 messageId workloadDouble

flake.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
};
4343

4444
hackageNix = {
45-
url = "github:input-output-hk/hackage.nix";
45+
url = "github:input-output-hk/hackage.nix?ref=for-stackage";
4646
flake = false;
4747
};
4848

trace-dispatcher/src/Cardano/Logging/TraceDispatcherMessage.hs

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import Cardano.Logging.Types
1212
import Data.Aeson hiding (Error)
1313
import Data.ByteString.Lazy (toStrict)
1414
import qualified Data.Map as Map
15-
import Data.Text
16-
import Data.Text.Encoding
15+
import Data.Text (Text)
16+
import qualified Data.Text as Text
17+
import qualified Data.Text.Encoding as Text
1718

1819
data UnknownNamespaceKind =
1920
UKFSeverity
@@ -51,20 +52,20 @@ data TraceDispatcherMessage =
5152
instance LogFormatting TraceDispatcherMessage where
5253
forHuman (StartLimiting txt) = "Start of frequency limiting for " <> txt
5354
forHuman (StopLimiting txt num) = "Stop of frequency limiting for " <> txt <>
54-
". Suppressed " <> pack (show num) <> " messages."
55+
". Suppressed " <> textShow num <> " messages."
5556
forHuman (RememberLimiting txt num) = "Frequency limiting still active for " <> txt <>
56-
". Suppressed so far " <> pack (show num) <> " messages."
57+
". Suppressed so far " <> textShow num <> " messages."
5758
forHuman (UnknownNamespace nsPrefixNS nsInnerNS qk) = "Unknown namespace detected "
58-
<> intercalate (singleton '.') (nsPrefixNS ++ nsInnerNS)
59-
<> ". Used for querying " <> (pack . show) qk <> "."
59+
<> Text.intercalate (Text.singleton '.') (nsPrefixNS ++ nsInnerNS)
60+
<> ". Used for querying " <> textShow qk <> "."
6061
forHuman (TracerInfo silent noMetrics allTracers) = "The tracing system has silent the following tracer,"
6162
<> " as they will never have any output according to the current config: "
62-
<> intercalate (singleton ' ') silent <> ". The following tracers will not emit metrics "
63-
<> intercalate (singleton ' ') noMetrics <> ". Here is a complete list of all tracers: "
64-
<> intercalate (singleton ' ') allTracers <> "."
65-
forHuman (MetricsInfo mmap) = "Number of metrics delivered, " <> (pack . show) mmap
66-
forHuman (TracerConsistencyWarnings errs) = "Consistency check found error: " <> (pack . show) errs
67-
forHuman (TracerInfoConfig tc) = "Effective Tracer config is: " <> decodeUtf8 (toStrict (encode tc))
63+
<> Text.intercalate (Text.singleton ' ') silent <> ". The following tracers will not emit metrics "
64+
<> Text.intercalate (Text.singleton ' ') noMetrics <> ". Here is a complete list of all tracers: "
65+
<> Text.intercalate (Text.singleton ' ') allTracers <> "."
66+
forHuman (MetricsInfo mmap) = "Number of metrics delivered, " <> textShow mmap
67+
forHuman (TracerConsistencyWarnings errs) = "Consistency check found error: " <> textShow errs
68+
forHuman (TracerInfoConfig tc) = "Effective Tracer config is: " <> Text.decodeUtf8 (toStrict (encode tc))
6869

6970

7071
forMachine _dtl StartLimiting {} = mconcat
@@ -80,23 +81,23 @@ instance LogFormatting TraceDispatcherMessage where
8081
]
8182
forMachine _dtl (UnknownNamespace nsun nsleg query) = mconcat
8283
[ "kind" .= String "UnknownNamespace"
83-
, "unknownNamespace" .= String (intercalate (singleton '.') nsun)
84-
, "legalNamespace" .= String (intercalate (singleton '.') nsleg)
85-
, "querying" .= String ((pack . show) query)
84+
, "unknownNamespace" .= String (Text.intercalate (Text.singleton '.') nsun)
85+
, "legalNamespace" .= String (Text.intercalate (Text.singleton '.') nsleg)
86+
, "querying" .= String (textShow query)
8687
]
8788
forMachine _dtl (TracerInfo silent noMetrics allTracers) = mconcat
8889
[ "kind" .= String "TracerMeta"
89-
, "silentTracers" .= String (intercalate (singleton ' ') silent)
90-
, "noMetrics" .= String (intercalate (singleton ' ') noMetrics)
91-
, "allTracers" .= String (intercalate (singleton ' ') allTracers)
90+
, "silentTracers" .= String (Text.intercalate (Text.singleton ' ') silent)
91+
, "noMetrics" .= String (Text.intercalate (Text.singleton ' ') noMetrics)
92+
, "allTracers" .= String (Text.intercalate (Text.singleton ' ') allTracers)
9293
]
9394
forMachine _dtl (MetricsInfo mmap) = mconcat
9495
[ "kind" .= String "MetricsInfo"
95-
, "metrics count" .= String ((pack . show) mmap)
96+
, "metrics count" .= String (textShow mmap)
9697
]
9798
forMachine _dtl (TracerConsistencyWarnings errs) = mconcat
9899
[ "kind" .= String "TracerConsistencyWarnings"
99-
, "errors" .= String ((pack . show) errs)
100+
, "errors" .= String (textShow errs)
100101
]
101102
forMachine _dtl (TracerInfoConfig tc) = mconcat
102103
[ "conf" .= toJSON tc
@@ -182,3 +183,8 @@ instance MetaTrace TraceDispatcherMessage where
182183
, Namespace [] ["TracerConsistencyWarnings"]
183184
, Namespace [] ["TracerConfigInfo"]
184185
]
186+
187+
-- `text-2.1.2` provides `Text.show` which can replace this when
188+
-- the lower bound for `text` is high enough.
189+
textShow :: Show a => a -> Text
190+
textShow = Text.pack . show

trace-dispatcher/src/Cardano/Logging/Version.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ import Ouroboros.Network.Protocol.Handshake.Version (Accept (..), Acce
1616
import qualified Codec.CBOR.Term as CBOR
1717
import Data.Text (Text)
1818
import qualified Data.Text as T
19-
import Data.Typeable (Typeable)
2019

2120
data ForwardingVersion
2221
= ForwardingV_1
2322
| ForwardingV_2
24-
deriving (Eq, Ord, Enum, Bounded, Show, Typeable)
23+
deriving (Eq, Ord, Enum, Bounded, Show)
2524

2625
forwardingVersionCodec :: CodecCBORTerm (Text, Maybe Int) ForwardingVersion
2726
forwardingVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm }
@@ -40,7 +39,7 @@ forwardingVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm }
4039

4140
newtype ForwardingVersionData = ForwardingVersionData
4241
{ networkMagic :: NetworkMagic
43-
} deriving (Eq, Show, Typeable)
42+
} deriving (Eq, Show)
4443

4544
instance Acceptable ForwardingVersionData where
4645
acceptableVersion local remote

trace-forward/src/Trace/Forward/Run/TraceObject/Acceptor.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ acceptorActions config@AcceptorConfiguration{whatToRequest, shouldWeStop} loHand
8787
(return $ acceptorActions config loHandler)
8888

8989
data Timeout = Timeout
90-
deriving (Typeable, Show)
90+
deriving Show
9191

9292
instance Exception Timeout where
9393

0 commit comments

Comments
 (0)