summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Module/Graph.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-07-04 12:10:50 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2022-07-05 11:53:57 +0100
commit1e4b4ec1dd0a115f2c7b934518a0f73e8a2cafa8 (patch)
tree17e39989511bafdca1bbcc8e727a2661dfdaeebd /compiler/GHC/Unit/Module/Graph.hs
parent620ee7edc931dc5273dd04880059cc9ec8d41528 (diff)
downloadhaskell-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.hs6
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)