Commit 969e747f authored by alexbiehl's avatar alexbiehl Committed by Ben Gamari

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
parent 17739645
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment