HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulecabal-install-3.18.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.

Contents
  1. Operations on SolverInstallPlans
  2. Checking validity of plans
  3. Details on invalid plans
  4. Querying the install plan
Synopsis
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

Checking validity of plans

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