[commit: ghc] wip/nfs-locking: Support autogen paths of new Cabal (5fe4668)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:05:41 UTC 2017


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

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

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

commit 5fe46687bbbde9a82577e9b117378d3f9c027ee1
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jul 14 01:28:02 2016 +0100

    Support autogen paths of new Cabal
    
    See #269.


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

5fe46687bbbde9a82577e9b117378d3f9c027ee1
 src/Rules/Data.hs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/Rules/Data.hs b/src/Rules/Data.hs
index 2da6f86..034b2f4 100644
--- a/src/Rules/Data.hs
+++ b/src/Rules/Data.hs
@@ -38,12 +38,19 @@ buildPackageData context at Context {..} = do
 
     -- TODO: Get rid of this, see #113.
     dataFile %> \mk -> do
+        -- TODO: This is a hack. Add a proper support for autogen directory
+        -- structure of the new Cabal (probably only after #113).
+        let oldBuild
+                | isLibrary package = oldPath -/- "build"
+                | package == ghc    = oldPath -/- "build/ghc"
+                | package == hpcBin = oldPath -/- "build/hpc"
+                | otherwise         = oldPath -/- "build" -/- pkgNameString package
         copyFile inTreeMk mk
-        autogenFiles <- getDirectoryFiles (oldPath -/- "build") ["autogen/*"]
+        autogenFiles <- getDirectoryFiles oldBuild ["autogen/*"]
         createDirectory $ buildPath context -/- "autogen"
         forM_ autogenFiles $ \file' -> do
             let file = unifyPath file'
-            copyFile (oldPath -/- "build" -/- file) (buildPath context -/- file)
+            copyFile (oldBuild -/- file) (buildPath context -/- file)
         let haddockPrologue = "haddock-prologue.txt"
         copyFile (oldPath -/- haddockPrologue) (buildPath context -/- haddockPrologue)
         postProcessPackageData context mk



More information about the ghc-commits mailing list