Tweaks to dynamic-too code
authorIan Lynagh <ian@well-typed.com>
Fri, 7 Dec 2012 23:20:19 +0000 (23:20 +0000)
committerIan Lynagh <ian@well-typed.com>
Fri, 7 Dec 2012 23:20:19 +0000 (23:20 +0000)
compiler/iface/LoadIface.lhs
compiler/main/DynFlags.hs

index 3d5016f..6d23419 100644 (file)
@@ -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}
 
index b4edef1..ceae7c2 100644 (file)
@@ -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 []