[commit: ghc] wip/nfs-locking: Fix buildProgram (7b00fa7)

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


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

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

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

commit 7b00fa7081555a5753c90ba8b48d2579cc59be9c
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Oct 30 23:57:13 2016 +0000

    Fix buildProgram


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

7b00fa7081555a5753c90ba8b48d2579cc59be9c
 src/Rules/Program.hs | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/Rules/Program.hs b/src/Rules/Program.hs
index 98922a5..319ca72 100644
--- a/src/Rules/Program.hs
+++ b/src/Rules/Program.hs
@@ -29,15 +29,23 @@ wrappers = [ (vanillaContext Stage0 ghc   , ghcWrapper   )
 
 buildProgram :: [(Resource, Int)] -> Context -> Rules ()
 buildProgram rs context at Context {..} = when (isProgram package) $ do
+    let installStage = do
+            latest <- latestBuildStage package -- isJust below is safe
+            return $ if package == ghc then stage else fromJust latest
+
     buildPath context -/- programName context <.> exe %>
         buildBinaryAndWrapper rs context
 
     -- Rules for programs built in install directories
-    when (stage == Stage0 || package == ghc) $
-        installPath package -/- programName context <.> exe %> \bin -> do
-            latest <- latestBuildStage package -- isJust below is safe
-            let binStage = if package == ghc then stage else fromJust latest
+    when (stage == Stage0 || package == ghc) $ do
+        -- Some binaries in programInplacePath are wrapped
+        programInplacePath -/- programName context <.> exe %> \bin -> do
+            binStage <- installStage
             buildBinaryAndWrapper rs (context { stage = binStage }) bin
+        -- We build only unwrapped binaries in programInplaceLibPath
+        programInplaceLibPath -/- programName context <.> exe %> \bin -> do
+            binStage <- installStage
+            buildBinary rs (context { stage = binStage }) bin
 
 buildBinaryAndWrapper :: [(Resource, Int)] -> Context -> FilePath -> Action ()
 buildBinaryAndWrapper rs context bin = do



More information about the ghc-commits mailing list