summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Module/ModSummary.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-07-05 14:16:35 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-07-20 10:59:08 +0100
commit71ccf4999d02aead5c518897c73c0b8eb9f6795f (patch)
treea9f28a0abb4a50a316e797f9c81ea95e8022e609 /compiler/GHC/Unit/Module/ModSummary.hs
parent58b960d2af0ebfc37104ec68a4df377a074951dd (diff)
downloadhaskell-wip/t20084.tar.gz
driver: Fix recompilation for modules importing GHC.Primwip/t20084
The GHC.Prim module is quite special as there is no interface file, therefore it doesn't appear in ms_textual_imports, but the ghc-prim package does appear in the direct package dependencies. This confused the recompilation checking which couldn't find any modules from ghc-prim and concluded that the package was no longer a dependency. The fix is to keep track of whether GHC.Prim is imported separately in the relevant places. Fixes #20084
Diffstat (limited to 'compiler/GHC/Unit/Module/ModSummary.hs')
-rw-r--r--compiler/GHC/Unit/Module/ModSummary.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Unit/Module/ModSummary.hs b/compiler/GHC/Unit/Module/ModSummary.hs
index 339afd4564..d36636e340 100644
--- a/compiler/GHC/Unit/Module/ModSummary.hs
+++ b/compiler/GHC/Unit/Module/ModSummary.hs
@@ -90,6 +90,8 @@ data ModSummary
-- ^ Source imports of the module
ms_textual_imps :: [(Maybe FastString, Located ModuleName)],
-- ^ Non-source imports of the module from the module *text*
+ ms_ghc_prim_import :: Bool,
+ -- ^ Whether the special module GHC.Prim was imported explicitliy
ms_parsed_mod :: Maybe HsParsedModule,
-- ^ The parsed, nonrenamed source, if we have it. This is also
-- used to support "inline module syntax" in Backpack files.
@@ -111,6 +113,7 @@ ms_installed_mod = fst . getModuleInstantiation . ms_mod
ms_mod_name :: ModSummary -> ModuleName
ms_mod_name = moduleName . ms_mod
+-- | Textual imports, plus plugin imports but not SOURCE imports.
ms_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)]
ms_imps ms =
ms_textual_imps ms ++