[commit: ghc] wip/nfs-locking: Clean up rules. (5f8abc4)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:32:39 UTC 2017


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

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

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

commit 5f8abc4b283d401a7d5b5eb341cab21f799fdf63
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Aug 2 14:36:36 2015 +0100

    Clean up rules.


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

5f8abc4b283d401a7d5b5eb341cab21f799fdf63
 src/Rules/Config.hs       | 4 ++--
 src/Rules/Dependencies.hs | 4 +++-
 src/Util.hs               | 1 -
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Rules/Config.hs b/src/Rules/Config.hs
index 5946bfb..8d886fa 100644
--- a/src/Rules/Config.hs
+++ b/src/Rules/Config.hs
@@ -7,10 +7,10 @@ configRules :: Rules ()
 configRules = do
     configPath -/- "system.config" %> \out -> do
         need [configPath -/- "system.config.in", "configure"]
-        putColoured White "Running configure..."
+        putBuild "Running configure..."
         cmd "bash configure" -- TODO: get rid of 'bash'
 
     "configure" %> \out -> do
         copyFile' (configPath -/- "configure.ac") "configure.ac"
-        putColoured White $ "Running autoconf..."
+        putBuild "Running autoconf..."
         cmd "bash autoconf" -- TODO: get rid of 'bash'
diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 92664d2..7fab8cf 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -26,7 +26,9 @@ buildPackageDependencies _ target =
 
         (buildPath -/- "c.deps") %> \file -> do
             srcs <- pkgDataList $ CSrcs path
-            deps <- forM srcs $ \src -> readFile' $ buildPath -/- src <.> "deps"
+            let depFiles = [ buildPath -/- src <.> "deps" | src <- srcs ]
+            need depFiles -- increase parallelism by needing all at once
+            deps <- mapM readFile' depFiles
             writeFileChanged file (concat deps)
 
         (buildPath -/- "haskell.deps") %> \file -> do
diff --git a/src/Util.hs b/src/Util.hs
index d8a4db7..70de3ec 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -64,7 +64,6 @@ putOracle = putColoured Blue
 putBuild :: String -> Action ()
 putBuild = putColoured White
 
-
 -- A more colourful version of error
 redError :: String -> Action a
 redError msg = do



More information about the ghc-commits mailing list