diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-07-04 12:10:50 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-07-05 11:53:57 +0100 |
commit | 1e4b4ec1dd0a115f2c7b934518a0f73e8a2cafa8 (patch) | |
tree | 17e39989511bafdca1bbcc8e727a2661dfdaeebd /compiler/GHC/Unit/Module/Graph.hs | |
parent | 620ee7edc931dc5273dd04880059cc9ec8d41528 (diff) | |
download | haskell-wip/t21814.tar.gz |
driver: Fix issue with module loops and multiple home unitswip/t21814
We were attempting to rehydrate all dependencies of a particular module,
but we actually only needed to rehydrate those of the current package
(as those are the ones participating in the loop).
This fixes loading GHC into a multi-unit session.
Fixes #21814
Diffstat (limited to 'compiler/GHC/Unit/Module/Graph.hs')
-rw-r--r-- | compiler/GHC/Unit/Module/Graph.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/GHC/Unit/Module/Graph.hs b/compiler/GHC/Unit/Module/Graph.hs index c09d778086..29d2356a75 100644 --- a/compiler/GHC/Unit/Module/Graph.hs +++ b/compiler/GHC/Unit/Module/Graph.hs @@ -28,6 +28,7 @@ module GHC.Unit.Module.Graph , summaryNodeSummary , NodeKey(..) + , nodeKeyUnitId , ModNodeKey , mkNodeKey , msKey @@ -121,6 +122,11 @@ pprNodeKey (NodeKey_Unit iu) = ppr iu pprNodeKey (NodeKey_Module mk) = ppr mk pprNodeKey (NodeKey_Link uid) = ppr uid +nodeKeyUnitId :: NodeKey -> UnitId +nodeKeyUnitId (NodeKey_Unit iu) = instUnitInstanceOf iu +nodeKeyUnitId (NodeKey_Module mk) = mnkUnitId mk +nodeKeyUnitId (NodeKey_Link uid) = uid + data ModNodeKeyWithUid = ModNodeKeyWithUid { mnkModuleName :: ModuleNameWithIsBoot , mnkUnitId :: UnitId } deriving (Eq, Ord) |