diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-08 11:16:51 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-08 13:02:18 +0000 |
commit | 04d01c61fcecb0f426c42fe5b1554609e49d1d8a (patch) | |
tree | c9fcfba3d087b028bb3fade6060ea75e9159431f | |
parent | 27581d77d489119da5dc1104793503b10240660d (diff) | |
download | haskell-wip/hpt-some-instances-below.tar.gz |
driver: Filter out our own boot module in hptSomeThingsBelowwip/hpt-some-instances-below
hptSomeThingsBelow would return a list of modules which contain the
.hs-boot file for a particular module. This caused some problems because
we would try and find the module in the HPT (but it's not there when
we're compiling the module itself).
Fixes #21058
-rw-r--r-- | compiler/GHC/Driver/Env.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Env.hs b/compiler/GHC/Driver/Env.hs index 242cd3c39a..8bc1f516bf 100644 --- a/compiler/GHC/Driver/Env.hs +++ b/compiler/GHC/Driver/Env.hs @@ -299,7 +299,7 @@ hptSomeThingsBelowUs extract include_hi_boot hsc_env uid mn [ thing | -- Find each non-hi-boot module below me - (ModNodeKeyWithUid (GWIB { gwib_mod = mod, gwib_isBoot = is_boot }) uid) <- Set.toList (hptModulesBelow hsc_env uid mn) + (ModNodeKeyWithUid (GWIB { gwib_mod = mod, gwib_isBoot = is_boot }) mod_uid) <- Set.toList (hptModulesBelow hsc_env uid mn) , include_hi_boot || (is_boot == NotBoot) -- unsavoury: when compiling the base package with --make, we @@ -307,12 +307,15 @@ hptSomeThingsBelowUs extract include_hi_boot hsc_env uid mn -- be in the HPT, because we never compile it; it's in the EPT -- instead. ToDo: clean up, and remove this slightly bogus filter: , mod /= moduleName gHC_PRIM + , not (mod == gwib_mod mn && uid == mod_uid) -- Look it up in the HPT - , let things = case lookupHug hug uid mod of + , let things = case lookupHug hug mod_uid mod of Just info -> extract info Nothing -> pprTrace "WARNING in hptSomeThingsBelowUs" msg mempty msg = vcat [text "missing module" <+> ppr mod, + text "When starting from" <+> ppr mn, + text "below:" <+> ppr (hptModulesBelow hsc_env uid mn), text "Probable cause: out-of-date interface files"] -- This really shouldn't happen, but see #962 , thing <- things |