[commit: ghc] wip/nfs-locking: Drop redundant createDirectory calls (7041682)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:27:44 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/7041682e77204d718def64aee7d0c768ffd685bd/ghc
>---------------------------------------------------------------
commit 7041682e77204d718def64aee7d0c768ffd685bd
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Mon Oct 31 19:50:36 2016 +0000
Drop redundant createDirectory calls
>---------------------------------------------------------------
7041682e77204d718def64aee7d0c768ffd685bd
src/Rules/Data.hs | 1 -
src/Rules/Gmp.hs | 2 --
src/Rules/Libffi.hs | 1 -
src/Util.hs | 2 +-
4 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/Rules/Data.hs b/src/Rules/Data.hs
index 65c6392..ab8ac97 100644
--- a/src/Rules/Data.hs
+++ b/src/Rules/Data.hs
@@ -47,7 +47,6 @@ buildPackageData context at Context {..} = do
| otherwise = oldPath -/- "build" -/- pkgNameString package
copyFile inTreeMk mk
autogenFiles <- getDirectoryFiles oldBuild ["autogen/*"]
- createDirectory $ buildPath context -/- "autogen"
forM_ autogenFiles $ \file' -> do
let file = unifyPath file'
copyFile (oldBuild -/- file) (buildPath context -/- file)
diff --git a/src/Rules/Gmp.hs b/src/Rules/Gmp.hs
index 1024533..2409b6e 100644
--- a/src/Rules/Gmp.hs
+++ b/src/Rules/Gmp.hs
@@ -44,14 +44,12 @@ gmpRules = do
any (`isInfixOf` configMk) [ "HaveFrameworkGMP = YES", "HaveLibGmp = YES" ]
then do
putBuild "| GMP library/framework detected and will be used"
- createDirectory $ takeDirectory header
copyFile (gmpBase -/- "ghc-gmp.h") header
else do
putBuild "| No GMP library/framework detected; in tree GMP will be built"
need [gmpLibrary]
createDirectory gmpObjects
build $ Target gmpContext Ar [gmpLibrary] [gmpObjects]
- createDirectory $ takeDirectory header
copyFile (gmpBuildPath -/- "gmp.h") header
copyFile (gmpBuildPath -/- "gmp.h") gmpLibraryInTreeH
diff --git a/src/Rules/Libffi.hs b/src/Rules/Libffi.hs
index ae1c06f..8d72017 100644
--- a/src/Rules/Libffi.hs
+++ b/src/Rules/Libffi.hs
@@ -70,7 +70,6 @@ libffiRules = do
libffiMakefile <.> "in" %> \mkIn -> do
removeDirectory libffiBuildPath
- createDirectory $ buildRootPath -/- stageString Stage0
tarball <- unifyPath . getSingleton "Exactly one LibFFI tarball is expected"
<$> getDirectoryFiles "" ["libffi-tarballs/libffi*.tar.gz"]
diff --git a/src/Util.hs b/src/Util.hs
index f2e6516..81f67dd 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -92,7 +92,7 @@ captureStdout target path argList = do
Stdout output <- cmd [path] argList
writeFileChanged file output
--- | Copy a file tracking the source.
+-- | Copy a file tracking the source, create the target directory if missing.
copyFile :: FilePath -> FilePath -> Action ()
copyFile source target = do
need [source] -- Guarantee source is built before printing progress info.
More information about the ghc-commits
mailing list