[commit: ghc] wip/nfs-locking: Optimise buildPackageDependencies rule. (7c45e18)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:21:51 UTC 2017


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

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

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

commit 7c45e18e0d1ef091aac126e9a316ac9cd5f0a2bb
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 13 03:13:10 2015 +0000

    Optimise buildPackageDependencies rule.


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

7c45e18e0d1ef091aac126e9a316ac9cd5f0a2bb
 src/Package/Dependencies.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Package/Dependencies.hs b/src/Package/Dependencies.hs
index f3a494b..7390b2e 100644
--- a/src/Package/Dependencies.hs
+++ b/src/Package/Dependencies.hs
@@ -14,10 +14,13 @@ buildPackageDependencies (Package name path _) (stage, dist, settings) =
             <> packageArgs stage pkgData
             <> includeArgs path dist
             <> productArgs ["-odir", "-stubdir"] buildDir
-            <> arg ["-dep-makefile", out]
+            <> arg ["-dep-makefile", out <.> "new"]
             <> productArgs "-dep-suffix" (map wayPrefix <$> ways settings)
             <> arg (pkgHsSources path dist)
             -- TODO: Check that skipping all _HC_OPTS is safe.
             -- <> arg SrcHcOpts
             -- TODO: i) is this needed? ii) shall we run GHC -M multiple times?
             -- <> wayHcOpts vanilla
+        -- Avoid rebuilding dependecies of out if it hasn't changed:
+        copyFileChanged (out <.> "new") out
+        removeFilesAfter "." [out <.> "new"]



More information about the ghc-commits mailing list