summaryrefslogtreecommitdiff
path: root/compiler/iface/MkIface.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-03-25 22:50:55 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2017-04-02 16:39:40 -0700
commit5fb485a3e1e83a1f5c6acf989be292940229e1a4 (patch)
tree755ff931bfe2fc94d5985464d1a623b4c8ab06d0 /compiler/iface/MkIface.hs
parentd4e8ebcd04cc210bd15a1fd7677558e8b04b3da8 (diff)
downloadhaskell-5fb485a3e1e83a1f5c6acf989be292940229e1a4.tar.gz
Fix recompilation avoidance bug for implementor of hsig.
Summary: I observed a bug where if I modified the module which implemented an hsig in another package, GHC would not recompile the signature in this situation. The root cause was that we were conflating modules from user imports, and "system" module dependencies (from signature merging and instantiation.) So this patch handles them separately. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, bgamari, austin Subscribers: rwbarton, thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3381
Diffstat (limited to 'compiler/iface/MkIface.hs')
-rw-r--r--compiler/iface/MkIface.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index a3418860b5..435d06c5db 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -163,7 +163,6 @@ mkIfaceTc :: HscEnv
-> IO (ModIface, Bool)
mkIfaceTc hsc_env maybe_old_fingerprint safe_mode mod_details
tc_result@TcGblEnv{ tcg_mod = this_mod,
- tcg_semantic_mod = semantic_mod,
tcg_src = hsc_src,
tcg_imports = imports,
tcg_rdr_env = rdr_env,
@@ -180,7 +179,14 @@ mkIfaceTc hsc_env maybe_old_fingerprint safe_mode mod_details
let hpc_info = emptyHpcInfo other_hpc_info
used_th <- readIORef tc_splice_used
dep_files <- (readIORef dependent_files)
- usages <- mkUsageInfo hsc_env semantic_mod (imp_mods imports) used_names dep_files merged
+ -- Do NOT use semantic module here; this_mod in mkUsageInfo
+ -- is used solely to decide if we should record a dependency
+ -- or not. When we instantiate a signature, the semantic
+ -- module is something we want to record dependencies for,
+ -- but if you pass that in here, we'll decide it's the local
+ -- module and does not need to be recorded as a dependency.
+ -- See Note [Identity versus semantic module]
+ usages <- mkUsageInfo hsc_env this_mod (imp_mods imports) used_names dep_files merged
mkIface_ hsc_env maybe_old_fingerprint
this_mod hsc_src
used_th deps rdr_env