From 25977ab542a30df4ae71d9699d015bcdd1ab7cfb Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 5 May 2021 14:02:37 +0100 Subject: Driver Rework Patch This patch comprises of four different but closely related ideas. The net result is fixing a large number of open issues with the driver whilst making it simpler to understand. 1. Use the hash of the source file to determine whether the source file has changed or not. This makes the recompilation checking more robust to modern build systems which are liable to copy files around changing their modification times. 2. Remove the concept of a "stable module", a stable module was one where the object file was older than the source file, and all transitive dependencies were also stable. Now we don't rely on the modification time of the source file, the notion of stability is moot. 3. Fix TH/plugin recompilation after the removal of stable modules. The TH recompilation check used to rely on stable modules. Now there is a uniform and simple way, we directly track the linkables which were loaded into the interpreter whilst compiling a module. This is an over-approximation but more robust wrt package dependencies changing. 4. Fix recompilation checking for dynamic object files. Now we actually check if the dynamic object file exists when compiling with -dynamic-too Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093 --- compiler/GHC/Unit/Module/ModGuts.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/GHC/Unit/Module/ModGuts.hs') diff --git a/compiler/GHC/Unit/Module/ModGuts.hs b/compiler/GHC/Unit/Module/ModGuts.hs index 640c258273..b40c980744 100644 --- a/compiler/GHC/Unit/Module/ModGuts.hs +++ b/compiler/GHC/Unit/Module/ModGuts.hs @@ -1,5 +1,6 @@ module GHC.Unit.Module.ModGuts ( ModGuts (..) + , mg_mnwib , CgGuts (..) ) where @@ -31,7 +32,7 @@ import GHC.Types.ForeignStubs import GHC.Types.HpcInfo import GHC.Types.Name.Reader import GHC.Types.SafeHaskell -import GHC.Types.SourceFile ( HscSource(..) ) +import GHC.Types.SourceFile ( HscSource(..), hscSourceToIsBoot ) import GHC.Types.SrcLoc @@ -96,6 +97,9 @@ data ModGuts mg_arg_docs :: !ArgDocMap -- ^ Docs on arguments. } +mg_mnwib :: ModGuts -> ModuleNameWithIsBoot +mg_mnwib mg = GWIB (moduleName (mg_module mg)) (hscSourceToIsBoot (mg_hsc_src mg)) + -- The ModGuts takes on several slightly different forms: -- -- After simplification, the following fields change slightly: -- cgit v1.2.1