[commit: ghc] wip/nfs-locking: Fix tracking of *.hs-incl files. (363b227)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:14:43 UTC 2017


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

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

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

commit 363b227e1e310561018c1991249cbf21bf28be57
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Dec 22 05:09:27 2015 +0000

    Fix tracking of *.hs-incl files.


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

363b227e1e310561018c1991249cbf21bf28be57
 src/Rules/Dependencies.hs | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 996d927..47e6c6d 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -24,7 +24,24 @@ buildPackageDependencies _ target @ (PartialTarget stage pkg) =
         hDepFile %> \file -> do
             srcs <- interpretPartial target getPackageSources
             when (pkg == compiler) $ need [platformH]
-            need srcs
+            -- TODO: very ugly and fragile; use gcc -MM instead?
+            let extraDeps = if pkg /= compiler then [] else fmap (buildPath -/-)
+                   [ "primop-vector-uniques.hs-incl"
+                   , "primop-data-decl.hs-incl"
+                   , "primop-tag.hs-incl"
+                   , "primop-list.hs-incl"
+                   , "primop-strictness.hs-incl"
+                   , "primop-fixity.hs-incl"
+                   , "primop-primop-info.hs-incl"
+                   , "primop-out-of-line.hs-incl"
+                   , "primop-has-side-effects.hs-incl"
+                   , "primop-can-fail.hs-incl"
+                   , "primop-code-size.hs-incl"
+                   , "primop-commutable.hs-incl"
+                   , "primop-vector-tys-exports.hs-incl"
+                   , "primop-vector-tycons.hs-incl"
+                   , "primop-vector-tys.hs-incl" ]
+            need $ srcs ++ extraDeps
             if srcs == []
             then writeFileChanged file ""
             else build $ fullTarget target (GhcM stage) srcs [file]
@@ -36,23 +53,4 @@ buildPackageDependencies _ target @ (PartialTarget stage pkg) =
             need $ hDepFile : cDepFiles -- need all for more parallelism
             cDeps <- fmap concat $ mapM readFile' cDepFiles
             hDeps <- readFile' hDepFile
-            -- TODO: very ugly and fragile; use gcc -MM instead?
-            let hsIncl hs incl = buildPath -/- hs <.> "o" ++ " : "
-                              ++ buildPath -/- incl ++ "\n"
-                extraDeps = if pkg /= compiler then [] else
-                       hsIncl "PrelNames" "primop-vector-uniques.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-data-decl.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-tag.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-list.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-strictness.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-fixity.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-primop-info.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-out-of-line.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-has-side-effects.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-can-fail.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-code-size.hs-incl"
-                    ++ hsIncl "PrimOp"    "primop-commutable.hs-incl"
-                    ++ hsIncl "TysPrim"   "primop-vector-tys-exports.hs-incl"
-                    ++ hsIncl "TysPrim"   "primop-vector-tycons.hs-incl"
-                    ++ hsIncl "TysPrim"   "primop-vector-tys.hs-incl"
-            writeFileChanged file $ cDeps ++ hDeps ++ extraDeps
+            writeFileChanged file $ cDeps ++ hDeps



More information about the ghc-commits mailing list