Skip to content

Commit 753c40a

Browse files
authored
Update index states (#1449)
# Description * Update index-states * Remove some `allow-newer` stanzas. Also note that: - New code should be properly tested (even if it does not add new features). - The fix for a regression should include a test that reproduces said regression.
2 parents da502c2 + 9ebbb56 commit 753c40a

File tree

10 files changed

+56
-71
lines changed

10 files changed

+56
-71
lines changed

cabal.project

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ repository cardano-haskell-packages
1414
-- update either of these.
1515
index-state:
1616
-- Bump this if you need newer packages from Hackage
17-
, hackage.haskell.org 2025-03-18T17:41:11Z
17+
, hackage.haskell.org 2025-04-06T22:39:33Z
1818
-- Bump this if you need newer packages from CHaP
19-
, cardano-haskell-packages 2025-03-25T12:18:59Z
19+
, cardano-haskell-packages 2025-04-07T00:07:03Z
2020

2121
packages:
2222
ouroboros-consensus
@@ -52,23 +52,8 @@ if impl (ghc >= 9.12)
5252
, fin:base
5353
, ral:base
5454

55-
-- https://github.com/well-typed/cborg/pull/339
56-
, cborg:base
57-
, cborg:ghc-prim
58-
, serialise:base
59-
, serialise:ghc-prim
60-
6155
-- https://github.com/haskellari/tree-diff/issues/97
6256
, tree-diff:base
6357

6458
-- https://github.com/kapralVV/Unique/issues/11
6559
, Unique:hashable
66-
67-
-- https://github.com/fizruk/http-api-data/pull/146
68-
, http-api-data:base
69-
70-
, ouroboros-network-protocols:base
71-
, ouroboros-network-framework:base
72-
, ouroboros-network-api:base
73-
, network-mux:base
74-
, ouroboros-network:base

flake.lock

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

ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ library unstable-cardano-tools
572572
sop-extras,
573573
strict-sop-core,
574574
text,
575-
text-builder,
575+
text-builder >=0.6.10,
576576
transformers,
577577
transformers-except,
578578

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Analysis/BenchmarkLedgerOps/FileWriting.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import Data.Aeson as Aeson
2121
import qualified Data.ByteString.Lazy as BSL
2222
import System.FilePath.Posix (takeExtension)
2323
import qualified System.IO as IO
24-
import qualified Text.Builder as Builder
25-
import Text.Builder (Builder, decimal)
24+
import qualified TextBuilder as Builder
25+
import TextBuilder (TextBuilder, decimal)
2626

2727
{-------------------------------------------------------------------------------
2828
Output format
@@ -54,7 +54,7 @@ getOutputFormat Nothing = pure CSV
5454
-------------------------------------------------------------------------------}
5555

5656
-- | Separator used for CSV output.
57-
csvSeparator :: Builder
57+
csvSeparator :: TextBuilder
5858
csvSeparator = "\t"
5959

6060
-- | Write a header for the data points.
@@ -97,7 +97,7 @@ writeMetadata outFileHandle JSON lgrAppMode =
9797
Operations to assist CSV printing
9898
-------------------------------------------------------------------------------}
9999

100-
dataPointCsvBuilder :: [(Builder, SlotDataPoint -> Builder)]
100+
dataPointCsvBuilder :: [(TextBuilder, SlotDataPoint -> TextBuilder)]
101101
dataPointCsvBuilder =
102102
[ ("slot" , decimal . unSlotNo . DP.slot)
103103
, ("slotGap" , decimal . DP.slotGap)

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Analysis/BenchmarkLedgerOps/SlotDataPoint.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import qualified Data.Aeson.Encoding as Aeson.Encoding
1111
import Data.Int (Int64)
1212
import Data.Word (Word32, Word64)
1313
import GHC.Generics (Generic)
14-
import qualified Text.Builder as Builder
15-
import Text.Builder (Builder)
14+
import qualified TextBuilder as Builder
15+
import TextBuilder (TextBuilder)
1616

1717
-- | Information about the time spent processing the block corresponding to
1818
-- 'slot', divided into the five major operations:
@@ -60,14 +60,14 @@ data SlotDataPoint =
6060
, blockStats :: !BlockStats
6161
} deriving (Generic, Show)
6262

63-
newtype BlockStats = BlockStats { unBlockStats :: [Builder] }
63+
newtype BlockStats = BlockStats { unBlockStats :: [TextBuilder] }
6464
deriving (Generic, Show)
6565

6666
instance ToJSON BlockStats where
6767
-- We convert the blocks stats to a 'Vector Text'.
68-
toJSON = toJSON . fmap Builder.run . unBlockStats
68+
toJSON = toJSON . fmap Builder.toText . unBlockStats
6969

70-
toEncoding = Aeson.Encoding.list (Aeson.Encoding.text . Builder.run) . unBlockStats
70+
toEncoding = Aeson.Encoding.list (Aeson.Encoding.text . Builder.toText) . unBlockStats
7171

