diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-04-12 12:41:47 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-14 08:19:16 -0400 |
commit | 426ec4461c1723a8fe4be97404c7e6c10a10cee5 (patch) | |
tree | 4bd4833c641b6362a27bf0d0c92fb3b49d452222 /hadrian/src/Settings/Flavours | |
parent | df893f6667b31946ae7995150a6a5920602f7b0b (diff) | |
download | haskell-426ec4461c1723a8fe4be97404c7e6c10a10cee5.tar.gz |
Hadrian: use a set to keep track of ways
The order in which ways are provided doesn't matter,
so we use a data structure with the appropriate semantics to
represent ways.
Fixes #21378
Diffstat (limited to 'hadrian/src/Settings/Flavours')
-rw-r--r-- | hadrian/src/Settings/Flavours/Benchmark.hs | 5 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Development.hs | 6 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/GhcInGhci.hs | 6 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Quick.hs | 8 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/QuickCross.hs | 8 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Quickest.hs | 6 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Validate.hs | 8 |
7 files changed, 33 insertions, 14 deletions
diff --git a/hadrian/src/Settings/Flavours/Benchmark.hs b/hadrian/src/Settings/Flavours/Benchmark.hs index f0dcd7bead..e4c5de0199 100644 --- a/hadrian/src/Settings/Flavours/Benchmark.hs +++ b/hadrian/src/Settings/Flavours/Benchmark.hs @@ -1,5 +1,6 @@ module Settings.Flavours.Benchmark (benchmarkFlavour) where +import qualified Data.Set as Set import Expression import Flavour import {-# SOURCE #-} Settings.Default @@ -9,8 +10,8 @@ benchmarkFlavour :: Flavour benchmarkFlavour = defaultFlavour { name = "bench" , args = defaultBuilderArgs <> benchmarkArgs <> defaultPackageArgs - , libraryWays = pure [vanilla] - , rtsWays = pure [vanilla, threaded, logging, threadedLogging] } + , libraryWays = pure $ Set.fromList [vanilla] + , rtsWays = pure $ Set.fromList [vanilla, threaded, logging, threadedLogging] } benchmarkArgs :: Args benchmarkArgs = sourceArgs SourceArgs diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs index 9c0a342bac..94a008fc47 100644 --- a/hadrian/src/Settings/Flavours/Development.hs +++ b/hadrian/src/Settings/Flavours/Development.hs @@ -1,5 +1,7 @@ module Settings.Flavours.Development (developmentFlavour) where +import qualified Data.Set as Set + import Expression import Flavour import Packages @@ -10,8 +12,8 @@ developmentFlavour :: Stage -> Flavour developmentFlavour ghcStage = defaultFlavour { name = "devel" ++ show (fromEnum ghcStage) , args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs - , libraryWays = pure [vanilla] - , rtsWays = pure [vanilla, logging, debug, threaded, threadedLogging, threadedDebug] + , libraryWays = pure $ Set.fromList [vanilla] + , rtsWays = pure $ Set.fromList [vanilla, logging, debug, threaded, threadedLogging, threadedDebug] , dynamicGhcPrograms = return False , ghcDebugAssertions = True } diff --git a/hadrian/src/Settings/Flavours/GhcInGhci.hs b/hadrian/src/Settings/Flavours/GhcInGhci.hs index 950b96f926..b0859ffc56 100644 --- a/hadrian/src/Settings/Flavours/GhcInGhci.hs +++ b/hadrian/src/Settings/Flavours/GhcInGhci.hs @@ -1,5 +1,7 @@ module Settings.Flavours.GhcInGhci (ghcInGhciFlavour) where +import qualified Data.Set as Set + import Expression import Flavour import {-# SOURCE #-} Settings.Default @@ -12,8 +14,8 @@ ghcInGhciFlavour = defaultFlavour -- We can't build DLLs on Windows (yet). Actually we should only -- include the dynamic way when we have a dynamic host GHC, but just -- checking for Windows seems simpler for now. - , libraryWays = pure [vanilla] <> pure [ dynamic | not windowsHost ] - , rtsWays = pure [vanilla, threaded] <> pure [ dynamic | not windowsHost ] + , libraryWays = pure (Set.fromList [vanilla]) <> pure (Set.fromList [ dynamic | not windowsHost ]) + , rtsWays = pure (Set.fromList [vanilla, threaded]) <> pure (Set.fromList [ dynamic | not windowsHost ]) , dynamicGhcPrograms = return False } ghciArgs :: Args diff --git a/hadrian/src/Settings/Flavours/Quick.hs b/hadrian/src/Settings/Flavours/Quick.hs index c8ac089335..2ddf45b1a1 100644 --- a/hadrian/src/Settings/Flavours/Quick.hs +++ b/hadrian/src/Settings/Flavours/Quick.hs @@ -4,6 +4,8 @@ module Settings.Flavours.Quick ) where +import qualified Data.Set as Set + import Expression import Flavour import Oracles.Flag @@ -14,10 +16,12 @@ quickFlavour :: Flavour quickFlavour = defaultFlavour { name = "quick" , args = defaultBuilderArgs <> quickArgs <> defaultPackageArgs - , libraryWays = mconcat + , libraryWays = Set.fromList <$> + mconcat [ pure [vanilla] , notStage0 ? platformSupportsSharedLibs ? pure [dynamic] ] - , rtsWays = mconcat + , rtsWays = Set.fromList <$> + mconcat [ pure [ vanilla, threaded, logging, debug , threadedDebug, threadedLogging, threaded ] diff --git a/hadrian/src/Settings/Flavours/QuickCross.hs b/hadrian/src/Settings/Flavours/QuickCross.hs index 5e9dc05f08..35b0dcc988 100644 --- a/hadrian/src/Settings/Flavours/QuickCross.hs +++ b/hadrian/src/Settings/Flavours/QuickCross.hs @@ -1,5 +1,7 @@ module Settings.Flavours.QuickCross (quickCrossFlavour) where +import qualified Data.Set as Set + import Expression import Flavour import Oracles.Flag @@ -11,10 +13,12 @@ quickCrossFlavour = defaultFlavour { name = "quick-cross" , args = defaultBuilderArgs <> quickCrossArgs <> defaultPackageArgs , dynamicGhcPrograms = pure False - , libraryWays = mconcat + , libraryWays = Set.fromList <$> + mconcat [ pure [vanilla] , notStage0 ? platformSupportsSharedLibs ? pure [dynamic] ] - , rtsWays = mconcat + , rtsWays = Set.fromList <$> + mconcat [ pure [ vanilla, threaded, logging, debug , threadedDebug, threadedLogging, threaded ] diff --git a/hadrian/src/Settings/Flavours/Quickest.hs b/hadrian/src/Settings/Flavours/Quickest.hs index c0c7c9c446..6ab1ed3068 100644 --- a/hadrian/src/Settings/Flavours/Quickest.hs +++ b/hadrian/src/Settings/Flavours/Quickest.hs @@ -1,5 +1,7 @@ module Settings.Flavours.Quickest (quickestFlavour) where +import qualified Data.Set as Set + import Expression import Flavour import {-# SOURCE #-} Settings.Default @@ -9,8 +11,8 @@ quickestFlavour :: Flavour quickestFlavour = defaultFlavour { name = "quickest" , args = defaultBuilderArgs <> quickestArgs <> defaultPackageArgs - , libraryWays = pure [vanilla] - , rtsWays = pure [vanilla, threaded, threadedLogging, logging] + , libraryWays = pure (Set.fromList [vanilla]) + , rtsWays = pure (Set.fromList [vanilla, threaded, threadedLogging, logging]) , dynamicGhcPrograms = return False } quickestArgs :: Args diff --git a/hadrian/src/Settings/Flavours/Validate.hs b/hadrian/src/Settings/Flavours/Validate.hs index 7e54278f90..913e431b58 100644 --- a/hadrian/src/Settings/Flavours/Validate.hs +++ b/hadrian/src/Settings/Flavours/Validate.hs @@ -1,6 +1,8 @@ module Settings.Flavours.Validate (validateFlavour, slowValidateFlavour, quickValidateFlavour) where +import qualified Data.Set as Set + import Expression import Flavour import Oracles.Flag @@ -11,10 +13,12 @@ validateFlavour :: Flavour validateFlavour = werror $ defaultFlavour { name = "validate" , args = defaultBuilderArgs <> validateArgs <> defaultPackageArgs - , libraryWays = mconcat [ pure [vanilla] + , libraryWays = Set.fromList <$> + mconcat [ pure [vanilla] , notStage0 ? platformSupportsSharedLibs ? pure [dynamic] ] - , rtsWays = mconcat [ pure [vanilla, threaded, debug, logging, threadedDebug, threadedLogging] + , rtsWays = Set.fromList <$> + mconcat [ pure [vanilla, threaded, debug, logging, threadedDebug, threadedLogging] , notStage0 ? platformSupportsSharedLibs ? pure [ dynamic, threadedDynamic, debugDynamic, threadedDebugDynamic , loggingDynamic, threadedLoggingDynamic |