[commit: ghc] wip/nfs-locking: Fix performance drop due to improper use of removeFiles. (18a779b)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:34:39 UTC 2017


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

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

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

commit 18a779b20d3084cc681ce28ff88ca6b97d45903f
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Aug 11 00:16:38 2015 +0100

    Fix performance drop due to improper use of removeFiles.


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

18a779b20d3084cc681ce28ff88ca6b97d45903f
 src/Rules/Dependencies.hs | 3 ++-
 src/Rules/Library.hs      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 90c764f..8fb890e 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -11,6 +11,7 @@ import Settings.Util
 import Settings.TargetDirectory
 import Rules.Actions
 import Rules.Resources
+import qualified System.Directory as IO
 
 buildPackageDependencies :: Resources -> StagePackageTarget -> Rules ()
 buildPackageDependencies _ target =
@@ -30,7 +31,7 @@ buildPackageDependencies _ target =
             srcs <- interpret target getPackageSources
             need srcs
             build $ fullTarget target (GhcM stage) srcs [file]
-            liftIO $ removeFiles "." [hDepFile <.> "bak"]
+            liftIO . IO.removeFile $ file <.> "bak"
 
         (buildPath -/- ".dependencies") %> \file -> do
             cSrcs <- pkgDataList $ CSrcs path
diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs
index 87a37ca..4619651 100644
--- a/src/Rules/Library.hs
+++ b/src/Rules/Library.hs
@@ -25,7 +25,7 @@ buildPackageLibrary _ target = do
 
     -- TODO: handle dynamic libraries
     matchBuildResult buildPath "a" ?> \a -> do
-        liftIO $ removeFiles "." [a]
+        liftIO $ IO.removeFile a
         cSrcs   <- interpret target $ getPkgDataList CSrcs
         modules <- interpret target $ getPkgDataList Modules
 



More information about the ghc-commits mailing list