diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-09-23 12:21:56 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-08 22:45:27 -0500 |
commit | d122e02247a371b14c3e906556900c0d600f424d (patch) | |
tree | 59494c5ede8dac829e7d9e31a85293c184ec5598 /compiler/GHC/Iface | |
parent | 74c9bf914b31bfdd4353b7ff31efd2d3725bd2bb (diff) | |
download | haskell-d122e02247a371b14c3e906556900c0d600f424d.tar.gz |
Fix mk_mod_usage_info if the interface file is not already loaded
In #22217 it was observed that the order modules are compiled in affects
the contents of an interface file. This was because a module dependended
on another module indirectly, via a re-export but the interface file for
this module was never loaded because the symbol was never used in the
file.
If we decide that we depend on a module then we jolly well ought to
record this fact in the interface file! Otherwise it could lead to very
subtle recompilation bugs if the dependency is not tracked and the
module is updated.
Therefore the best thing to do is just to make sure the file is loaded
by calling the `loadSysInterface` function. This first checks the
caches (like we did before) but then actually goes to find the interface
on disk if it wasn't loaded.
Fixes #22217
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r-- | compiler/GHC/Iface/Make.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Iface/Make.hs b/compiler/GHC/Iface/Make.hs index 7b779f3ea1..ac55220cbf 100644 --- a/compiler/GHC/Iface/Make.hs +++ b/compiler/GHC/Iface/Make.hs @@ -232,7 +232,7 @@ mkIfaceTc hsc_env safe_mode mod_details mod_summary mb_program -- 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 uc plugins fc unit_env this_mod (imp_mods imports) used_names + usages <- initIfaceLoad hsc_env $ mkUsageInfo uc plugins fc unit_env this_mod (imp_mods imports) used_names dep_files merged needed_links needed_pkgs docs <- extractDocs (ms_hspp_opts mod_summary) tc_result |