[commit: ghc] master: Tweaks to dynamic-too code (609aecb)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/609aecb7c613b643a5358838e4f12c2ef71e2df6

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

commit 609aecb7c613b643a5358838e4f12c2ef71e2df6
Author: Ian Lynagh <[email protected]>
Date:   Fri Dec 7 23:20:19 2012 +0000

    Tweaks to dynamic-too code

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

 compiler/iface/LoadIface.lhs |    8 ++++++--
 compiler/main/DynFlags.hs    |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs
index 3d5016f..6d23419 100644
--- a/compiler/iface/LoadIface.lhs
+++ b/compiler/iface/LoadIface.lhs
@@ -568,8 +568,12 @@ findAndReadIface doc_str mod hi_boot_file
                           Succeeded (dynIface, _)
                            | mi_mod_hash iface == mi_mod_hash dynIface ->
                               return ()
-                          _ ->
-                              liftIO $ writeIORef ref False
+                           | otherwise ->
+                              do traceIf (text "Dynamic hash doesn't match")
+                                 liftIO $ writeIORef ref False
+                          Failed err ->
+                              do traceIf (text "Failed to load dynamic interface file:" $$ err)
+                                 liftIO $ writeIORef ref False
           checkBuildDynamicToo _ = return ()
 \end{code}
 
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index b4edef1..ceae7c2 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1115,7 +1115,7 @@ wayOptP _ WayNDP      = []
 -- | Used by 'GHC.newSession' to partially initialize a new 'DynFlags' value
 initDynFlags :: DynFlags -> IO DynFlags
 initDynFlags dflags = do
- refCanGenerateDynamicToo <- newIORef False
+ refCanGenerateDynamicToo <- newIORef True
  refFilesToClean <- newIORef []
  refDirsToClean <- newIORef Map.empty
  refFilesToNotIntermediateClean <- newIORef []
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.