Copyright | (c) Duncan Coutts 2008 |
---|---|
License | BSD-like |
Maintainer | duncan@community.haskell.org |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The SolverInstallPlan
is the graph of packages produced by the
dependency solver, and specifies at the package-granularity what
things are going to be installed. To put it another way: the
dependency solver produces a SolverInstallPlan
, which is then
consumed by various other parts of Cabal.
Synopsis
- data SolverInstallPlan = SolverInstallPlan {
- planIndex :: !SolverPlanIndex
- planIndepGoals :: !IndependentGoals
- type SolverPlanPackage = ResolverPackage UnresolvedPkgLoc
- data ResolverPackage loc
- new :: IndependentGoals -> SolverPlanIndex -> Either [SolverPlanProblem] SolverInstallPlan
- toList :: SolverInstallPlan -> [SolverPlanPackage]
- toMap :: SolverInstallPlan -> Map SolverId SolverPlanPackage
- remove :: (SolverPlanPackage -> Bool) -> SolverInstallPlan -> Either [SolverPlanProblem] SolverInstallPlan
- showPlanIndex :: [SolverPlanPackage] -> String
- showInstallPlan :: SolverInstallPlan -> String
- valid :: IndependentGoals -> SolverPlanIndex -> Bool
- closed :: SolverPlanIndex -> Bool
- consistent :: SolverPlanIndex -> Bool
- acyclic :: SolverPlanIndex -> Bool
- data SolverPlanProblem
- showPlanProblem :: SolverPlanProblem -> String
- problems :: IndependentGoals -> SolverPlanIndex -> [SolverPlanProblem]
- dependencyClosure :: SolverInstallPlan -> [SolverId] -> [SolverPlanPackage]
- reverseDependencyClosure :: SolverInstallPlan -> [SolverId] -> [SolverPlanPackage]
- topologicalOrder :: SolverInstallPlan -> [SolverPlanPackage]
- reverseTopologicalOrder :: SolverInstallPlan -> [SolverPlanPackage]
Documentation
data SolverInstallPlan Source #
SolverInstallPlan | |
|
Instances
Structured SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan structure :: Proxy SolverInstallPlan -> Structure # structureHash' :: Tagged SolverInstallPlan MD5 | |
Generic SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan type Rep SolverInstallPlan :: Type -> Type # from :: SolverInstallPlan -> Rep SolverInstallPlan x # to :: Rep SolverInstallPlan x -> SolverInstallPlan # | |
Binary SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan put :: SolverInstallPlan -> Put # get :: Get SolverInstallPlan # putList :: [SolverInstallPlan] -> Put # | |
type Rep SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan |
data ResolverPackage loc #
The dependency resolver picks either pre-existing installed packages or it picks source packages along with package configuration.
This is like the PlanPackage
but with fewer cases.
Instances
Operations on SolverInstallPlan
s
new :: IndependentGoals -> SolverPlanIndex -> Either [SolverPlanProblem] SolverInstallPlan Source #
Build an installation plan from a valid set of resolved packages.
toList :: SolverInstallPlan -> [SolverPlanPackage] Source #
remove :: (SolverPlanPackage -> Bool) -> SolverInstallPlan -> Either [SolverPlanProblem] SolverInstallPlan Source #
Remove packages from the install plan. This will result in an error if there are remaining packages that depend on any matching package. This is primarily useful for obtaining an install plan for the dependencies of a package or set of packages without actually installing the package itself, as when doing development.
showPlanIndex :: [SolverPlanPackage] -> String Source #
Checking validity of plans
valid :: IndependentGoals -> SolverPlanIndex -> Bool Source #
A valid installation plan is a set of packages that is acyclic
,
closed
and consistent
. Also, every ConfiguredPackage
in the
plan has to have a valid configuration (see configuredPackageValid
).
- if the result is
False
useproblems
to get a detailed list.
closed :: SolverPlanIndex -> Bool Source #
An installation plan is closed if for every package in the set, all of its dependencies are also in the set. That is, the set is closed under the dependency relation.
- if the result is
False
usebrokenPackages
to find out which packages depend on packages not in the index.
consistent :: SolverPlanIndex -> Bool Source #
An installation plan is consistent if all dependencies that target a single package name, target the same version.
This is slightly subtle. It is not the same as requiring that there be at most one version of any package in the set. It only requires that of packages which have more than one other package depending on them. We could actually make the condition even more precise and say that different versions are OK so long as they are not both in the transitive closure of any other package (or equivalently that their inverse closures do not intersect). The point is we do not want to have any packages depending directly or indirectly on two different versions of the same package. The current definition is just a safe approximation of that.
- if the result is
False
usedependencyInconsistencies
to find out which packages are.
acyclic :: SolverPlanIndex -> Bool Source #
The graph of packages (nodes) and dependencies (edges) must be acyclic.
- if the result is
False
usedependencyCycles
to find out which packages are involved in dependency cycles.
Details on invalid plans
data SolverPlanProblem Source #
problems :: IndependentGoals -> SolverPlanIndex -> [SolverPlanProblem] Source #
For an invalid plan, produce a detailed list of problems as human readable
error messages. This is mainly intended for debugging purposes.
Use showPlanProblem
for a human readable explanation.
Querying the install plan
dependencyClosure :: SolverInstallPlan -> [SolverId] -> [SolverPlanPackage] Source #
Compute the dependency closure of a package in a install plan