Skip to content
Snippets Groups Projects
Commit 95455982 authored by GHC GitLab CI's avatar GHC GitLab CI Committed by Marge Bot
Browse files

hadrian: Don't include -fdiagnostics-color in argument hash

Otherwise the input hash will vary with whether colors are requested,
which changed with `isatty`.

Fixes #18672.
parent 1207576a
No related branches found
No related tags found
No related merge requests found
Pipeline #24537 failed
...@@ -35,6 +35,9 @@ compileAndLinkHs = (builder (Ghc CompileHs) ||^ builder (Ghc LinkHs)) ? do ...@@ -35,6 +35,9 @@ compileAndLinkHs = (builder (Ghc CompileHs) ||^ builder (Ghc LinkHs)) ? do
hasDynamic = elem dynamic ways hasDynamic = elem dynamic ways
mconcat [ arg "-Wall" mconcat [ arg "-Wall"
, not useColor ? builder (Ghc CompileHs) ? , not useColor ? builder (Ghc CompileHs) ?
-- N.B. Target.trackArgument ignores this argument from the
-- input hash to avoid superfluous recompilation, avoiding
-- #18672.
arg "-fdiagnostics-color=never" arg "-fdiagnostics-color=never"
, (hasVanilla && hasDynamic) ? builder (Ghc CompileHs) ? , (hasVanilla && hasDynamic) ? builder (Ghc CompileHs) ?
platformSupportsSharedLibs ? way vanilla ? platformSupportsSharedLibs ? way vanilla ?
......
...@@ -21,11 +21,12 @@ type Target = H.Target Context Builder ...@@ -21,11 +21,12 @@ type Target = H.Target Context Builder
trackArgument :: Target -> String -> Bool trackArgument :: Target -> String -> Bool
trackArgument target arg = case builder target of trackArgument target arg = case builder target of
Make _ -> not $ threadArg arg Make _ -> not $ threadArg arg
Ghc _ _ -> not $ verbosityArg arg Ghc _ _ -> not $ verbosityArg arg || diagnosticsColorArg arg
Cabal _ _ -> not $ verbosityArg arg || cabal_configure_ignore arg Cabal _ _ -> not $ verbosityArg arg || cabal_configure_ignore arg
_ -> True _ -> True
where where
threadArg s = dropWhileEnd isDigit s `elem` ["-j", "MAKEFLAGS=-j", "THREADS="] threadArg s = dropWhileEnd isDigit s `elem` ["-j", "MAKEFLAGS=-j", "THREADS="]
verbosityArg s = dropWhileEnd isDigit s == "-v" verbosityArg s = dropWhileEnd isDigit s == "-v"
diagnosticsColorArg s = "-fdiagnostics-color=" `isPrefixOf` s -- N.B. #18672
cabal_configure_ignore s = cabal_configure_ignore s =
s `elem` [ "--configure-option=--quiet", "--configure-option=--disable-option-checking" ] s `elem` [ "--configure-option=--quiet", "--configure-option=--disable-option-checking" ]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment