[commit: ghc] wip/nfs-locking: Minor revision. (0ddf3b4)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:20:56 UTC 2017


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

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

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

commit 0ddf3b4d341a31ce66d78b5c840b2e55929ab5e3
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Feb 16 02:40:38 2016 +0000

    Minor revision.
    
    See #207.


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

0ddf3b4d341a31ce66d78b5c840b2e55929ab5e3
 src/Rules.hs              | 7 ++++---
 src/Rules/Compile.hs      | 2 +-
 src/Rules/Dependencies.hs | 9 ++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/Rules.hs b/src/Rules.hs
index f765b5e..a3d67cb 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -61,15 +61,16 @@ packageRules = do
     let readPackageDb  = [(packageDb, 1)]
         writePackageDb = [(packageDb, maxConcurrentReaders)]
 
-    let contexts = liftM3 Context allStages knownPackages allWays
+    let contexts        = liftM3 Context        allStages knownPackages allWays
+        vanillaContexts = liftM2 vanillaContext allStages knownPackages
 
-    traverse_ (compilePackage readPackageDb) contexts
+    traverse_ (compilePackage           readPackageDb) contexts
+    traverse_ (buildPackageDependencies readPackageDb) vanillaContexts
 
     for_ allStages $ \stage ->
         for_ knownPackages $ \package -> do
             let context = vanillaContext stage package
             buildPackageData                         context
-            buildPackageDependencies  readPackageDb  context
             buildPackageDocumentation                context
             generatePackageCode                      context
             buildPackageLibrary                      context
diff --git a/src/Rules/Compile.hs b/src/Rules/Compile.hs
index a52edef..f62c644 100644
--- a/src/Rules/Compile.hs
+++ b/src/Rules/Compile.hs
@@ -7,7 +7,7 @@ import Expression
 import Oracles.Dependencies
 import Rules.Actions
 import Settings
-import Target hiding (context)
+import Target
 
 compilePackage :: [(Resource, Int)] -> Context -> Rules ()
 compilePackage rs context @ (Context {..}) = do
diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 45a8f8c..330c821 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -19,7 +19,7 @@ buildPackageDependencies rs context @ (Context {..}) =
         dropBuild = (pkgPath package ++) . drop (length buildPath)
         hDepFile  = buildPath -/- ".hs-dependencies"
     in do
-        fmap (buildPath++)
+        fmap (buildPath ++)
             [ "//*.c.deps", "//*.cmm.deps", "//*.S.deps" ] |%> \out -> do
                 let srcFile = if "//AutoApply.*" ?== out
                               then dropExtension out
@@ -32,19 +32,18 @@ buildPackageDependencies rs context @ (Context {..}) =
             need srcs
             if srcs == []
             then writeFileChanged out ""
-            else buildWithResources rs $
-                Target context (GhcM stage) srcs [out]
+            else buildWithResources rs $ Target context (GhcM stage) srcs [out]
             removeFileIfExists $ out <.> "bak"
 
         -- TODO: don't accumulate *.deps into .dependencies
-        (buildPath -/- ".dependencies") %> \out -> do
+        buildPath -/- ".dependencies" %> \out -> do
             cSrcs <- pkgDataList $ CSrcs path
             let cDepFiles = [ buildPath -/- src <.> "deps" | src <- cSrcs
                             , not ("//AutoApply.cmm" ?== src) ]
                          ++ [ src <.> "deps" | src <- cSrcs, "//AutoApply.cmm" ?== src ]
 
             need $ hDepFile : cDepFiles -- need all for more parallelism
-            cDeps <- fmap concat $ mapM readFile' cDepFiles
+            cDeps <- fmap concat $ traverse readFile' cDepFiles
             hDeps <- readFile' hDepFile
             let result = unlines
                        . map (\(src, deps) -> unwords $ src : deps)



More information about the ghc-commits mailing list