summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-14 09:24:17 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-05-14 09:50:33 +0100
commit7497d1a7584519c0f3cf77df9d281d913cef66a4 (patch)
tree887b149d3b78597132579d75b079ff498112108d
parent54eb071f3c908a1d4b57014b0b23a8d4ca020a96 (diff)
downloadhaskell-wip/hadrian-interface-transformer.tar.gz
hadrian: Add omit_pragmas transformerwip/hadrian-interface-transformer
This transformer builds stage2 GHC with -fomit-interface-pragmas which can greatly reduce the amount of rebuilding but still allows most the tests to pass.
-rw-r--r--hadrian/src/Flavour.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index 61bca98053..d8f34347f4 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -43,6 +43,7 @@ flavourTransformers = M.fromList
, "profiled_ghc" =: enableProfiledGhc
, "no_dynamic_ghc" =: disableDynamicGhcPrograms
, "no_profiled_libs" =: disableProfiledLibs
+ , "omit_pragmas" =: omitPragmas
]
where (=:) = (,)
@@ -179,6 +180,13 @@ disableProfiledLibs :: Flavour -> Flavour
disableProfiledLibs flavour =
flavour { libraryWays = filter (not . wayUnit Profiling) <$> libraryWays flavour }
+-- | Build stage2 compiler with -fomit-interface-pragmas to reduce
+-- recompilation.
+omitPragmas :: Flavour -> Flavour
+omitPragmas =
+ let Right kv = parseKV "stage1.ghc.ghc.hs.opts += -fomit-interface-pragmas"
+ Right transformer = applySetting kv
+ in transformer
-- * CLI and <root>/hadrian.settings options