From 969e747f67f57f7dd57c2e549d6a007505671158 Mon Sep 17 00:00:00 2001 From: alexbiehl Date: Fri, 2 Mar 2018 16:11:45 -0500 Subject: 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 --- ghc/GHCi/UI/Info.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ghc') 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 -- cgit v1.2.1