[commit: ghc] wip/nfs-locking: Add getLibWays to capture context-less ways. (cc3113d)

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


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

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

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

commit cc3113db2263c179a4e91440a9369f44a2825980
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Sep 24 05:49:11 2015 +0100

    Add getLibWays to capture context-less ways.


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

cc3113db2263c179a4e91440a9369f44a2825980
 src/Settings/User.hs | 14 +++++++++-----
 src/Settings/Ways.hs | 17 ++++++++++-------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/Settings/User.hs b/src/Settings/User.hs
index f9a430c..5b62e39 100644
--- a/src/Settings/User.hs
+++ b/src/Settings/User.hs
@@ -1,8 +1,8 @@
 module Settings.User (
-    userArgs, userPackages, userWays, userRtsWays, userTargetDirectory,
+    userArgs, userPackages, userLibWays, userRtsWays, userTargetDirectory,
     userKnownPackages, integerLibrary,
     trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
-    dynamicGhcPrograms, laxDependencies
+    ghcDebugged, dynamicGhcPrograms, laxDependencies
     ) where
 
 import Expression
@@ -21,9 +21,9 @@ userPackages = mempty
 userKnownPackages :: [Package]
 userKnownPackages = []
 
--- Control which ways are built
-userWays :: Ways
-userWays = mempty
+-- Control which ways libraries and rts are built
+userLibWays :: Ways
+userLibWays = mempty
 
 userRtsWays :: Ways
 userRtsWays = mempty
@@ -60,6 +60,10 @@ ghciWithDebugger = False
 ghcProfiled :: Bool
 ghcProfiled = False
 
+-- TODO: do we need to be able to set this from command line?
+ghcDebugged :: Bool
+ghcDebugged = False
+
 -- When laxDependencies flag is set to True, dependencies on the GHC executable
 -- are turned into order-only dependencies to avoid needless recompilation when
 -- making changes to GHC's sources. In certain situations this can lead to build
diff --git a/src/Settings/Ways.hs b/src/Settings/Ways.hs
index cafed64..ad42cea 100644
--- a/src/Settings/Ways.hs
+++ b/src/Settings/Ways.hs
@@ -1,26 +1,29 @@
-module Settings.Ways (getWays, getRtsWays) where
+module Settings.Ways (getWays, getLibWays, getRtsWays) where
 
 import Expression
 import Predicates
 import Settings.User
 
 -- Combining default ways with user modifications
+getLibWays :: Expr [Way]
+getLibWays = fromDiffExpr $ defaultLibWays <> userLibWays
+
+-- In Stage0 we only build vanilla
 getWays :: Expr [Way]
-getWays = fromDiffExpr $ defaultWays <> userWays
+getWays = mconcat [ stage0 ? return [vanilla], notStage0 ? getLibWays ]
 
 getRtsWays :: Expr [Way]
 getRtsWays = fromDiffExpr $ defaultRtsWays <> userRtsWays
 
 -- These are default ways
-defaultWays :: Ways
-defaultWays = mconcat
-    [                              append [vanilla] -- always build vanilla
-    , notStage0                  ? append [profiling]
+defaultLibWays :: Ways
+defaultLibWays = mconcat
+    [ append [vanilla, profiling]
     , platformSupportsSharedLibs ? append [dynamic] ]
 
 defaultRtsWays :: Ways
 defaultRtsWays = do
-    ways <- getWays
+    ways <- getLibWays
     mconcat
         [ append [ logging, debug, threaded, threadedDebug, threadedLogging ]
         , (profiling `elem` ways) ? append [threadedProfiling]



More information about the ghc-commits mailing list