[commit: ghc] master: GHCi info: Use src file for cache invalidation (969e747)
git at git.haskell.org
git at git.haskell.org
Fri Mar 2 21:54:01 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/969e747f67f57f7dd57c2e549d6a007505671158/ghc
>---------------------------------------------------------------
commit 969e747f67f57f7dd57c2e549d6a007505671158
Author: alexbiehl <alex.biehl at gmail.com>
Date: Fri Mar 2 16:11:45 2018 -0500
GHCi info: Use src file for cache invalidation
Prior to this patch GHCi used the modification time of a module's object
file to invalidate the info cache.
We now look at the modification time of the source file, if present.
This addresses part of
https://ghc.haskell.org/trac/ghc/ticket/12706#comment:3.
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: lelf, alpmestan, rwbarton, thomie, carter
GHC Trac Issues: #12706
Differential Revision: https://phabricator.haskell.org/D4459
>---------------------------------------------------------------
969e747f67f57f7dd57c2e549d6a007505671158
ghc/GHCi/UI/Info.hs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs
index fd8749a..ad390dd 100644
--- a/ghc/GHCi/UI/Info.hs
+++ b/ghc/GHCi/UI/Info.hs
@@ -276,7 +276,9 @@ collectInfo ms loaded = do
cacheInvalid name = case M.lookup name ms of
Nothing -> return True
Just mi -> do
- let fp = ml_obj_file (ms_location (modinfoSummary mi))
+ let src_fp = ml_hs_file (ms_location (modinfoSummary mi))
+ obj_fp = ml_obj_file (ms_location (modinfoSummary mi))
+ fp = fromMaybe obj_fp src_fp
last' = modinfoLastUpdate mi
exists <- doesFileExist fp
if exists
More information about the ghc-commits
mailing list