summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-02-08 11:16:51 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-09 08:30:22 -0500
commit1dbe5b2a97c41b3f24a48372ba25faeae08e8cd6 (patch)
tree0294a5d711591173438f8fc500dc395673a1f947
parentfad0b2b01c24159bea9204d45e38fb89eb0d7403 (diff)
downloadhaskell-1dbe5b2a97c41b3f24a48372ba25faeae08e8cd6.tar.gz
driver: Filter out our own boot module in hptSomeThingsBelow
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.hs7
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