Skip to content

Commit e5be6f0

Browse files
authored
Drop GHC 8.10 (#1489)
The node already uses 9.6, so we can finally drop 8.10 and get rid of a lot of cruft. I tried to remove everything I could find by grepping for a few ad-hoc regexes; maybe there is more, but we can remove that as we go. Follow-up work (like upgrading from `Haskell2010` to `GHC2021`) can happen in later PRs as it needs more discussion.
2 parents cf2a4c0 + 55821c5 commit e5be6f0

File tree

32 files changed

+89
-237
lines changed

32 files changed

+89
-237
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
ghc: ["8.10.7", "9.6.6", "9.10.1", "9.12"]
41+
ghc: ["9.6.6", "9.10.1", "9.12"]
4242
variant: [default, no-thunks]
4343
test-set: [all, no-thunks-safe]
4444
exclude:
@@ -193,7 +193,7 @@ jobs:
193193
strategy:
194194
fail-fast: false
195195
matrix:
196-
ghc: ["8.10.7", "9.6.6", "9.10.1"]
196+
ghc: ["9.6.6", "9.10.1"]
197197

198198
steps:
199199
- uses: actions/checkout@v4

nix/ci.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ let
4242
formattingLinting = import ./formatting-linting.nix pkgs;
4343
inherit (pkgs) consensus-pdfs agda-spec;
4444

45-
# ensure we can still build on 8.10, can be removed soon
46-
haskell810 = builtins.removeAttrs
47-
(mkHaskellJobsFor pkgs.hsPkgs.projectVariants.ghc810)
48-
[ "checks" "devShell" "devShellProfiled" ];
49-
5045
# also already test GHC 9.10, but only on Linux to reduce CI load
5146
haskell910 = mkHaskellJobsFor pkgs.hsPkgs.projectVariants.ghc910;
5247
};

