[commit: ghc] wip/nfs-locking: Use fine-grain dependencies in buildPackageDependencies. (4aabd6f)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:15:07 UTC 2017


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

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

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

commit 4aabd6f2c6818c237b569a4d807e1a29ad72f0f0
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sat Aug 1 14:16:12 2015 +0100

    Use fine-grain dependencies in buildPackageDependencies.


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

4aabd6f2c6818c237b569a4d807e1a29ad72f0f0
 src/Rules/Dependencies.hs | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 251a233..656e853 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -17,17 +17,17 @@ buildPackageDependencies target =
         pkg       = Target.package target
         path      = targetPath stage pkg
         buildPath = path -/- "build"
+        dropBuild = (pkgPath pkg ++) . drop (length buildPath)
     in do
-        (buildPath -/- "haskell.deps") %> \file -> do
-            srcs <- interpretExpr target getHsSources
-            build $ fullTarget target srcs (GhcM stage) [file]
+        (buildPath <//> "*.c.deps") %> \depFile -> do
+            let srcFile = dropBuild . dropExtension $ depFile
+            build $ fullTarget target [srcFile] (GccM stage) [depFile]
 
         (buildPath -/- "c.deps") %> \file -> do
             srcs <- pkgDataList $ CSrcs path
-            deps <- forM srcs $ \src -> do
-                let srcFile = pkgPath pkg -/- src
-                    depFile = buildPath -/- takeFileName src <.> "deps"
-                build $ fullTarget target [srcFile] (GccM stage) [depFile]
-                liftIO . readFile $ depFile
+            deps <- forM srcs $ \src -> readFile' $ buildPath -/- src <.> "deps"
             writeFileChanged file (concat deps)
-            liftIO $ removeFiles buildPath ["*.c.deps"]
+
+        (buildPath -/- "haskell.deps") %> \file -> do
+            srcs <- interpretExpr target getHsSources
+            build $ fullTarget target srcs (GhcM stage) [file]



More information about the ghc-commits mailing list