diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-17 15:04:07 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-25 10:33:57 +0000 |
commit | 0e7c13bf86b40054b1cecf1187c08c23fad5d0fb (patch) | |
tree | a4dfb5eadd629bcce5a73aa95ce2b40c11226468 /compiler/GHC/Driver/Backpack.hs | |
parent | 16b3b84e280e16cd8126be88a10035a610e256fd (diff) | |
download | haskell-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/Driver/Backpack.hs')
-rw-r--r-- | compiler/GHC/Driver/Backpack.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/Backpack.hs b/compiler/GHC/Driver/Backpack.hs index b4e530a3e9..a0a66b251f 100644 --- a/compiler/GHC/Driver/Backpack.hs +++ b/compiler/GHC/Driver/Backpack.hs @@ -920,7 +920,12 @@ hsModuleToModSummary home_keys pn hsc_src modname -- Now, what are the dependencies. let inst_nodes = map NodeKey_Unit inst_deps - mod_nodes = [k | (_, mnwib) <- msDeps ms, let k = NodeKey_Module (ModNodeKeyWithUid (fmap unLoc mnwib) (moduleUnitId this_mod)), k `elem` home_keys] + mod_nodes = + -- hs-boot edge + [k | k <- [NodeKey_Module (ModNodeKeyWithUid (GWIB (ms_mod_name ms) IsBoot) (moduleUnitId this_mod))], NotBoot == isBootSummary ms, k `elem` home_keys ] ++ + -- Normal edges + [k | (_, mnwib) <- msDeps ms, let k = NodeKey_Module (ModNodeKeyWithUid (fmap unLoc mnwib) (moduleUnitId this_mod)), k `elem` home_keys] + return (ModuleNode (mod_nodes ++ inst_nodes) ms) |