summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2018-03-02 16:11:45 -0500
committerBen Gamari <ben@smart-cactus.org>2018-03-02 16:11:47 -0500
commit969e747f67f57f7dd57c2e549d6a007505671158 (patch)
treed9e87c4b4deaa3d6fee679f583a15bfdc9edc68b /ghc
parent17739645ce5a5d4b46b1de8d43e87b318a98ae6b (diff)
downloadhaskell-969e747f67f57f7dd57c2e549d6a007505671158.tar.gz
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
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI/Info.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs
index fd8749a3e1..ad390dd433 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