diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-01 11:10:48 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-01 16:09:57 +0000 |
commit | ad3ccbcf9364cf88f16f5f13583d3ce113e28019 (patch) | |
tree | b550676bacc33fd4965b0bfdea2420dcd12dd2ce | |
parent | d734ef8f78203b856dcfaf19eaebfed6ec623850 (diff) | |
download | haskell-wip/testsuite-debugged.tar.gz |
hadrian: Correctly set whether we have a debug compiler when running testswip/testsuite-debugged
For example, running the `slow-validate` flavour would incorrectly run
the T16135 test which would fail with an assertion error, despite the
fact that is should be skipped when we have a debug compiler.
-rw-r--r-- | hadrian/src/Flavour/Type.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Builders/RunTest.hs | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/hadrian/src/Flavour/Type.hs b/hadrian/src/Flavour/Type.hs index 9f992fd6f2..b21953e9de 100644 --- a/hadrian/src/Flavour/Type.hs +++ b/hadrian/src/Flavour/Type.hs @@ -32,7 +32,7 @@ data Flavour = Flavour { ghciWithDebugger :: Bool, -- | Build profiled GHC. ghcProfiled :: Bool, - -- | Build GHC with debugging assertions. + -- | Build GHC with debug RTS ghcDebugged :: Bool, -- | Build the GHC executable against the threaded runtime system. ghcThreaded :: Bool, diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs index 6a49334a70..51a21183e1 100644 --- a/hadrian/src/Settings/Builders/RunTest.hs +++ b/hadrian/src/Settings/Builders/RunTest.hs @@ -2,7 +2,7 @@ module Settings.Builders.RunTest (runTestBuilderArgs, runTestGhcFlags) where import Hadrian.Utilities -import System.Environment +import System.Environment hiding (getArgs) import CommandLine import Oracles.TestSettings @@ -12,6 +12,7 @@ import qualified Data.Set as Set import Flavour import qualified Context.Type as C import System.Directory (findExecutable) +import Hadrian.Target (target) getTestSetting :: TestSetting -> Expr String getTestSetting key = expr $ testSetting key @@ -95,7 +96,14 @@ inTreeCompilerArgs stg = expr $ do withInterpreter <- ghcWithInterpreter unregisterised <- flag GhcUnregisterised withSMP <- targetSupportsSMP - debugged <- ghcDebugged <$> flavour + -- --info reports "Debug on = YES" if debugIsOn = True which is set by passing -DDEBUG to + -- "compiler/GHC/Utils/Constants.hs" + debug_args <- + interpret (target (Context stg compiler vanilla) + (Ghc CompileHs stg) + ["compiler" -/- "GHC" -/- "Utils" -/- "Constants.hs"] [""]) + getArgs + let debugged = "-DDEBUG" `elem` debug_args profiled <- ghcProfiled <$> flavour os <- setting HostOs |