[commit: ghc] wip/nfs-locking: Add trackBuildSystem switch (perhaps, temporarily). (2b2008d)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:34:49 UTC 2017


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

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

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

commit 2b2008d6048aa691d8ea4f86e89c9ee5c4e2f300
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Aug 12 01:27:28 2015 +0100

    Add trackBuildSystem switch (perhaps, temporarily).


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

2b2008d6048aa691d8ea4f86e89c9ee5c4e2f300
 src/Rules/Actions.hs |  3 ++-
 src/Rules/Oracles.hs | 14 ++++++++------
 src/Settings/User.hs | 11 +++++++++--
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/src/Rules/Actions.hs b/src/Rules/Actions.hs
index 2f9ebc6..9726e2f 100644
--- a/src/Rules/Actions.hs
+++ b/src/Rules/Actions.hs
@@ -11,6 +11,7 @@ import Oracles.Setting
 import Oracles.ArgsHash
 import Settings.Args
 import Settings.Util
+import Settings.User
 import Settings.Builders.Ar
 
 -- Build a given target using an appropriate builder and acquiring necessary
@@ -23,7 +24,7 @@ buildWithResources rs target = do
     path    <- builderPath builder
     argList <- interpret target getArgs
     -- The line below forces the rule to be rerun if the args hash has changed
-    checkArgsHash target
+    when trackBuildSystem $ checkArgsHash target
     withResources rs $ do
         putBuild $ "/--------\n" ++ "| Running "
                  ++ show builder ++ " with arguments:"
diff --git a/src/Rules/Oracles.hs b/src/Rules/Oracles.hs
index 32938ff..9b6d597 100644
--- a/src/Rules/Oracles.hs
+++ b/src/Rules/Oracles.hs
@@ -9,12 +9,14 @@ import Oracles.PackageData
 import Oracles.WindowsRoot
 import Oracles.PackageDeps
 import Oracles.Dependencies
+import Settings.User
+import Control.Monad
 
 oracleRules :: Rules ()
 oracleRules = do
-    configOracle       -- see Oracles.Base
-    packageDataOracle  -- see Oracles.PackageData
-    packageDepsOracle  -- see Oracles.PackageDeps
-    dependenciesOracle -- see Oracles.Dependencies
-    argsHashOracle     -- see Oracles.ArgsHash
-    windowsRootOracle  -- see Oracles.WindowsRoot
+    configOracle                         -- see Oracles.Base
+    packageDataOracle                    -- see Oracles.PackageData
+    packageDepsOracle                    -- see Oracles.PackageDeps
+    dependenciesOracle                   -- see Oracles.Dependencies
+    when trackBuildSystem argsHashOracle -- see Oracles.ArgsHash
+    windowsRootOracle                    -- see Oracles.WindowsRoot
diff --git a/src/Settings/User.hs b/src/Settings/User.hs
index 572feb4..8831d65 100644
--- a/src/Settings/User.hs
+++ b/src/Settings/User.hs
@@ -1,7 +1,7 @@
 module Settings.User (
     userArgs, userPackages, userWays, userRtsWays, userTargetDirectory,
     userKnownPackages, integerLibrary,
-    buildHaddock, validating, ghciWithDebugger, ghcProfiled,
+    trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
     dynamicGhcPrograms, laxDependencies
     ) where
 
@@ -42,6 +42,14 @@ integerLibrary = integerGmp2
 -- * Bool: a plain Boolean flag whose value is known at compile time
 -- * Action Bool: a flag whose value can depend on the build environment
 -- * Predicate: a flag depending on the build environment and the current target
+
+-- Set this to True if you are making any changes in the build system and want
+-- appropriate rebuilds to be initiated. Switching this to False speeds things
+-- up a little (particularly zero builds).
+-- WARNING: changing this setting leads to a complete rebuild.
+trackBuildSystem :: Bool
+trackBuildSystem = False
+
 validating :: Bool
 validating = False
 
@@ -59,4 +67,3 @@ laxDependencies = False
 
 buildHaddock :: Predicate
 buildHaddock = return True
-



More information about the ghc-commits mailing list