Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types used while planning how to build everything in a project.
Primarily this is the ElaboratedInstallPlan
.
Synopsis
- data SolverInstallPlan
- type ElaboratedInstallPlan = GenericInstallPlan InstalledPackageInfo ElaboratedConfiguredPackage
- normaliseConfiguredPackage :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> ElaboratedConfiguredPackage
- data ElaboratedConfiguredPackage = ElaboratedConfiguredPackage {
- elabUnitId :: UnitId
- elabComponentId :: ComponentId
- elabInstantiatedWith :: Map ModuleName Module
- elabLinkedInstantiatedWith :: Map ModuleName OpenModule
- elabIsCanonical :: Bool
- elabPkgSourceId :: PackageId
- elabModuleShape :: ModuleShape
- elabFlagAssignment :: FlagAssignment
- elabFlagDefaults :: FlagAssignment
- elabPkgDescription :: PackageDescription
- elabPkgSourceLocation :: PackageLocation (Maybe FilePath)
- elabPkgSourceHash :: Maybe PackageSourceHash
- elabLocalToProject :: Bool
- elabBuildStyle :: BuildStyle
- elabEnabledSpec :: ComponentRequestedSpec
- elabStanzasAvailable :: OptionalStanzaSet
- elabStanzasRequested :: OptionalStanzaMap (Maybe Bool)
- elabPackageDbs :: [Maybe PackageDB]
- elabSetupPackageDBStack :: PackageDBStack
- elabBuildPackageDBStack :: PackageDBStack
- elabRegisterPackageDBStack :: PackageDBStack
- elabInplaceSetupPackageDBStack :: PackageDBStack
- elabInplaceBuildPackageDBStack :: PackageDBStack
- elabInplaceRegisterPackageDBStack :: PackageDBStack
- elabPkgDescriptionOverride :: Maybe CabalFileText
- elabVanillaLib :: Bool
- elabSharedLib :: Bool
- elabStaticLib :: Bool
- elabDynExe :: Bool
- elabFullyStaticExe :: Bool
- elabGHCiLib :: Bool
- elabProfLib :: Bool
- elabProfExe :: Bool
- elabProfLibDetail :: ProfDetailLevel
- elabProfExeDetail :: ProfDetailLevel
- elabCoverage :: Bool
- elabOptimization :: OptimisationLevel
- elabSplitObjs :: Bool
- elabSplitSections :: Bool
- elabStripLibs :: Bool
- elabStripExes :: Bool
- elabDebugInfo :: DebugInfoLevel
- elabDumpBuildInfo :: DumpBuildInfo
- elabProgramPaths :: Map String FilePath
- elabProgramArgs :: Map String [String]
- elabProgramPathExtra :: [FilePath]
- elabConfigureScriptArgs :: [String]
- elabExtraLibDirs :: [FilePath]
- elabExtraLibDirsStatic :: [FilePath]
- elabExtraFrameworkDirs :: [FilePath]
- elabExtraIncludeDirs :: [FilePath]
- elabProgPrefix :: Maybe PathTemplate
- elabProgSuffix :: Maybe PathTemplate
- elabInstallDirs :: InstallDirs FilePath
- elabHaddockHoogle :: Bool
- elabHaddockHtml :: Bool
- elabHaddockHtmlLocation :: Maybe String
- elabHaddockForeignLibs :: Bool
- elabHaddockForHackage :: HaddockTarget
- elabHaddockExecutables :: Bool
- elabHaddockTestSuites :: Bool
- elabHaddockBenchmarks :: Bool
- elabHaddockInternal :: Bool
- elabHaddockCss :: Maybe FilePath
- elabHaddockLinkedSource :: Bool
- elabHaddockQuickJump :: Bool
- elabHaddockHscolourCss :: Maybe FilePath
- elabHaddockContents :: Maybe PathTemplate
- elabHaddockIndex :: Maybe PathTemplate
- elabHaddockBaseUrl :: Maybe String
- elabHaddockLib :: Maybe String
- elabTestMachineLog :: Maybe PathTemplate
- elabTestHumanLog :: Maybe PathTemplate
- elabTestShowDetails :: Maybe TestShowDetails
- elabTestKeepTix :: Bool
- elabTestWrapper :: Maybe FilePath
- elabTestFailWhenNoTestSuites :: Bool
- elabTestTestOptions :: [PathTemplate]
- elabBenchmarkOptions :: [PathTemplate]
- elabSetupScriptStyle :: SetupScriptStyle
- elabSetupScriptCliVersion :: Version
- elabConfigureTargets :: [ComponentTarget]
- elabBuildTargets :: [ComponentTarget]
- elabTestTargets :: [ComponentTarget]
- elabBenchTargets :: [ComponentTarget]
- elabReplTarget :: Maybe ComponentTarget
- elabHaddockTargets :: [ComponentTarget]
- elabBuildHaddocks :: Bool
- elabPkgOrComp :: ElaboratedPackageOrComponent
- elabDistDirParams :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> DistDirParams
- elabExeDependencyPaths :: ElaboratedConfiguredPackage -> [FilePath]
- elabLibDependencies :: ElaboratedConfiguredPackage -> [ConfiguredId]
- elabOrderLibDependencies :: ElaboratedConfiguredPackage -> [UnitId]
- elabExeDependencies :: ElaboratedConfiguredPackage -> [ComponentId]
- elabOrderExeDependencies :: ElaboratedConfiguredPackage -> [UnitId]
- elabSetupDependencies :: ElaboratedConfiguredPackage -> [ConfiguredId]
- elabPkgConfigDependencies :: ElaboratedConfiguredPackage -> [(PkgconfigName, Maybe PkgconfigVersion)]
- elabInplaceDependencyBuildCacheFiles :: DistDirLayout -> ElaboratedSharedConfig -> ElaboratedInstallPlan -> ElaboratedConfiguredPackage -> [FilePath]
- elabRequiresRegistration :: ElaboratedConfiguredPackage -> Bool
- dataDirsEnvironmentForPlan :: DistDirLayout -> ElaboratedInstallPlan -> [(String, Maybe FilePath)]
- elabPlanPackageName :: Verbosity -> ElaboratedPlanPackage -> String
- elabConfiguredName :: Verbosity -> ElaboratedConfiguredPackage -> String
- elabComponentName :: ElaboratedConfiguredPackage -> Maybe ComponentName
- data ElaboratedPackageOrComponent
- data ElaboratedComponent = ElaboratedComponent {
- compSolverName :: Component
- compComponentName :: Maybe ComponentName
- compLibDependencies :: [ConfiguredId]
- compLinkedLibDependencies :: [OpenUnitId]
- compExeDependencies :: [ConfiguredId]
- compPkgConfigDependencies :: [(PkgconfigName, Maybe PkgconfigVersion)]
- compExeDependencyPaths :: [(ConfiguredId, FilePath)]
- compOrderLibDependencies :: [UnitId]
- data ElaboratedPackage = ElaboratedPackage {
- pkgInstalledId :: InstalledPackageId
- pkgLibDependencies :: ComponentDeps [ConfiguredId]
- pkgDependsOnSelfLib :: ComponentDeps [()]
- pkgExeDependencies :: ComponentDeps [ConfiguredId]
- pkgExeDependencyPaths :: ComponentDeps [(ConfiguredId, FilePath)]
- pkgPkgConfigDependencies :: [(PkgconfigName, Maybe PkgconfigVersion)]
- pkgStanzasEnabled :: OptionalStanzaSet
- pkgOrderDependencies :: ElaboratedPackage -> ComponentDeps [UnitId]
- type ElaboratedPlanPackage = GenericPlanPackage InstalledPackageInfo ElaboratedConfiguredPackage
- data ElaboratedSharedConfig = ElaboratedSharedConfig {}
- type ElaboratedReadyPackage = GenericReadyPackage ElaboratedConfiguredPackage
- data BuildStyle
- type CabalFileText = ByteString
- data ComponentTarget = ComponentTarget ComponentName SubComponentTarget
- showComponentTarget :: PackageId -> ComponentTarget -> String
- showTestComponentTarget :: PackageId -> ComponentTarget -> Maybe String
- showBenchComponentTarget :: PackageId -> ComponentTarget -> Maybe String
- data SubComponentTarget
- isSubLibComponentTarget :: ComponentTarget -> Bool
- isForeignLibComponentTarget :: ComponentTarget -> Bool
- isExeComponentTarget :: ComponentTarget -> Bool
- isTestComponentTarget :: ComponentTarget -> Bool
- isBenchComponentTarget :: ComponentTarget -> Bool
- componentOptionalStanza :: Component -> Maybe OptionalStanza
- data SetupScriptStyle
Documentation
data SolverInstallPlan Source #
Instances
Structured SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan structure :: Proxy SolverInstallPlan -> Structure # structureHash' :: Tagged SolverInstallPlan MD5 | |
Generic SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan type Rep SolverInstallPlan :: Type -> Type # from :: SolverInstallPlan -> Rep SolverInstallPlan x # to :: Rep SolverInstallPlan x -> SolverInstallPlan # | |
Binary SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan put :: SolverInstallPlan -> Put # get :: Get SolverInstallPlan # putList :: [SolverInstallPlan] -> Put # | |
type Rep SolverInstallPlan Source # | |
Defined in Distribution.Client.SolverInstallPlan |
Elaborated install plan types
type ElaboratedInstallPlan = GenericInstallPlan InstalledPackageInfo ElaboratedConfiguredPackage Source #
The combination of an elaborated install plan plus a
ElaboratedSharedConfig
contains all the details necessary to be able
to execute the plan without having to make further policy decisions.
It does not include dynamic elements such as resources (such as http connections).
normaliseConfiguredPackage :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> ElaboratedConfiguredPackage Source #
data ElaboratedConfiguredPackage Source #
ElaboratedConfiguredPackage | |
|
Instances
elabDistDirParams :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> DistDirParams Source #
elabExeDependencyPaths :: ElaboratedConfiguredPackage -> [FilePath] Source #
This returns the paths of all the executables we depend on; we
must add these paths to PATH before invoking the setup script.
(This is usually what you want, not elabExeDependencies
, if you
actually want to build something.)
elabLibDependencies :: ElaboratedConfiguredPackage -> [ConfiguredId] Source #
The library dependencies (i.e., the libraries we depend on, NOT
the dependencies of the library), NOT including setup dependencies.
These are passed to the Setup
script via --dependency
.
elabOrderLibDependencies :: ElaboratedConfiguredPackage -> [UnitId] Source #
Like elabOrderDependencies
, but only returns dependencies on
libraries.
elabExeDependencies :: ElaboratedConfiguredPackage -> [ComponentId] Source #
The executable dependencies (i.e., the executables we depend on); these are the executables we must add to the PATH before we invoke the setup script.
elabOrderExeDependencies :: ElaboratedConfiguredPackage -> [UnitId] Source #
Like elabOrderDependencies
, but only returns dependencies on
executables. (This coincides with elabExeDependencies
.)
elabSetupDependencies :: ElaboratedConfiguredPackage -> [ConfiguredId] Source #
The setup dependencies (the library dependencies of the setup executable; note that it is not legal for setup scripts to have executable dependencies at the moment.)
elabPkgConfigDependencies :: ElaboratedConfiguredPackage -> [(PkgconfigName, Maybe PkgconfigVersion)] Source #
elabInplaceDependencyBuildCacheFiles :: DistDirLayout -> ElaboratedSharedConfig -> ElaboratedInstallPlan -> ElaboratedConfiguredPackage -> [FilePath] Source #
The cache files of all our inplace dependencies which, when updated, require us to rebuild. See #4202 for more details. Essentially, this is a list of filepaths that, if our dependencies get rebuilt, will themselves get updated.
Note: the hash of these cache files gets built into the build cache ourselves, which means that we end up tracking transitive dependencies!
Note: This tracks the "build" cache file, but not "registration" or "config" cache files. Why not? Arguably we should...
Note: This is a bit of a hack, because it is not really the hashes of the SOURCES of our (transitive) dependencies that we should use to decide whether or not to rebuild, but the output BUILD PRODUCTS. The strategy we use here will never work if we want to implement unchanging rebuilds.
elabRequiresRegistration :: ElaboratedConfiguredPackage -> Bool Source #
The packagecomponent containsis a library and so must be registered
dataDirsEnvironmentForPlan :: DistDirLayout -> ElaboratedInstallPlan -> [(String, Maybe FilePath)] Source #
Construct the environment needed for the data files to work.
This consists of a separate *_datadir
variable for each
inplace package in the plan.
elabPlanPackageName :: Verbosity -> ElaboratedPlanPackage -> String Source #
User-friendly display string for an ElaboratedPlanPackage
.
elabConfiguredName :: Verbosity -> ElaboratedConfiguredPackage -> String Source #
A user-friendly descriptor for an ElaboratedConfiguredPackage
.
data ElaboratedPackageOrComponent Source #
Instances
data ElaboratedComponent Source #
Some extra metadata associated with an
ElaboratedConfiguredPackage
which indicates that the "package"
in question is actually a single component to be built. Arguably
it would be clearer if there were an ADT which branched into
package work items and component work items, but I've structured
it this way to minimize change to the existing code (which I
don't feel qualified to rewrite.)
ElaboratedComponent | |
|
Instances
data ElaboratedPackage Source #
ElaboratedPackage | |
|
Instances
pkgOrderDependencies :: ElaboratedPackage -> ComponentDeps [UnitId] Source #
See elabOrderDependencies
. This gives the unflattened version,
which can be useful in some circumstances.
type ElaboratedPlanPackage = GenericPlanPackage InstalledPackageInfo ElaboratedConfiguredPackage Source #
data ElaboratedSharedConfig Source #
ElaboratedSharedConfig | |
|
Instances
data BuildStyle Source #
This is used in the install plan to indicate how the package will be built.
BuildAndInstall | The classic approach where the package is built, then the files installed into some location and the result registered in a package db. If the package came from a tarball then it's built in a temp dir and the results discarded. |
BuildInplaceOnly | The package is built, but the files are not installed anywhere, rather the build dir is kept and the package is registered inplace. Such packages can still subsequently be installed. Typically |
Instances
type CabalFileText = ByteString Source #
Build targets
data ComponentTarget Source #
Specific targets within a package or component to act on e.g. to build, haddock or open a repl.
Instances
showComponentTarget :: PackageId -> ComponentTarget -> String Source #
Unambiguously render a ComponentTarget
, e.g., to pass
to a Cabal Setup script.
data SubComponentTarget Source #
Either the component as a whole or detail about a file or module target within a component.
WholeComponent | The component as a whole |
ModuleTarget ModuleName | A specific module within a component. |
FileTarget FilePath | A specific file within a component. Note that this does not carry the file extension. |
Instances
Setup script
data SetupScriptStyle Source #
There are four major cases for Setup.hs handling:
build-type
Custom with acustom-setup
sectionbuild-type
Custom without acustom-setup
sectionbuild-type
not Custom withcabal-version > $our-cabal-version
build-type
not 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. In case 3 we also have to build an external Setup.hs script because the package needs a later Cabal lib version than we can support internally.