nix/haskell.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ let
1616
src = ./..;
1717
compiler-nix-name = "ghc966";
1818
flake.variants = {
19-
ghc810 = { compiler-nix-name = lib.mkForce "ghc8107"; };
2019
ghc910 = { compiler-nix-name = lib.mkForce "ghc9101"; };
2120
};
2221
inputMap = {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Non-Breaking
2+
3+
- Drop GHC 8.10 support.

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ library
171171
validation,
172172
vector-map,
173173

174-
-- GHC 8.10.7 on aarch64-darwin cannot use text-2
175-
build-depends: text >=1.2.5.0 && <2.2
176-
177174
library unstable-byronspec
178175
import: common-lib
179176
visibility: public

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Ledger.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@
2020
-- TODO: can we un-orphan this module?
2121
{-# OPTIONS_GHC -Wno-orphans #-}
2222

23-
#if __GLASGOW_HASKELL__ <= 906
24-
{-# OPTIONS_GHC -Wno-incomplete-patterns
25-
-Wno-incomplete-uni-patterns
26-
-Wno-incomplete-record-updates
27-
-Wno-overlapping-patterns #-}
28-
#endif
29-
3023
module Ouroboros.Consensus.Cardano.Ledger (
3124
CardanoTxOut (..)
3225
, eliminateCardanoTxOut

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@
1717

1818
{-# OPTIONS_GHC -Wno-orphans #-}
1919

20-
-- Disable completeness checks on GHC versions pre-9.6, where this can be
21-
-- exceptionally slow:
22-
#if __GLASGOW_HASKELL__ <= 906
23-
{-# OPTIONS_GHC -Wno-incomplete-patterns
24-
-Wno-incomplete-uni-patterns
25-
-Wno-incomplete-record-updates
26-
-Wno-overlapping-patterns #-}
27-
#endif
28-
29-
-- TODO: this is required for ghc-8.10.7, because using NamedFieldPuns and
30-
-- PatternSynonyms with record syntax results in warnings related to shadowing.
31-
-- This can be removed once we drop ghc-8.10.7.
32-
33-
{-# OPTIONS_GHC -Wno-name-shadowing #-}
34-
3520
module Ouroboros.Consensus.Cardano.Node (
3621
CardanoHardForkConstraints
3722
, CardanoHardForkTrigger (..)
@@ -831,10 +816,10 @@ protocolInfoCardano paramsCardano
831816
ShelleyBasedEra era
832817
=> WrapTransitionConfig (ShelleyBlock proto era)
833818
-> (Flip LedgerState ValuesMK -.-> Flip LedgerState ValuesMK) (ShelleyBlock proto era)
834-
injectIntoTestState (WrapTransitionConfig cfg) = fn $ \(Flip st) ->
819+
injectIntoTestState (WrapTransitionConfig tcfg) = fn $ \(Flip st) ->
835820
-- We need to unstow the injected values
836821
Flip $ unstowLedgerTables $ forgetLedgerTables $ st {
837-
Shelley.shelleyLedgerState = L.injectIntoTestState cfg
822+
Shelley.shelleyLedgerState = L.injectIntoTestState tcfg
838823
(Shelley.shelleyLedgerState $ stowLedgerTables st)
839824
}
840825

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/QueryHF.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
{-# LANGUAGE UndecidableSuperClasses #-}
1818

1919
{-# OPTIONS_GHC -Wno-orphans #-}
20-
#if __GLASGOW_HASKELL__ <= 906
21-
{-# OPTIONS_GHC -Wno-incomplete-patterns
22-
-Wno-incomplete-uni-patterns
23-
-Wno-incomplete-record-updates
24-
-Wno-overlapping-patterns #-}
25-
#endif
2620

2721
module Ouroboros.Consensus.Cardano.QueryHF () where
2822

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@
2121
{-# LANGUAGE UndecidableInstances #-}
2222

2323
{-# OPTIONS_GHC -Wno-orphans #-}
24-
#if __GLASGOW_HASKELL__ <= 906
25-
{-# OPTIONS_GHC -Wno-incomplete-patterns
26-
-Wno-incomplete-uni-patterns
27-
-Wno-incomplete-record-updates
28-
-Wno-overlapping-patterns #-}
29-
#endif
3024

3125
module Ouroboros.Consensus.Shelley.Ledger.Ledger (
3226
LedgerState (..)

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
{-# LANGUAGE UndecidableInstances #-}
2121

2222
{-# OPTIONS_GHC -Wno-orphans #-}
23-
#if __GLASGOW_HASKELL__ <= 906
24-
{-# OPTIONS_GHC -Wno-incomplete-patterns
25-
-Wno-incomplete-uni-patterns
26-
-Wno-incomplete-record-updates
27-
-Wno-overlapping-patterns #-}
28-
#endif
2923

3024
module Ouroboros.Consensus.Shelley.Ledger.Query (
3125
BlockQuery (..)

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Protocol/Praos.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
{-# LANGUAGE TypeFamilies #-}
55

66
{-# OPTIONS_GHC -Wno-orphans #-}
7-
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/14630. GHC currently warns
8-
-- (erroneously) about name shadowing for record field selectors defined by
9-
-- pattern synonyms. This can be deleted once GHC 8.10.7 is gone.
10-
{-# OPTIONS_GHC -Wno-name-shadowing #-}
117

128
module Ouroboros.Consensus.Shelley.Protocol.Praos (PraosEnvelopeError (..)) where
139

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,7 @@ showEBBs AnalysisEnv { db, registry, startFrom, limit, tracer } = do
371371
storeLedgerStateAt ::
372372
forall blk .
373373
( LedgerSupportsProtocol blk
374-
#if __GLASGOW_HASKELL__ > 810
375374
, HasAnalysis blk
376-
#endif
377375
)
378376
=> SlotNo
379377
-> LedgerApplicationMode
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Non-Breaking
2+
3+
- Drop GHC 8.10 support.

ouroboros-consensus-diffusion/ouroboros-consensus-diffusion.cabal

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ library
107107
typed-protocols,
108108
typed-protocols-stateful,
109109

110-
-- GHC 8.10.7 on aarch64-darwin cannot use text-2
111-
build-depends: text >=1.2.5.0 && <2.2
112-
113110
library unstable-diffusion-testlib
114111
import: common-lib
115112
visibility: public

ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Setup/Classifiers.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import qualified Data.List.NonEmpty as NonEmpty
2121
import qualified Data.Map as Map
2222
import Data.Maybe (mapMaybe)
2323
import Data.Word (Word64)
24-
import Ouroboros.Consensus.Block (ChainHash (BlockHash), HeaderHash,
24+
import Ouroboros.Consensus.Block (ChainHash (..), HeaderHash,
2525
blockSlot, succWithOrigin)
2626
import Ouroboros.Consensus.Block.Abstract (SlotNo (SlotNo),
2727
withOrigin)
@@ -269,6 +269,4 @@ simpleHash ::
269269
[Word64]
270270
simpleHash = \case
271271
BlockHash (TestHash h) -> reverse (NonEmpty.toList h)
272-
-- not matching on @GenesisHash@ because 8.10 can't prove exhaustiveness of
273-
-- TestHash with the equality constraint
274-
_ -> []
272+
GenesisHash -> []

ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PointSchedule/Shrinking/Tests.hs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module Test.Consensus.PointSchedule.Shrinking.Tests (tests) where
88
import Data.Foldable (toList)
99
import Data.Map (keys)
1010
import Data.Maybe (mapMaybe)
11+
import Ouroboros.Consensus.Util (lastMaybe)
1112
import Test.Consensus.Genesis.Setup (genChains)
1213
import Test.Consensus.Genesis.Tests.Uniform (genUniformSchedulePoints)
1314
import Test.Consensus.PointSchedule (PeerSchedule, PointSchedule (..),
@@ -35,12 +36,6 @@ prop_shortens = checkShrinkProperty isShorterThan
3536
prop_preservesFinalStates :: Property
3637
prop_preservesFinalStates = checkShrinkProperty doesNotChangeFinalState
3738

38-
-- | Apparently, `unsnoc` hasn't been invented yet, so we'll do this manually
39-
lastM :: [a] -> Maybe a
40-
lastM [] = Nothing
41-
lastM [a] = Just a
42-
lastM (_:ps) = lastM ps
43-
4439
samePeers :: Peers (PeerSchedule blk) -> Peers (PeerSchedule blk) -> Bool
4540
samePeers sch1 sch2 =
4641
(keys $ adversarialPeers sch1)
@@ -53,7 +48,7 @@ isShorterThan :: Peers (PeerSchedule blk) -> Peers (PeerSchedule blk) -> Bool
5348
isShorterThan original shrunk =
5449
samePeers original shrunk
5550
&& (or $ zipWith
56-
(\oldSch newSch -> (fst <$> lastM newSch) < (fst <$> lastM oldSch))
51+
(\oldSch newSch -> (fst <$> lastMaybe newSch) < (fst <$> lastMaybe oldSch))
5752
(toList original)
5853
(toList shrunk)
5954
)
@@ -72,11 +67,11 @@ doesNotChangeFinalState original shrunk =
7267
)
7368
where
7469
lastTP :: PeerSchedule blk -> Maybe (SchedulePoint blk)
75-
lastTP sch = lastM $ mapMaybe (\case (_, p@(ScheduleTipPoint _)) -> Just p ; _ -> Nothing) sch
70+
lastTP sch = lastMaybe $ mapMaybe (\case (_, p@(ScheduleTipPoint _)) -> Just p ; _ -> Nothing) sch
7671
lastHP :: PeerSchedule blk -> Maybe (SchedulePoint blk)
77-
lastHP sch = lastM $ mapMaybe (\case (_, p@(ScheduleHeaderPoint _)) -> Just p ; _ -> Nothing) sch
72+
lastHP sch = lastMaybe $ mapMaybe (\case (_, p@(ScheduleHeaderPoint _)) -> Just p ; _ -> Nothing) sch
7873
lastBP :: PeerSchedule blk -> Maybe (SchedulePoint blk)
79-
lastBP sch = lastM $ mapMaybe (\case (_, p@(ScheduleBlockPoint _)) -> Just p ; _ -> Nothing) sch
74+
lastBP sch = lastMaybe $ mapMaybe (\case (_, p@(ScheduleBlockPoint _)) -> Just p ; _ -> Nothing) sch
8075

8176
checkShrinkProperty :: (Peers (PeerSchedule TestBlock) -> Peers (PeerSchedule TestBlock) -> Bool) -> Property
8277
checkShrinkProperty prop =
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Non-Breaking
2+
3+
- Drop GHC 8.10 support.

ouroboros-consensus/ouroboros-consensus.cabal

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ common common-bench
6161
-- We use this option to avoid skewed results due to changes in cache-line
6262
-- alignment. See
6363
-- https://github.com/Bodigrim/tasty-bench#comparison-against-baseline
64-
if impl(ghc >=8.6)
65-
ghc-options: -fproc-alignment=64
64+
ghc-options: -fproc-alignment=64
6665

6766
library
6867
import: common-lib
@@ -356,10 +355,6 @@ library
356355
typed-protocols ^>=0.3,
357356
vector ^>=0.13,
358357

359-
if !impl(ghc >=9.4)
360-
build-depends: data-array-byte
361-
-- GHC 8.10.7 on aarch64-darwin cannot use text-2
362-
build-depends: text >=1.2.5.0 && <2.2
363358
x-docspec-extra-packages:
364359
directory
365360
latex-svg-image

0 commit comments

Comments
 (0)