From 9a2798e139e3d20183b59bb5a66012db495c66c7 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Fri, 26 Jul 2019 16:49:36 -0400 Subject: hadrian: Add `validate` and `slow validate` flavours --- hadrian/doc/flavours.md | 22 +++++++++++++++ hadrian/hadrian.cabal | 1 + hadrian/src/Settings.hs | 3 +- hadrian/src/Settings/Flavours/Validate.hs | 46 +++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 hadrian/src/Settings/Flavours/Validate.hs (limited to 'hadrian') diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index 689c3f1742..26d5115e61 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -120,6 +120,28 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH -O0
-DDEBUG + + validate + -O0
-H64m + -fllvm-fill-undef-with-garbage + + -O
-dcore-lint
-dno-debug-output + -O2
-DDEBUG + -O
-dcore-lint
-dno-debug-output + -O + -O + + + validate + -O0
-H64m + -fllvm-fill-undef-with-garbage + + -O
-dcore-lint
-dno-debug-output + -O2
-DDEBUG + -O
-DDEBUG
-dcore-lint
-dno-debug-output + -O + -O + ### LLVM variants diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index ce44a18095..818114a4d4 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -101,6 +101,7 @@ executable hadrian , Settings.Flavours.QuickCross , Settings.Flavours.Quickest , Settings.Flavours.GhcInGhci + , Settings.Flavours.Validate , Settings.Packages , Settings.Parser , Settings.Program diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs index ba0cff770a..2263f68107 100755 --- a/hadrian/src/Settings.hs +++ b/hadrian/src/Settings.hs @@ -21,6 +21,7 @@ import Settings.Flavours.Quick import Settings.Flavours.Quickest import Settings.Flavours.QuickCross import Settings.Flavours.GhcInGhci +import Settings.Flavours.Validate import Control.Monad.Except import Data.Either @@ -45,7 +46,7 @@ hadrianFlavours = , developmentFlavour Stage2, performanceFlavour, profiledFlavour , quickFlavour, quickestFlavour, quickCrossFlavour, benchmarkLlvmFlavour , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour - , ghcInGhciFlavour ] + , ghcInGhciFlavour, validateFlavour, slowValidateFlavour ] -- | This action looks up a flavour with the name given on the -- command line with @--flavour@, defaulting to 'userDefaultFlavour' diff --git a/hadrian/src/Settings/Flavours/Validate.hs b/hadrian/src/Settings/Flavours/Validate.hs new file mode 100644 index 0000000000..f49f5112de --- /dev/null +++ b/hadrian/src/Settings/Flavours/Validate.hs @@ -0,0 +1,46 @@ +module Settings.Flavours.Validate (validateFlavour, slowValidateFlavour) where + +import Expression +import Flavour +import Oracles.Flag +import {-# SOURCE #-} Settings.Default + +-- Please update doc/flavours.md when changing this file. +validateFlavour :: Flavour +validateFlavour = werror $ defaultFlavour + { name = "validate" + , args = defaultBuilderArgs <> validateArgs <> defaultPackageArgs + , libraryWays = mconcat [ pure [vanilla] + , notStage0 ? platformSupportsSharedLibs ? pure [dynamic] + ] + , rtsWays = mconcat [ pure [vanilla, threaded, debug, logging, threadedDebug, threadedLogging] + , notStage0 ? platformSupportsSharedLibs ? pure + [ dynamic, threadedDynamic, debugDynamic, threadedDebugDynamic + , loggingDynamic, threadedLoggingDynamic + ] + ] + } + +validateArgs :: Args +validateArgs = sourceArgs SourceArgs + { hsDefault = mconcat [ stage0 ? pure ["-O0", "-H64m"] + -- See #11487 + , notStage0 ? arg "-fllvm-fill-undef-with-garbage" + ] + , hsLibrary = pure ["-O", "-dcore-lint", "-dno-debug-output"] + , hsCompiler = mconcat [ stage0 ? pure ["-O2", "-DDEBUG"] + , notStage0 ? pure ["-O", "-dcore-lint", "-dno-debug-output"] + ] + , hsGhc = pure ["-O"] } + +slowValidateFlavour :: Flavour +slowValidateFlavour = werror $ validateFlavour + { name = "slow-validate" + , args = defaultBuilderArgs <> slowValidateArgs <> defaultPackageArgs + } + +slowValidateArgs :: Args +slowValidateArgs = + mconcat [ validateArgs + , notStage0 ? arg "-DDEBUG" + ] -- cgit v1.2.1