Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/131a0af32eeaa22f598239c4467b65860af185d1

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

commit 131a0af32eeaa22f598239c4467b65860af185d1
Author: Simon Marlow <[email protected]>
Date:   Wed Nov 23 15:25:35 2011 +0000

    Checking UsageFile: don't fail if the file doesn't exist, just recompile
    
    If a file we depended on last time is missing, we should recompile.
    
    This also makes us insensitive to mistakes when recording dependent
    source files (such as storing a temporary file), but will make more
    recompilation happen instead.  With DEBUG on, you get a warning.

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

 compiler/iface/MkIface.lhs |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 3196614..3edf1d6 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -102,6 +102,7 @@ import ListSetOps
 import Binary
 import Fingerprint
 import Bag
+import Exception
 
 import Control.Monad
 import Data.List
@@ -1324,10 +1325,19 @@ checkModUsage this_pkg UsageHomeModule{
       else up_to_date (ptext (sLit "  Great!  The bits I use are up to date"))
  
 
-checkModUsage _this_pkg UsageFile{ usg_file_path = file, usg_mtime = old_mtime 
} = do
-  new_mtime <- liftIO $ getModificationTime file
-  return $ old_mtime /= new_mtime
-
+checkModUsage _this_pkg UsageFile{ usg_file_path = file,
+                                   usg_mtime = old_mtime } =
+  liftIO $
+    handleIO handle $ do
+      new_mtime <- getModificationTime file
+      return $ old_mtime /= new_mtime
+ where
+   handle =
+#ifdef DEBUG
+       \e -> pprTrace "UsageFile" (text (show e)) $ return True
+#else
+       \_ -> return True -- if we can't find the file, just recompile, don't 
fail
+#endif
 
 ------------------------
 checkModuleFingerprint :: Fingerprint -> Fingerprint -> IfG RecompileRequired



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to