diff --git a/bench/locli/locli.cabal b/bench/locli/locli.cabal index f95d38578d6..5d2ee1aa961 100644 --- a/bench/locli/locli.cabal +++ b/bench/locli/locli.cabal @@ -50,6 +50,9 @@ common project-config -Wcompat -Wno-all-missed-specialisations + if impl(ghc >= 9.8) + ghc-options: -Wno-x-partial + build-depends: base >= 4.14 && < 5, if os(windows) diff --git a/bench/locli/src/Cardano/Analysis/API/Ground.hs b/bench/locli/src/Cardano/Analysis/API/Ground.hs index e2aa080f281..d3a7f25a693 100644 --- a/bench/locli/src/Cardano/Analysis/API/Ground.hs +++ b/bench/locli/src/Cardano/Analysis/API/Ground.hs @@ -1,7 +1,6 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralisedNewtypeDeriving #-} -{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE PolyKinds #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Analysis.API.Ground diff --git a/bench/locli/src/Cardano/Analysis/BlockProp.hs b/bench/locli/src/Cardano/Analysis/BlockProp.hs index 116adb6ce0d..ba24ce6fca7 100644 --- a/bench/locli/src/Cardano/Analysis/BlockProp.hs +++ b/bench/locli/src/Cardano/Analysis/BlockProp.hs @@ -1,17 +1,9 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE StrictData #-} -#if __GLASGOW_HASKELL__ >= 908 -{-# OPTIONS_GHC -Wno-x-partial #-} -#endif - {-# OPTIONS_GHC -Wno-incomplete-patterns -Wno-name-shadowing #-} -{-# OPTIONS_GHC -Wno-unused-imports -Wno-partial-fields -Wno-unused-matches -Wno-incomplete-record-updates #-} -{- HLINT ignore "Avoid lambda" -} {- HLINT ignore "Eta reduce" -} -{- HLINT ignore "Use head" -} module Cardano.Analysis.BlockProp ( summariseMultiBlockProp @@ -25,42 +17,18 @@ module Cardano.Analysis.BlockProp ) where -import Prelude (String, (!!), error, head, last, id, show, tail, read) -import Cardano.Prelude hiding (head, show) - -import Control.Arrow ((***), (&&&)) -import Data.Aeson (ToJSON(..), FromJSON(..)) -import Data.Bifunctor -import Data.Function (on) -import Data.List (break, dropWhileEnd, intercalate, partition, span) -import Data.Map.Strict (Map) -import Data.Map.Strict qualified as Map -import Data.Maybe (catMaybes, mapMaybe, isNothing) -import Data.Set (Set) -import Data.Set qualified as Set -import Data.Text qualified as T -import Data.Text.Short (toText) -import Data.Tuple (swap) -import Data.Tuple.Extra (both, fst3, snd3, thd3) -import Data.Vector (Vector) -import Data.Vector qualified as Vec - -import Data.Time.Clock (NominalDiffTime, UTCTime, addUTCTime, diffUTCTime) - -import Text.Printf (printf) - -import Cardano.Slotting.Slot (EpochNo(..), SlotNo(..)) -import Ouroboros.Network.Block (BlockNo(..)) - -import Data.Accum -import Data.CDF +import Cardano.Analysis.API +import Cardano.Prelude hiding (head, show) +import Cardano.Unlog.LogObject +import Cardano.Util -import Cardano.Render -import Cardano.Unlog.LogObject -import Cardano.Unlog.Resources -import Cardano.Util +import Prelude (id, read, show) -import Cardano.Analysis.API +import Data.List (partition) +import qualified Data.Map.Strict as Map +import qualified Data.Set as Set +import qualified Data.Text as T +import Data.Tuple.Extra (both, fst3, snd3, thd3) summariseMultiBlockProp :: [Centile] -> [BlockPropOne] -> Either CDFError MultiBlockProp @@ -300,7 +268,7 @@ blockEventsAcceptance :: Genesis -> [ChainFilter] -> BlockEvents -> [(ChainFilte blockEventsAcceptance genesis flts be = flts <&> (id &&& testBlockEvents genesis be) rebuildChain :: Run -> [ChainFilter] -> [FilterName] -> [(LogObjectSource, MachView)] -> Chain -rebuildChain run@Run{genesis} flts fltNames xs@(fmap snd -> machViews) = +rebuildChain Run{genesis} flts _fltNames (fmap snd -> machViews) = Chain { cDomSlots = DataDomain (Interval (blk0 & beSlotNo) (blkL & beSlotNo) <&> I) @@ -406,7 +374,7 @@ rebuildChain run@Run{genesis} flts fltNames xs@(fmap snd -> machViews) = [ "No forger for hash ", show hash , "\nErrors:\n" ] ++ intercalate "\n" (show <$> ers) - blkEvs@(forgerEv:_, oEvs, ers) -> + (forgerEv:_, oEvs, ers) -> go (bfePrevBlock forgerEv) (liftBlockEvents forgerEv oEvs ers : acc) liftBlockEvents :: ForgerEvents NominalDiffTime -> [ObserverEvents NominalDiffTime] -> [BPError] -> BlockEvents @@ -536,7 +504,7 @@ renderBlockPropError = \case rejs blockProp :: Run -> Chain -> Either BlockPropError BlockPropOne -blockProp run@Run{genesis} Chain{..} = do +blockProp _ Chain{..} = do (c :: [BlockEvents]) <- case filter (all snd . beAcceptance) cMainChain of [] -> Left $ @@ -626,7 +594,7 @@ blockProp run@Run{genesis} Chain{..} = do -- | Given a single machine's log object stream, recover its block map. blockEventMapsFromLogObjects :: Run -> (LogObjectSource, [LogObject]) -> MachView -blockEventMapsFromLogObjects run (f, []) = +blockEventMapsFromLogObjects _ (f, []) = error $ mconcat ["0 LogObjects in ", logObjectSourceFile f] blockEventMapsFromLogObjects run (f, xs@(x:_)) = foldl' (blockPropMachEventsStep run f) initial xs @@ -645,7 +613,7 @@ blockEventMapsFromLogObjects run (f, xs@(x:_)) = } blockPropMachEventsStep :: Run -> LogObjectSource -> MachView -> LogObject -> MachView -blockPropMachEventsStep run@Run{genesis} _ mv@MachView{..} lo = case lo of +blockPropMachEventsStep Run{genesis} _ mv@MachView{..} lo = case lo of -- 0. Notice (observer only) LogObject{loAt, loHost, loBody=LOChainSyncClientSeenHeader{loBlock,loBlockNo,loSlotNo}} -> let mbe0 = getBlock loBlock diff --git a/bench/locli/src/Cardano/Analysis/MachPerf.hs b/bench/locli/src/Cardano/Analysis/MachPerf.hs index 2b71090acf1..e77c0b1820e 100644 --- a/bench/locli/src/Cardano/Analysis/MachPerf.hs +++ b/bench/locli/src/Cardano/Analysis/MachPerf.hs @@ -1,12 +1,8 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE MultiWayIf #-} -#if __GLASGOW_HASKELL__ >= 908 -{-# OPTIONS_GHC -Wno-x-partial #-} -#endif - {-# OPTIONS_GHC -Wno-incomplete-patterns -Wno-name-shadowing #-} + {- HLINT ignore "Use head" -} {- HLINT ignore "Evaluate" -} diff --git a/bench/locli/src/Cardano/Analysis/Summary.hs b/bench/locli/src/Cardano/Analysis/Summary.hs index 7994c08e2d6..3ff775af4a4 100644 --- a/bench/locli/src/Cardano/Analysis/Summary.hs +++ b/bench/locli/src/Cardano/Analysis/Summary.hs @@ -1,11 +1,6 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralisedNewtypeDeriving #-} {-# LANGUAGE UndecidableInstances #-} -#if __GLASGOW_HASKELL__ >= 908 -{-# OPTIONS_GHC -Wno-x-partial #-} -#endif - {-# OPTIONS_GHC -Wno-name-shadowing -Wno-orphans #-} {- HLINT ignore "Use mapMaybe" -} diff --git a/bench/locli/src/Cardano/Render.hs b/bench/locli/src/Cardano/Render.hs index 784df301d7f..827a709b112 100644 --- a/bench/locli/src/Cardano/Render.hs +++ b/bench/locli/src/Cardano/Render.hs @@ -1,11 +1,6 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} -#if __GLASGOW_HASKELL__ >= 908 -{-# OPTIONS_GHC -Wno-x-partial #-} -#endif - {- HLINT ignore "Use concatMap" -} {- HLINT ignore "Use fromMaybe" -} diff --git a/bench/locli/test/Test/Analysis/CDF.hs b/bench/locli/test/Test/Analysis/CDF.hs index 3f330f9f439..c859d65fbcc 100644 --- a/bench/locli/test/Test/Analysis/CDF.hs +++ b/bench/locli/test/Test/Analysis/CDF.hs @@ -1,11 +1,6 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-missing-signatures #-} -#if __GLASGOW_HASKELL__ >= 908 -{-# OPTIONS_GHC -Wno-x-partial #-} -#endif - module Test.Analysis.CDF where import Cardano.Prelude hiding (handle, head)