HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecabal-install-3.12.1.0Haskell2010

Distribution.Client.SolverInstallPlan

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.

  • 4 types
  • 16 values
datadata SolverInstallPlan
#
Instances4Generic, Binary, Structured, Rep
datadata ResolverPackage loc
#

The dependency resolver picks either pre-existing installed packages or it picks source packages along with package configuration.

This is like the InstallPlan.PlanPackage but with fewer cases.

Instances9Eq, Show, Generic, Binary, Structured, IsNode, …

Operations on SolverInstallPlans

6 declarations

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

4 declarations
valuevalid :: IndependentGoals -> SolverPlanIndex -> Bool
#

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.

valueclosed :: SolverPlanIndex -> Bool
#

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 PackageIndex.brokenPackages to find out which packages depend on packages not in the index.

valueconsistent :: SolverPlanIndex -> Bool
#

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 use PackageIndex.dependencyInconsistencies to find out which packages are.

valueacyclic :: SolverPlanIndex -> Bool
#

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

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

Details on invalid plans

Querying the install plan