@@ -48,6 +48,14 @@ module Distribution.Client.SolverInstallPlan
4848 , reverseDependencyClosure
4949 , topologicalOrder
5050 , reverseTopologicalOrder
51+ , libraryRoots
52+ , setupRoots
53+ , rootSets
54+ , nonSetupClosure
55+ , qualifications
56+
57+ , dependencyInconsistencies
58+ , dependencyInconsistencies'
5159 ) where
5260
5361import Distribution.Client.Compat.Prelude hiding (toList )
@@ -72,6 +80,7 @@ import Distribution.Version
7280 ( Version
7381 )
7482
83+ import Distribution.Solver.Types.PackagePath (PackagePath , Qualified (.. ))
7584import Distribution.Solver.Types.ResolverPackage
7685import Distribution.Solver.Types.SolverId
7786import Distribution.Solver.Types.SolverPackage
@@ -80,9 +89,12 @@ import Data.Array ((!))
8089import qualified Data.Foldable as Foldable
8190import qualified Data.Graph as OldGraph
8291import qualified Data.Map as Map
92+ import qualified Data.Set as Set
8393import Distribution.Compat.Graph (Graph , IsNode (.. ))
8494import qualified Distribution.Compat.Graph as Graph
8595
96+
97+
8698type SolverPlanPackage = ResolverPackage UnresolvedPkgLoc
8799
88100type SolverPlanIndex = Graph SolverPlanPackage
@@ -314,6 +326,13 @@ rootSets index = [libRoots] ++ setupRoots index
314326 libRoots :: [SolverId ]
315327 libRoots = libraryRoots index
316328
329+ qualifications :: SolverPlanIndex -> Map PackagePath (Set SolverId )
330+ qualifications g = Map. fromListWith (<>)
331+ [ (pp, Set. singleton (solverId spp))
332+ | spp <- Graph. toList g
333+ , let Q pp _pn = solverQPN spp
334+ ]
335+
317336-- | Compute the library roots of a plan
318337--
319338-- The library roots are the set of packages with no reverse dependencies
0 commit comments