7272
instance ToJSON SlotDataPoint where
7373
toEncoding = Aeson.genericToEncoding Aeson.defaultOptions

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Byron.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import qualified Ouroboros.Consensus.Byron.Ledger as Byron
2727
import Ouroboros.Consensus.Byron.Node (PBftSignatureThreshold (..),
2828
ProtocolParamsByron (..), protocolInfoByron)
2929
import Ouroboros.Consensus.Node.ProtocolInfo
30-
import Text.Builder (decimal)
30+
import TextBuilder (decimal)
3131

3232
instance HasAnalysis ByronBlock where
3333
countTxOutputs = aBlockOrBoundary (const 0) countTxOutputsByron

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Cardano.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ import Ouroboros.Consensus.Shelley.Ledger.Block (IsShelleyBlock,
7474
import Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol ()
7575
import System.Directory (makeAbsolute)
7676
import System.FilePath (takeDirectory, (</>))
77-
import qualified Text.Builder as Builder
78-
import Text.Builder (Builder)
77+
import qualified TextBuilder as Builder
78+
import TextBuilder (TextBuilder)
7979

8080
analyseBlock ::
8181
(forall blk. HasAnalysis blk => blk -> a)
@@ -299,9 +299,9 @@ instance HasAnalysis (CardanoBlock StandardCrypto) where
299299

300300
dispatch ::
301301
LedgerState (CardanoBlock StandardCrypto)
302-
-> (LedgerState ByronBlock -> IO Builder)
303-
-> (forall proto era. LedgerState (ShelleyBlock proto era) -> IO Builder)
304-
-> IO Builder
302+
-> (LedgerState ByronBlock -> IO TextBuilder)
303+
-> (forall proto era. LedgerState (ShelleyBlock proto era) -> IO TextBuilder)
304+
-> IO TextBuilder
305305
dispatch cardanoSt fByron fShelley =
306306
hcollapse $
307307
hap ( fn k_fByron
@@ -320,13 +320,13 @@ dispatch cardanoSt fByron fShelley =
320320
k_fShelley ::
321321
forall proto era.
322322
LedgerState (ShelleyBlock proto era)
323-
-> K (IO Builder) (ShelleyBlock proto era)
323+
-> K (IO TextBuilder) (ShelleyBlock proto era)
324324
k_fShelley = K . fShelley
325325

326326
applyToByronUtxo ::
327-
(Map Byron.UTxO.CompactTxIn Byron.UTxO.CompactTxOut -> IO Builder)
327+
(Map Byron.UTxO.CompactTxIn Byron.UTxO.CompactTxOut -> IO TextBuilder)
328328
-> LedgerState ByronBlock
329-
-> IO Builder
329+
-> IO TextBuilder
330330
applyToByronUtxo f st =
331331
f $ getByronUtxo st
332332

@@ -337,9 +337,9 @@ getByronUtxo = Byron.UTxO.unUTxO
337337
. Byron.Ledger.byronLedgerState
338338

339339
applyToShelleyBasedUtxo ::
340-
(Map TxIn (TxOut era) -> IO Builder)
340+
(Map TxIn (TxOut era) -> IO TextBuilder)
341341
-> LedgerState (ShelleyBlock proto era)
342-
-> IO Builder
342+
-> IO TextBuilder
343343
applyToShelleyBasedUtxo f st = do
344344
f $ getShelleyBasedUtxo st
345345

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Shelley.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import qualified Ouroboros.Consensus.Shelley.Ledger.Block as Shelley
4747
import Ouroboros.Consensus.Shelley.Node (Nonce (..),
4848
ProtocolParamsShelleyBased (..), ShelleyGenesis,
4949
protocolInfoShelley)
50-
import Text.Builder (decimal)
50+
import TextBuilder (decimal)
5151

5252
-- | Usable for each Shelley-based era
5353
instance ( ShelleyCompatible proto era

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/CSV.hs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
-- correspondence between headers and data, we usually specify a CSV
1111
-- builder as:
1212
--
13-
-- > [(Builder, a -> IO Builder)]
13+
-- > [(TextBuilder, a -> IO TextBuilder)]
1414
--
1515
-- where each first component of each tuple in the list represents a
1616
-- header, and each second component determines how the value that
1717
-- corresponds to that header is computed, given a certain value that
1818
-- is needed to compute a row in the resulting CSV.
1919
--
20-
-- We use 'Text.Builder' to efficiently intercalate values with the CSV 'Separator'.
20+
-- We use 'TextBuilder' to efficiently intercalate values with the CSV 'Separator'.
2121
--
2222
module Cardano.Tools.DBAnalyser.CSV (
2323
Separator (Separator, unSeparator)
@@ -32,37 +32,37 @@ module Cardano.Tools.DBAnalyser.CSV (
3232
import Data.String (IsString)
3333
import qualified Data.Text.IO as Text.IO
3434
import qualified System.IO as IO
35-
import qualified Text.Builder as Builder
36-
import Text.Builder (Builder)
35+
import qualified TextBuilder as TextBuilder
36+
import TextBuilder (TextBuilder)
3737

38-
newtype Separator = Separator { unSeparator :: Builder }
38+
newtype Separator = Separator { unSeparator :: TextBuilder }
3939
deriving (Show, IsString, Monoid, Semigroup)
4040

41-
writeHeaderLine :: IO.Handle -> Separator -> [(Builder, a)] -> IO ()
41+
writeHeaderLine :: IO.Handle -> Separator -> [(TextBuilder, a)] -> IO ()
4242
writeHeaderLine handle (Separator separator) =
4343
Text.IO.hPutStrLn handle
44-
. Builder.run
45-
. Builder.intercalate separator
44+
. TextBuilder.toText
45+
. TextBuilder.intercalate separator
4646
. fmap fst
4747

48-
writeLine :: IO.Handle -> Separator -> [Builder] -> IO ()
48+
writeLine :: IO.Handle -> Separator -> [TextBuilder] -> IO ()
4949
writeLine handle (Separator separator) =
5050
Text.IO.hPutStrLn handle
51-
. Builder.run
52-
. Builder.intercalate separator
51+
. TextBuilder.toText
52+
. TextBuilder.intercalate separator
5353

54-
computeAndWriteLine :: IO.Handle -> Separator -> [(a, b -> IO Builder)] -> b -> IO ()
55-
computeAndWriteLine handle separator csvBuilder b = do
56-
computeColumns (fmap snd csvBuilder) b >>= writeLine handle separator
54+
computeAndWriteLine :: IO.Handle -> Separator -> [(a, b -> IO TextBuilder)] -> b -> IO ()
55+
computeAndWriteLine handle separator csvTextBuilder b = do
56+
computeColumns (fmap snd csvTextBuilder) b >>= writeLine handle separator
5757

58-
computeAndWriteLinePure :: IO.Handle -> Separator -> [(a, b -> Builder)] -> b -> IO ()
59-
computeAndWriteLinePure handle separator csvBuilder b =
60-
writeLine handle separator $ computeColumnsPure (fmap snd csvBuilder) b
58+
computeAndWriteLinePure :: IO.Handle -> Separator -> [(a, b -> TextBuilder)] -> b -> IO ()
59+
computeAndWriteLinePure handle separator csvTextBuilder b =
60+
writeLine handle separator $ computeColumnsPure (fmap snd csvTextBuilder) b
6161

62-
computeColumns :: [a -> IO Builder] -> a -> IO [Builder]
63-
computeColumns fBuilders a =
64-
sequence $ fmap ($ a) fBuilders
62+
computeColumns :: [a -> IO TextBuilder] -> a -> IO [TextBuilder]
63+
computeColumns fTextBuilders a =
64+
sequence $ fmap ($ a) fTextBuilders
6565

66-
computeColumnsPure :: [a -> Builder] -> a -> [Builder]
67-
computeColumnsPure fBuilders a =
68-
fmap ($ a) fBuilders
66+
computeColumnsPure :: [a -> TextBuilder] -> a -> [TextBuilder]
67+
computeColumnsPure fTextBuilders a =
68+
fmap ($ a) fTextBuilders

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/HasAnalysis.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Ouroboros.Consensus.Ledger.Abstract
1515
import Ouroboros.Consensus.Node.ProtocolInfo
1616
import Ouroboros.Consensus.Storage.Serialisation (SizeInBytes)
1717
import Ouroboros.Consensus.Util.Condense (Condense)
18-
import Text.Builder (Builder)
18+
import TextBuilder (TextBuilder)
1919

2020
{-------------------------------------------------------------------------------
2121
HasAnalysis
@@ -37,7 +37,7 @@ class (HasAnnTip blk, GetPrevHash blk, Condense (HeaderHash blk)) => HasAnalysis
3737
emitTraces :: WithLedgerState blk -> [String]
3838

3939
-- | This method was introduced for the sake of the 'BenchmarkLedgerOps' pass.
40-
blockStats :: blk -> [Builder]
40+
blockStats :: blk -> [TextBuilder]
4141

4242
-- | This function allows to define different metrics about block application.
4343
--
@@ -56,7 +56,7 @@ class (HasAnnTip blk, GetPrevHash blk, Condense (HeaderHash blk)) => HasAnalysis
5656
-- The block application metrics are mapped to an IO action because
5757
-- certain metrics such as the size of data need to be performed in
5858
-- the IO monad.
59-
blockApplicationMetrics :: [(Builder, WithLedgerState blk -> IO Builder)]
59+
blockApplicationMetrics :: [(TextBuilder, WithLedgerState blk -> IO TextBuilder)]
6060

6161
class HasProtocolInfo blk where
6262
data Args blk

0 commit comments

Comments
 (0)