summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Module/Graph.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-02-17 15:04:07 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-02-25 10:33:57 +0000
commit0e7c13bf86b40054b1cecf1187c08c23fad5d0fb (patch)
treea4dfb5eadd629bcce5a73aa95ce2b40c11226468 /compiler/GHC/Unit/Module/Graph.hs
parent16b3b84e280e16cd8126be88a10035a610e256fd (diff)
downloadhaskell-wip/add-boot-edge.tar.gz
driver: Properly add an edge between a .hs and its hs-boot filewip/add-boot-edge
As noted in #21071 we were missing adding this edge so there were situations where the .hs file would get compiled before the .hs-boot file which leads to issues with -j. I fixed this properly by adding the edge in downsweep so the definition of nodeDependencies can be simplified to avoid adding this dummy edge in. There are plenty of tests which seem to have these redundant boot files anyway so no new test. #21094 tracks the more general issue of identifying redundant hs-boot and SOURCE imports.
Diffstat (limited to 'compiler/GHC/Unit/Module/Graph.hs')
-rw-r--r--compiler/GHC/Unit/Module/Graph.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/GHC/Unit/Module/Graph.hs b/compiler/GHC/Unit/Module/Graph.hs
index 7ebc6c893b..08c9b727ca 100644
--- a/compiler/GHC/Unit/Module/Graph.hs
+++ b/compiler/GHC/Unit/Module/Graph.hs
@@ -53,7 +53,7 @@ import GHC.Driver.Backend
import GHC.Driver.Ppr
import GHC.Driver.Session
-import GHC.Types.SourceFile ( hscSourceString, HscSource (HsBootFile) )
+import GHC.Types.SourceFile ( hscSourceString )
import GHC.Unit.Module.ModSummary
import GHC.Unit.Module.Env
@@ -309,10 +309,8 @@ nodeDependencies drop_hs_boot_nodes = \case
LinkNode deps _uid -> deps
InstantiationNode uid iuid ->
NodeKey_Module . (\mod -> ModNodeKeyWithUid (GWIB mod NotBoot) uid) <$> uniqDSetToList (instUnitHoles iuid)
- ModuleNode deps ms ->
- [ NodeKey_Module $ (ModNodeKeyWithUid (GWIB (ms_mod_name ms) IsBoot) (ms_unitid ms))
- | not $ drop_hs_boot_nodes || ms_hsc_src ms == HsBootFile
- ] ++ map drop_hs_boot deps
+ ModuleNode deps _ms ->
+ map drop_hs_boot deps
where
-- Drop hs-boot nodes by using HsSrcFile as the key
hs_boot_key | drop_hs_boot_nodes = NotBoot -- is regular mod or signature