The set of parameters to the dependency resolver. These parameters are relatively low level but many kinds of high level policies can be implemented in terms of adjustments to the parameters.
Modulecabal-install-3.12.1.0Haskell2010
Distribution.Client.Dependency
Top level interface to dependency resolution.
- 7 types
- 31 values
- Packagecabal-install-3.12.1.0
- Exports38
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDependency.hs
The main package dependency resolver
4 declarationsRun the dependency solver.
Since this is potentially an expensive operation, the result is wrapped in a a Progress structure that can be unfolded to provide progress information, logging messages and the final result or an error.
A type to represent the unfolding of an expensive long running calculation that may fail. We may get intermediate steps before the final result which may be used to indicate progress and/or logging messages.
Instances4Monad, Functor, Applicative, Alternative
Monad (Progress step fail)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.ProgressFunctor (Progress step fail)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.ProgressApplicative (Progress step fail)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.ProgressMonoid fail => Alternative (Progress step fail)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.Progress
Alternate, simple resolver that does not do dependencies recursively
1 declarationA simplistic method of resolving a list of target package names to available packages.
Specifically, it does not consider package dependencies at all. Unlike resolveDependencies, no attempt is made to ensure that the selected packages have dependencies that are satisfiable or consistent with each other.
It is suitable for tasks such as selecting packages to download for user inspection. It is not suitable for selecting packages to install.
Note: if no installed package index is available, it is OK to pass mempty. It simply means preferences for installed packages will be ignored.
Constructing resolver policies
5 declarationsA package property is a logical predicate on packages.
Instances6Eq, Show, Generic, Binary, Structured, Rep
Eq PackagePropertyDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraintShow PackagePropertyDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraintGeneric PackagePropertyDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraintBinary PackagePropertyDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraintStructured PackagePropertyDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstrainttype Rep PackageProperty = D1 ('MetaDataDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraint"PackageProperty"
"Distribution.Solver.Types.PackageConstraint"
"cabal-install-solver-3.12.1.0-582X8xReBAn365xYF5myIO"
'False) ((C1 ('MetaCons"PackagePropertyVersion"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)) :+: C1 ('MetaCons"PackagePropertyInstalled"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"PackagePropertySource"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"PackagePropertyFlags"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FlagAssignment)) :+: C1 ('MetaCons"PackagePropertyStanzas"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [OptionalStanza])))))
A package constraint consists of a scope plus a property that must hold for all packages within that scope.
Constructors
Instances2Eq, Show
Eq PackageConstraintDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraintShow PackageConstraintDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Types.PackageConstraint
Constructor for a common use case: the constraint applies to the package with the specified name when that package is a top-level dependency in the default namespace.
Global policy for all packages to say if we prefer package versions that are already installed locally or if we just prefer the latest available.
Constructors
PreferAllLatestAlways prefer the latest version irrespective of any existing installed version.
This is the standard policy for upgrade.
PreferAllOldestAlways prefer the oldest version irrespective of any existing installed version or packages explicitly requested.
This is enabled by --prefer-oldest.
PreferAllInstalledAlways prefer the installed versions over ones that would need to be installed. Secondarily, prefer latest versions (eg the latest installed version or if there are none then the latest source version).
PreferLatestForSelectedPrefer the latest version for packages that are explicitly requested but prefers the installed version for any other packages.
This is the standard policy for install.
Instances1Show
Show PackagesPreferenceDefaultDefined in cabal-install-3.12.1.0 · Distribution.Client.Dependency.Types
A package selection preference for a particular package.
Preferences are soft constraints that the dependency resolver should try to respect where possible. It is not specified if preferences on some packages are more important than others.
Constructors
PackageVersionPreference PackageName VersionRangeA suggested constraint on the version number.
PackageInstalledPreference PackageName InstalledPreferenceIf we prefer versions of packages that are already installed.
PackageStanzasPreference PackageName [OptionalStanza]If we would prefer to enable these optional stanzas (i.e. test suites and/or benchmarks)
Standard policy
A basic solver policy on which all others are built.
The policy used by all the standard commands, install, fetch, freeze etc (but not the v2-build and related commands).
It extends the basicInstallPolicy with a policy on setup deps.
A fully or partially resolved reference to a package.
Constructors
NamedPackage PackageName [PackageProperty]A partially specified reference to a package (either source or installed). It is specified by package name and optionally some required properties. Use a dependency resolver to pick a specific package satisfying these properties.
SpecificSourcePackage pkgA fully specified source package.
Instances7Functor, Eq, Show, Generic, Binary, Structured, …
Functor PackageSpecifierDefined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifierEq pkg => Eq (PackageSpecifier pkg)Defined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifierShow pkg => Show (PackageSpecifier pkg)Defined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifierGeneric (PackageSpecifier pkg)Defined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifierBinary pkg => Binary (PackageSpecifier pkg)Defined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifierStructured pkg => Structured (PackageSpecifier pkg)Defined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifiertype Rep (PackageSpecifier pkg) = D1 ('MetaDataDefined in cabal-install-3.12.1.0 · Distribution.Client.Types.PackageSpecifier"PackageSpecifier"
"Distribution.Client.Types.PackageSpecifier"
"cabal-install-3.12.1.0-1D90DH9PPem9Tqn79I9vRN"
'False) (C1 ('MetaCons"NamedPackage"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PackageProperty])) :+: C1 ('MetaCons"SpecificSourcePackage"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 pkg)))
Extra policy options
Policy utils
Dual of removeUpperBounds
Remove upper bounds in dependencies using the policy specified by the AllowNewer argument (allsomenone).
Note: It's important to apply removeUpperBounds after
addSourcePackages. Otherwise, the packages inserted by
addSourcePackages won't have upper bounds in dependencies relaxed.
Supply defaults for packages without explicit Setup dependencies
Note: It's important to apply addDefaultSetupDepends after
addSourcePackages. Otherwise, the packages inserted by
addSourcePackages won't have upper bounds in dependencies relaxed.
If a package has a custom setup then we need to add a setup-depends on Cabal.
Variant of addSetupCabalMinVersionConstraint which sets an
upper bound on setup.Cabal labeled with ConstraintSetupCabalMaxVersion.