diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-17 15:04:07 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-01 16:23:10 -0500 |
commit | c84dc5065bcf5c87dd3d10421c99aa6941754f57 (patch) | |
tree | 1cca772e5c8c82140dfe721a7114899f6e77a13c /compiler/GHC/Unit/Module | |
parent | 547742682702f08041e518d68d752ef6329843c3 (diff) | |
download | haskell-c84dc5065bcf5c87dd3d10421c99aa6941754f57.tar.gz |
driver: Properly add an edge between a .hs and its hs-boot file
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')
-rw-r--r-- | compiler/GHC/Unit/Module/Graph.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/GHC/Unit/Module/Graph.hs b/compiler/GHC/Unit/Module/Graph.hs index 1743d9edb3..e77b38a33f 100644 --- a/compiler/GHC/Unit/Module/Graph.hs +++ b/compiler/GHC/Unit/Module/Graph.hs @@ -49,7 +49,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 @@ -281,10 +281,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 |