summaryrefslogtreecommitdiff
path: root/hadrian/src
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-13 16:24:10 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-15 23:32:38 -0400
commit76b7f619385ac5d126dd186ff3bfe4cdad9349e7 (patch)
treebee521646ba2811ea09463d06686cdc7e760d018 /hadrian/src
parent20b4d5ecabc59062b7a841ce20b631364d8f8645 (diff)
downloadhaskell-76b7f619385ac5d126dd186ff3bfe4cdad9349e7.tar.gz
Disable optimisation when building Cabal in development flavours
This updates the make and Hadrian build flavours targetting developers to disable optimisation when building the Cabal library. Cabal tends to tickle some very bad compiler performance cases (e.g. #16577) so disabling optimisation here makes a sizeable impact on overall build time. See #16817.
Diffstat (limited to 'hadrian/src')
-rw-r--r--hadrian/src/Settings/Flavours/Development.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs
index 5fcc88be1e..08200dfa5a 100644
--- a/hadrian/src/Settings/Flavours/Development.hs
+++ b/hadrian/src/Settings/Flavours/Development.hs
@@ -2,6 +2,7 @@ module Settings.Flavours.Development (developmentFlavour) where
import Expression
import Flavour
+import Packages
import {-# SOURCE #-} Settings.Default
-- Please update doc/flavours.md when changing this file.
@@ -17,7 +18,10 @@ developmentArgs :: Stage -> Args
developmentArgs ghcStage = do
stage <- getStage
sourceArgs SourceArgs
- { hsDefault = pure ["-O", "-H64m"]
+ { hsDefault = mconcat [ pure ["-O", "-H64m"],
+ -- Disable optimization when building Cabal;
+ -- this saves many minutes of build time.
+ package cabal ? pure ["-O0"]]
, hsLibrary = notStage0 ? arg "-dcore-lint"
, hsCompiler = mconcat [stage0 ? arg "-O2",
succ stage == ghcStage ? pure ["-O0", "-DDEBUG"]]