[commit: ghc] wip/nfs-locking: Build dependencies for all known packages that exist (95ee1ab)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:45:25 UTC 2017


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

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

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

commit 95ee1ab41659c3e6f4d64455faed96aebaeb0cbf
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Nov 1 21:30:15 2016 +0000

    Build dependencies for all known packages that exist


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

95ee1ab41659c3e6f4d64455faed96aebaeb0cbf
 src/Rules/Cabal.hs | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/Rules/Cabal.hs b/src/Rules/Cabal.hs
index b2bd630..370bda2 100644
--- a/src/Rules/Cabal.hs
+++ b/src/Rules/Cabal.hs
@@ -11,6 +11,7 @@ import Expression
 import GHC
 import Settings
 import Settings.Path
+import UserSettings
 
 cabalRules :: Rules ()
 cabalRules = do
@@ -25,13 +26,13 @@ cabalRules = do
                 version             = display . pkgVersion $ identifier
             return $ unPackageName (DP.pkgName identifier) ++ " == " ++ version
         writeFileChanged out . unlines $ constraints
+        putSuccess $ "| Successfully computed boot package constraints"
 
     -- Cache package dependencies.
     packageDependencies %> \out -> do
-        pkgs <- concatMapM stagePackages [Stage0 .. Stage2]
-        pkgDeps <- forM (sort pkgs) $ \pkg ->
-            if pkg `elem` [hp2ps, libffi, rts, touchy, unlit]
-            then return $ pkgNameString pkg
+        pkgDeps <- forM (sort knownPackages) $ \pkg -> do
+            exists <- doesFileExist $ pkgCabalFile pkg
+            if not exists then return $ pkgNameString pkg
             else do
                 need [pkgCabalFile pkg]
                 pd <- liftIO . readPackageDescription silent $ pkgCabalFile pkg
@@ -40,7 +41,8 @@ cabalRules = do
                     deps     = concat $ depsLib : depsExes
                     depNames = [ unPackageName name | Dependency name _ <- deps ]
                 return . unwords $ pkgNameString pkg : sort depNames
-        writeFileChanged out . unlines $ pkgDeps
+        writeFileChanged out $ unlines pkgDeps
+        putSuccess $ "| Successfully computed package dependencies"
 
 collectDeps :: Maybe (CondTree v [Dependency] a) -> [Dependency]
 collectDeps Nothing = []



More information about the ghc-commits mailing list