[commit: ghc] wip/nfs-locking: Add pkgDataFile to look up the path to package-data.mk of a particular stage/package combination. (304b099)

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


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

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

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

commit 304b0999ea6282dc3a86e2923bb361a889c5acff
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Dec 20 18:30:24 2015 +0000

    Add pkgDataFile to look up the path to package-data.mk of a particular stage/package combination.


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

304b0999ea6282dc3a86e2923bb361a889c5acff
 src/Rules/Data.hs               | 2 +-
 src/Settings/TargetDirectory.hs | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Rules/Data.hs b/src/Rules/Data.hs
index b6925d0..b68a1f6 100644
--- a/src/Rules/Data.hs
+++ b/src/Rules/Data.hs
@@ -32,7 +32,7 @@ buildPackageData rs target @ (PartialTarget stage pkg) = do
             deps <- packageDeps pkg
             pkgs <- interpretPartial target getPackages
             let depPkgs = matchPackageNames (sort pkgs) deps
-            need [ targetPath stage p -/- "package-data.mk" | p <- depPkgs ]
+            need $ map (pkgDataFile stage) depPkgs
 
             need [cabalFile]
             buildWithResources [(ghcCabal rs, 1)] $
diff --git a/src/Settings/TargetDirectory.hs b/src/Settings/TargetDirectory.hs
index 6bcec88..286670b 100644
--- a/src/Settings/TargetDirectory.hs
+++ b/src/Settings/TargetDirectory.hs
@@ -1,5 +1,6 @@
 module Settings.TargetDirectory (
-    targetDirectory, targetPath, pkgHaddockFile, pkgLibraryFile, pkgGhciLibraryFile
+    targetDirectory, targetPath, pkgDataFile, pkgHaddockFile, pkgLibraryFile,
+    pkgGhciLibraryFile
     ) where
 
 import Expression
@@ -15,6 +16,9 @@ targetDirectory = userTargetDirectory
 targetPath :: Stage -> Package -> FilePath
 targetPath stage pkg = pkgPath pkg -/- targetDirectory stage pkg
 
+pkgDataFile :: Stage -> Package -> FilePath
+pkgDataFile stage pkg = targetPath stage pkg -/- "package-data.mk"
+
 -- Relative path to a package haddock file, e.g.:
 -- "libraries/array/dist-install/doc/html/array/array.haddock"
 pkgHaddockFile :: Package -> FilePath



More information about the ghc-commits mailing list