| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Client.ProjectPlanning.SetupPolicy
Description
Setup.hs script policy
Handling for Setup.hs scripts is a bit tricky, part of it lives in the solver phase, and part in the elaboration phase. We keep the helper functions for both phases together here so at least you can see all of it in one place.
There are four major cases for Setup.hs handling:
build-typeCustom with acustom-setupsectionbuild-typeCustom without acustom-setupsectionbuild-typenot Custom withcabal-version > $our-cabal-versionbuild-typenot Custom withcabal-version <= $our-cabal-version
It's also worth noting that packages specifying cabal-version: >= 1.23
or later that have build-type Custom will always have a custom-setup
section. Therefore in case 2, the specified cabal-version will always be
less than 1.23.
In cases 1 and 2 we obviously have to build an external Setup.hs script, while in case 4 we can use the internal library API.
Since: 3.12.0.0
Synopsis
- mkDefaultSetupDeps :: Compiler -> Platform -> PackageDescription -> Maybe [Dependency]
- packageSetupScriptStyle :: PackageDescription -> SetupScriptStyle
- packageSetupScriptSpecVersion :: SetupScriptStyle -> PackageDescription -> Graph NonSetupLibDepSolverPlanPackage -> ComponentDeps [SolverId] -> Version
- newtype NonSetupLibDepSolverPlanPackage = NonSetupLibDepSolverPlanPackage {}
Documentation
mkDefaultSetupDeps :: Compiler -> Platform -> PackageDescription -> Maybe [Dependency] #
Part of our Setup.hs handling policy is implemented by getting the solver
to work out setup dependencies for packages. The solver already handles
packages that explicitly specify setup dependencies, but we can also tell
the solver to treat other packages as if they had setup dependencies.
That's what this function does, it gets called by planPackages for all
packages that don't already have setup dependencies.
The dependencies we want to add is different for each SetupScriptStyle.
Note in addition to adding setup dependencies, we also use
addSetupCabalMinVersionConstraint (in planPackages) to require
Cabal >= 1.20 for Setup scripts.
Since: 3.12.0.0
packageSetupScriptStyle :: PackageDescription -> SetupScriptStyle #
Work out the SetupScriptStyle given the package description.
Since: 3.12.0.0
packageSetupScriptSpecVersion :: SetupScriptStyle -> PackageDescription -> Graph NonSetupLibDepSolverPlanPackage -> ComponentDeps [SolverId] -> Version #
Work out which version of the Cabal we will be using to talk to the Setup.hs interface for this package.
This depends somewhat on the SetupScriptStyle but most cases are a result
of what the solver picked for us, based on the explicit setup deps or the
ones added implicitly by mkDefaultSetupDeps.
Since: 3.12.0.0
newtype NonSetupLibDepSolverPlanPackage #
A newtype for SolverPlanPackage for which the
dependency graph considers only dependencies on libraries which are
NOT from setup dependencies. Used to compute the set
of packages needed for profiling and dynamic libraries.
Since: 3.12.0.0
Constructors
| NonSetupLibDepSolverPlanPackage | |
Instances
| IsNode NonSetupLibDepSolverPlanPackage # | |||||
Defined in Distribution.Client.ProjectPlanning.SetupPolicy Associated Types
| |||||
| Package NonSetupLibDepSolverPlanPackage # | |||||
Defined in Distribution.Client.ProjectPlanning.SetupPolicy Methods packageId :: NonSetupLibDepSolverPlanPackage -> PackageIdentifier # | |||||
| type Key NonSetupLibDepSolverPlanPackage # | |||||