@@ -32,13 +32,14 @@ import qualified Distribution.Solver.Modular.PSQ as P
32
32
import qualified Distribution.Solver.Modular.ConflictSet as CS
33
33
34
34
import Distribution.Solver.Types.OptionalStanza
35
+ import Distribution.Solver.Types.PackagePath
35
36
import Distribution.Solver.Types.ComponentDeps (Component )
36
37
37
38
{- ------------------------------------------------------------------------------
38
39
Add linking
39
40
-------------------------------------------------------------------------------}
40
41
41
- type RelatedGoals = Map (PN , I ) [PP ]
42
+ type RelatedGoals = Map (PN , I ) [PackagePath ]
42
43
type Linker = Reader RelatedGoals
43
44
44
45
-- | Introduce link nodes into tree tree
@@ -80,7 +81,7 @@ linkChoices :: RelatedGoals -> QPN -> (POption, Tree QGoalReason) -> [(POption,
80
81
linkChoices related (Q _pp pn) (POption i Nothing , subtree) =
81
82
map aux (M. findWithDefault [] (pn, i) related)
82
83
where
83
- aux :: PP -> (POption , Tree QGoalReason )
84
+ aux :: PackagePath -> (POption , Tree QGoalReason )
84
85
aux pp = (POption i (Just pp), subtree)
85
86
linkChoices _ _ (POption _ (Just _), _) =
86
87
alreadyLinked
@@ -224,7 +225,7 @@ pickConcrete qpn@(Q pp _) i = do
224
225
Just lg ->
225
226
makeCanonical lg qpn i
226
227
227
- pickLink :: QPN -> I -> PP -> FlaggedDeps Component QPN -> UpdateState ()
228
+ pickLink :: QPN -> I -> PackagePath -> FlaggedDeps Component QPN -> UpdateState ()
228
229
pickLink qpn@ (Q _pp pn) i pp' deps = do
229
230
vs <- get
230
231
@@ -246,7 +247,7 @@ pickLink qpn@(Q _pp pn) i pp' deps = do
246
247
-- Verify here that the member we add is in fact for the same package and
247
248
-- matches the version of the canonical instance. However, violations of
248
249
-- these checks would indicate a bug in the linker, not a true conflict.
249
- let sanityCheck :: Maybe (PI PP ) -> Bool
250
+ let sanityCheck :: Maybe (PI PackagePath ) -> Bool
250
251
sanityCheck Nothing = False
251
252
sanityCheck (Just (PI _ canonI)) = pn == lgPackage lgTarget && i == canonI
252
253
assert (sanityCheck (lgCanon lgTarget)) $ return ()
@@ -476,10 +477,10 @@ data LinkGroup = LinkGroup {
476
477
--
477
478
-- We may not know this yet (if we are constructing link groups
478
479
-- for dependencies)
479
- , lgCanon :: Maybe (PI PP )
480
+ , lgCanon :: Maybe (PI PackagePath )
480
481
481
482
-- | The members of the link group
482
- , lgMembers :: Set PP
483
+ , lgMembers :: Set PackagePath
483
484
484
485
-- | The set of variables that should be added to the conflict set if
485
486
-- something goes wrong with this link set (in addition to the members
@@ -509,19 +510,19 @@ showLinkGroup :: LinkGroup -> String
509
510
showLinkGroup lg =
510
511
" {" ++ intercalate " ," (map showMember (S. toList (lgMembers lg))) ++ " }"
511
512
where
512
- showMember :: PP -> String
513
+ showMember :: PackagePath -> String
513
514
showMember pp = case lgCanon lg of
514
515
Just (PI pp' _i) | pp == pp' -> " *"
515
516
_otherwise -> " "
516
517
++ case lgInstance lg of
517
518
Nothing -> showQPN (qpn pp)
518
519
Just i -> showPI (PI (qpn pp) i)
519
520
520
- qpn :: PP -> QPN
521
+ qpn :: PackagePath -> QPN
521
522
qpn pp = Q pp (lgPackage lg)
522
523
523
524
-- | Creates a link group that contains a single member.
524
- lgSingleton :: QPN -> Maybe (PI PP ) -> LinkGroup
525
+ lgSingleton :: QPN -> Maybe (PI PackagePath ) -> LinkGroup
525
526
lgSingleton (Q pp pn) canon = LinkGroup {
526
527
lgPackage = pn
527
528
, lgCanon = canon
0 commit comments