summaryrefslogtreecommitdiff
path: root/hadrian/src/Flavour.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-14 09:24:17 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-22 00:07:42 -0400
commit8c871c07f538045b9bb7bba5dad4896c8def535b (patch)
tree89bca623fb27fbcaffeef3ff123b2fedc451588f /hadrian/src/Flavour.hs
parentb4d240d3c0a238514db5b4750ba70b7569f1ed02 (diff)
downloadhaskell-8c871c07f538045b9bb7bba5dad4896c8def535b.tar.gz
hadrian: Add omit_pragmas 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.
Diffstat (limited to 'hadrian/src/Flavour.hs')
-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