cabal-install-3.8.1.0: The command-line interface for Cabal and Hackage.
Copyright(c) Duncan Coutts 2008
LicenseBSD-like
Maintainerduncan@community.haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.Client.SolverInstallPlan

Description

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

Documentation

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

Instances details
Eq loc => Eq (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Show loc => Show (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Generic (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Associated Types

type Rep (ResolverPackage loc) :: Type -> Type #

Methods

from :: ResolverPackage loc -> Rep (ResolverPackage loc) x #

to :: Rep (ResolverPackage loc) x -> ResolverPackage loc #

Package (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Binary loc => Binary (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Methods

put :: ResolverPackage loc -> Put #

get :: Get (ResolverPackage loc) #

putList :: [ResolverPackage loc] -> Put #

Structured loc => Structured (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

IsNode (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Associated Types

type Key (ResolverPackage loc) #

type Rep (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

type Rep (ResolverPackage loc) = D1 ('MetaData "ResolverPackage" "Distribution.Solver.Types.ResolverPackage" "cabal-install-solver-3.8.1.0-DQHDRT4McfjEkCZkJP5jZc" 'False) (C1 ('MetaCons "PreExisting" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InstSolverPackage)) :+: C1 ('MetaCons "Configured" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SolverPackage loc))))
type Key (ResolverPackage loc) 
Instance details

Defined in Distribution.Solver.Types.ResolverPackage

Operations on SolverInstallPlans

new :: IndependentGoals -> SolverPlanIndex -> Either [SolverPlanProblem] SolverInstallPlan Source #

Build an installation plan from a valid set of resolved packages.

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.

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 use problems 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 use brokenPackages 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.

acyclic :: SolverPlanIndex -> Bool Source #

The graph of packages (nodes) and dependencies (edges) must be acyclic.

  • if the result is False use dependencyCycles to find out which packages are involved in dependency cycles.

Details on invalid plans

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