[commit: ghc] wip/nfs-locking: Don't optimize cabal stage0 build (#357) (e1aadf3)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:51:37 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/e1aadf31f565128c609765f550e5213adbfab35d/ghc

>---------------------------------------------------------------

commit e1aadf31f565128c609765f550e5213adbfab35d
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue Jul 11 17:24:01 2017 -0400

    Don't optimize cabal stage0 build (#357)


>---------------------------------------------------------------

e1aadf31f565128c609765f550e5213adbfab35d
 hadrian.cabal                  |  1 +
 src/Settings/Default.hs        |  5 ++++-
 src/Settings/Packages/Cabal.hs | 11 +++++++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/hadrian.cabal b/hadrian.cabal
index fbda4b0..1178cb4 100644
--- a/hadrian.cabal
+++ b/hadrian.cabal
@@ -91,6 +91,7 @@ executable hadrian
                        , Settings.Flavours.Quick
                        , Settings.Flavours.Quickest
                        , Settings.Packages.Base
+                       , Settings.Packages.Cabal
                        , Settings.Packages.Compiler
                        , Settings.Packages.Ghc
                        , Settings.Packages.GhcCabal
diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs
index 3ad1fab..19c6937 100644
--- a/src/Settings/Default.hs
+++ b/src/Settings/Default.hs
@@ -30,6 +30,7 @@ import Settings.Builders.Ld
 import Settings.Builders.Make
 import Settings.Builders.Tar
 import Settings.Packages.Base
+import Settings.Packages.Cabal
 import Settings.Packages.Compiler
 import Settings.Packages.Ghc
 import Settings.Packages.GhcCabal
@@ -268,6 +269,7 @@ disableWarningArgsLibs = do
 defaultPackageArgs :: Args
 defaultPackageArgs = mconcat
     [ basePackageArgs
+    , cabalPackageArgs
     , compilerPackageArgs
     , ghcPackageArgs
     , ghcCabalPackageArgs
@@ -279,4 +281,5 @@ defaultPackageArgs = mconcat
     , runGhcPackageArgs
     , disableWarningArgsStage0
     , disableWarningArgsStage1
-    , disableWarningArgsLibs ]
+    , disableWarningArgsLibs
+    ]
diff --git a/src/Settings/Packages/Cabal.hs b/src/Settings/Packages/Cabal.hs
new file mode 100644
index 0000000..eddee75
--- /dev/null
+++ b/src/Settings/Packages/Cabal.hs
@@ -0,0 +1,11 @@
+module Settings.Packages.Cabal where
+
+import GHC
+import Predicate
+
+cabalPackageArgs :: Args
+cabalPackageArgs = package cabal ? do
+    -- Cabal is a rather large library and quite slow to compile. Moreover, we
+    -- build it for stage0 only so we can link ghc-pkg against it, so there is
+    -- little reason to spend the effort to optimize it.
+    stage Stage0 ? builder Ghc ? append [ "-O0" ]



More information about the ghc-commits mailing list