[commit: ghc] wip/nfs-locking: Use existing target input instead of made up 'src' (f80dd4c)

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


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

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

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

commit f80dd4cc253afd4178f794e20aac9b0379b8d036
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sat Dec 26 21:53:37 2015 +0000

    Use existing target input instead of made up 'src'


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

f80dd4cc253afd4178f794e20aac9b0379b8d036
 src/Oracles/ArgsHash.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Oracles/ArgsHash.hs b/src/Oracles/ArgsHash.hs
index 1f4c584..65bfc8a 100644
--- a/src/Oracles/ArgsHash.hs
+++ b/src/Oracles/ArgsHash.hs
@@ -13,7 +13,7 @@ newtype ArgsHashKey = ArgsHashKey Target
 -- argument list and computes its hash. The resulting value is tracked in a
 -- Shake oracle, hence initiating rebuilts when the hash is changed (a hash
 -- change indicates changes in the build system).
--- Note: we replace target sources with ["src"] for performance reasons -- to
+-- Note: we keep only the first target input for performance reasons -- to
 -- avoid storing long lists of source files passed to some builders (e.g. Ar)
 -- in the Shake database. This optimisation is harmless, because argument list
 -- constructors are assumed not to examine target sources, but only append them
@@ -22,7 +22,8 @@ newtype ArgsHashKey = ArgsHashKey Target
 -- TODO: Hash Target to improve accuracy and performance.
 checkArgsHash :: Target -> Action ()
 checkArgsHash target = when trackBuildSystem $ do
-    _ <- askOracle . ArgsHashKey $ target { inputs = ["src"] } :: Action Int
+    let firstInput = take 1 $ inputs target
+    _ <- askOracle . ArgsHashKey $ target { inputs = firstInput } :: Action Int
     return ()
 
 -- Oracle for storing per-target argument list hashes



More information about the ghc-commits mailing list