[commit: ghc] wip/nfs-locking: Clean up, add comments. (55fd868)

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


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

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

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

commit 55fd868e521ea500e3b5e8a6f55890e632e07174
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Fri Sep 25 02:52:16 2015 +0100

    Clean up, add comments.


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

55fd868e521ea500e3b5e8a6f55890e632e07174
 src/Builder.hs          | 1 +
 src/Oracles/ArgsHash.hs | 1 +
 src/Rules/Cabal.hs      | 6 ++++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Builder.hs b/src/Builder.hs
index e1c69be..c0ffee0 100644
--- a/src/Builder.hs
+++ b/src/Builder.hs
@@ -16,6 +16,7 @@ import Stage
 -- GhcPkg StageN, N > 0, is the one built in Stage0 (TODO: need only Stage1?)
 -- TODO: add Cpp builders
 -- TODO: rename Gcc to Cc?
+-- TODO: do we really need staged builders?
 data Builder = Alex
              | Ar
              | Gcc Stage
diff --git a/src/Oracles/ArgsHash.hs b/src/Oracles/ArgsHash.hs
index 402923b..ab4993b 100644
--- a/src/Oracles/ArgsHash.hs
+++ b/src/Oracles/ArgsHash.hs
@@ -19,6 +19,7 @@ newtype ArgsHashKey = ArgsHashKey Target
 -- constructors are assumed not to examine target sources, but only append them
 -- to argument lists where appropriate.
 -- TODO: enforce the above assumption via type trickery?
+-- TODO: Hash Target to improve accuracy and performance.
 checkArgsHash :: Target -> Action ()
 checkArgsHash target = when trackBuildSystem $ do
     _ <- askOracle . ArgsHashKey $ target { sources = ["src"] } :: Action Int
diff --git a/src/Rules/Cabal.hs b/src/Rules/Cabal.hs
index aac8ab2..7ccb1b8 100644
--- a/src/Rules/Cabal.hs
+++ b/src/Rules/Cabal.hs
@@ -2,7 +2,7 @@ module Rules.Cabal (cabalRules) where
 
 import Expression
 import Data.Version
-import Distribution.Package
+import Distribution.Package hiding (Package)
 import Distribution.PackageDescription
 import Distribution.PackageDescription.Parse
 import Distribution.Verbosity
@@ -29,7 +29,9 @@ cabalRules = do
         pkgDeps <- forM (sort pkgs) $ \pkg -> do
             need [pkgCabalFile pkg]
             pd <- liftIO . readPackageDescription silent $ pkgCabalFile pkg
-            let deps     = collectDeps . condLibrary $ pd
+            let depsLib  = collectDeps $ condLibrary pd
+                depsExes = map (collectDeps . Just . snd) $ condExecutables pd
+                deps     = concat $ depsLib : depsExes
                 depNames = [ name | Dependency (PackageName name) _ <- deps ]
             return . unwords $ Package.pkgName pkg : sort depNames
         writeFileChanged out . unlines $ pkgDeps



More information about the ghc-commits mailing list