[commit: ghc] wip/nfs-locking: Add configFile to Base, track building ./settings (acd13b4)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:45:56 UTC 2017


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

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

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

commit acd13b473853eab11eac680a67c3e4ab2f7f82ad
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Feb 2 15:11:11 2016 +0000

    Add configFile to Base, track building ./settings
    
    See #200.


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

acd13b473853eab11eac680a67c3e4ab2f7f82ad
 src/Base.hs           |  5 ++++-
 src/Oracles/Config.hs |  3 ---
 src/Rules/Config.hs   | 10 ++++++----
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/Base.hs b/src/Base.hs
index 37f4716..464c1c9 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -16,7 +16,7 @@ module Base (
     module Development.Shake.FilePath,
 
     -- * Paths
-    shakeFilesPath, configPath, sourcePath, programInplacePath,
+    shakeFilesPath, configPath, configFile, sourcePath, programInplacePath,
     bootPackageConstraints, packageDependencies,
 
     -- * Output
@@ -54,6 +54,9 @@ shakeFilesPath = shakePath -/- ".db"
 configPath :: FilePath
 configPath = shakePath -/- "cfg"
 
+configFile :: FilePath
+configFile = configPath -/- "system.config"
+
 -- | Path to source files of the build system, e.g. this file is located at
 -- sourcePath -/- "Base.hs". We use this to `need` some of the source files.
 sourcePath :: FilePath
diff --git a/src/Oracles/Config.hs b/src/Oracles/Config.hs
index cde2383..7801208 100644
--- a/src/Oracles/Config.hs
+++ b/src/Oracles/Config.hs
@@ -8,9 +8,6 @@ import Development.Shake.Config
 newtype ConfigKey = ConfigKey String
     deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
 
-configFile :: FilePath
-configFile = configPath -/- "system.config"
-
 askConfig :: String -> Action String
 askConfig key = askConfigWithDefault key . putError
     $ "Cannot find key '" ++ key ++ "' in configuration files."
diff --git a/src/Rules/Config.hs b/src/Rules/Config.hs
index 7b6e8fa..eea61c6 100644
--- a/src/Rules/Config.hs
+++ b/src/Rules/Config.hs
@@ -8,12 +8,14 @@ configRules :: Rules ()
 configRules = do
     -- We always rerun the configure script in this mode, because the flags
     -- passed to it can affect the contents of system.config file.
-    configPath -/- "system.config" %> \out -> do
+    [configFile, "settings"] &%> \[cfg, settings] -> do
         alwaysRerun
         case cmdConfigure of
-            RunConfigure args -> runConfigure "." [] [args]
-            SkipConfigure     -> unlessM (doesFileExist out) $
-                putError $ "Configuration file " ++ out ++ " is missing.\n"
+            RunConfigure args -> do
+                need [ settings <.> "in" ]
+                runConfigure "." [] [args]
+            SkipConfigure     -> unlessM (doesFileExist cfg) $
+                putError $ "Configuration file " ++ cfg ++ " is missing.\n"
                     ++ "Run the configure script either manually or via the "
                     ++ "build system by passing --configure[=ARGS] flag."
 



More information about the ghc-commits mailing list