diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-07-05 14:16:35 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-21 02:45:39 -0400 |
commit | 9eb1641e0ef10a7887e794d4d114c9a18a2fd265 (patch) | |
tree | 2974508390083775e3bf2c4efcc2113a4c07a2c3 /compiler/GHC/Unit/Module | |
parent | d706fd0432925caf62673a55237a005e22bc4450 (diff) | |
download | haskell-9eb1641e0ef10a7887e794d4d114c9a18a2fd265.tar.gz |
driver: Fix recompilation for modules importing GHC.Prim
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')
-rw-r--r-- | compiler/GHC/Unit/Module/ModSummary.hs | 3 |
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 ++ |