[commit: ghc] wip/nfs-locking: Further work on #174. (1300254)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:11:37 UTC 2017


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

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

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

commit 130025463ea2a8b50decceae44c2618198466acd
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Jan 17 03:01:26 2016 +0000

    Further work on #174.


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

130025463ea2a8b50decceae44c2618198466acd
 src/Rules/Compile.hs            | 14 ++++++++++----
 src/Settings/Packages/RunGhc.hs |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/Rules/Compile.hs b/src/Rules/Compile.hs
index 2065415..b27d36e 100644
--- a/src/Rules/Compile.hs
+++ b/src/Rules/Compile.hs
@@ -12,7 +12,7 @@ compilePackage _ target @ (PartialTarget stage pkg) = do
     let buildPath = targetPath stage pkg -/- "build"
 
     matchBuildResult buildPath "hi" ?> \hi ->
-        if compileInterfaceFilesSeparately
+        if compileInterfaceFilesSeparately && not ("//HpcParser.*" ?== hi)
         then do
             let way = detectWay hi
             (src, deps) <- dependencies buildPath $ hi -<.> osuf way
@@ -32,16 +32,22 @@ compilePackage _ target @ (PartialTarget stage pkg) = do
     -- TODO: add dependencies for #include of .h and .hs-incl files (gcc -MM?)
     matchBuildResult buildPath "o" ?> \obj -> do
         (src, deps) <- dependencies buildPath obj
-        need $ src : deps
         if ("//*.c" ?== src)
-        then build $ fullTarget target (Gcc stage) [src] [obj]
+        then do
+            need $ src : deps
+            build $ fullTarget target (Gcc stage) [src] [obj]
         else do
             let way = detectWay obj
+            if compileInterfaceFilesSeparately && "//*.hs" ?== src && not ("//HpcParser.*" ?== src)
+            then need $ (obj -<.> hisuf (detectWay obj)) : src : deps
+            else need $ src : deps
             build $ fullTargetWithWay target (Ghc stage) way [src] [obj]
 
     -- TODO: get rid of these special cases
     matchBuildResult buildPath "o-boot" ?> \obj -> do
         (src, deps) <- dependencies buildPath obj
-        need $ src : deps
         let way = detectWay obj
+        if compileInterfaceFilesSeparately
+        then need $ (obj -<.> hibootsuf (detectWay obj)) : src : deps
+        else need $ src : deps
         build $ fullTargetWithWay target (Ghc stage) way [src] [obj]
diff --git a/src/Settings/Packages/RunGhc.hs b/src/Settings/Packages/RunGhc.hs
index 37cdb95..e982fe6 100644
--- a/src/Settings/Packages/RunGhc.hs
+++ b/src/Settings/Packages/RunGhc.hs
@@ -9,5 +9,5 @@ runGhcPackageArgs :: Args
 runGhcPackageArgs = package runGhc ? do
     version <- getSetting ProjectVersion
     mconcat [ builderGhc ?
-              file "//Main.o" ?
+              file "//Main.*" ?
               append ["-cpp", "-DVERSION=\"" ++ version ++ "\""] ]



More information about the ghc-commits mailing list