Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module defines the interface for the Hooks
build-type
.
To write a package that implements build-type: Hooks
, you should define
a module SetupHooks.hs
which exports a value setupHooks ::
.
This is a record that declares actions that should be hooked into the
cabal build process.SetupHooks
See SetupHooks
for more details.
Synopsis
- data SetupHooks = SetupHooks {}
- noSetupHooks :: SetupHooks
- data ConfigureHooks = ConfigureHooks {}
- noConfigureHooks :: ConfigureHooks
- data PreConfPackageInputs = PreConfPackageInputs {}
- data PreConfPackageOutputs = PreConfPackageOutputs {}
- noPreConfPackageOutputs :: PreConfPackageInputs -> PreConfPackageOutputs
- type PreConfPackageHook = PreConfPackageInputs -> IO PreConfPackageOutputs
- data PostConfPackageInputs = PostConfPackageInputs {}
- type PostConfPackageHook = PostConfPackageInputs -> IO ()
- data PreConfComponentInputs = PreConfComponentInputs {}
- data PreConfComponentOutputs = PreConfComponentOutputs {}
- noPreConfComponentOutputs :: PreConfComponentInputs -> PreConfComponentOutputs
- type PreConfComponentHook = PreConfComponentInputs -> IO PreConfComponentOutputs
- newtype ComponentDiff = ComponentDiff {}
- emptyComponentDiff :: ComponentName -> ComponentDiff
- buildInfoComponentDiff :: ComponentName -> BuildInfo -> ComponentDiff
- type LibraryDiff = Library
- type ForeignLibDiff = ForeignLib
- type ExecutableDiff = Executable
- type TestSuiteDiff = TestSuite
- type BenchmarkDiff = Benchmark
- type BuildInfoDiff = BuildInfo
- data BuildHooks = BuildHooks {}
- noBuildHooks :: BuildHooks
- data BuildingWhat
- buildingWhatVerbosity :: BuildingWhat -> Verbosity
- buildingWhatDistPref :: BuildingWhat -> SymbolicPath Pkg ('Dir Dist)
- data PreBuildComponentInputs = PreBuildComponentInputs {}
- type PreBuildComponentRules = Rules PreBuildComponentInputs
- data PostBuildComponentInputs = PostBuildComponentInputs {}
- type PostBuildComponentHook = PostBuildComponentInputs -> IO ()
- data Rules env
- rules :: StaticPtr label -> (env -> RulesM ()) -> Rules env
- noRules :: RulesM ()
- type Rule = RuleData 'User
- data Dependency
- data RuleOutput = RuleOutput {
- outputOfRule :: !RuleId
- outputIndex :: !Word
- data RuleId
- staticRule :: Typeable arg => Command arg (IO ()) -> [Dependency] -> NonEmpty Location -> Rule
- dynamicRule :: (Typeable depsArg, Typeable depsRes, Typeable arg) => StaticPtr (Dict (Binary depsRes, Show depsRes, Eq depsRes)) -> Command depsArg (IO ([Dependency], depsRes)) -> Command arg (depsRes -> IO ()) -> [Dependency] -> NonEmpty Location -> Rule
- data Location where
- location :: Location -> SymbolicPath Pkg 'File
- autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> SymbolicPath Pkg ('Dir Source)
- componentBuildDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> SymbolicPath Pkg ('Dir Build)
- data RuleCommands (scope :: Scope) (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) where
- StaticRuleCommand :: forall arg (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) (scope :: Scope). If (scope == 'System) (arg ~ ByteString) () => {..} -> RuleCommands scope deps ruleCmd
- DynamicRuleCommands :: forall depsArg depsRes arg (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) (scope :: Scope). If (scope == 'System) (depsArg ~ ByteString, depsRes ~ ByteString, arg ~ ByteString) () => {..} -> RuleCommands scope deps ruleCmd
- type Command = CommandData 'User
- mkCommand :: StaticPtr (Dict (Binary arg, Show arg)) -> StaticPtr (arg -> res) -> arg -> Command arg res
- data Dict c where
- type RulesM a = RulesT IO a
- registerRule :: ShortText -> Rule -> RulesM RuleId
- registerRule_ :: ShortText -> Rule -> RulesT IO ()
- addRuleMonitors :: Monad m => [MonitorFilePath] -> RulesT m ()
- module Distribution.Simple.FileMonitor.Types
- data InstallHooks = InstallHooks {}
- noInstallHooks :: InstallHooks
- data InstallComponentInputs = InstallComponentInputs {}
- type InstallComponentHook = InstallComponentInputs -> IO ()
- data ConfigFlags where
- ConfigFlags {
- configCommonFlags :: !CommonSetupFlags
- configPrograms_ :: Option' (Last' ProgramDb)
- configProgramPaths :: [(String, FilePath)]
- configProgramArgs :: [(String, [String])]
- configProgramPathExtra :: NubList FilePath
- configHcFlavor :: Flag CompilerFlavor
- configHcPath :: Flag FilePath
- configHcPkg :: Flag FilePath
- configVanillaLib :: Flag Bool
- configProfLib :: Flag Bool
- configSharedLib :: Flag Bool
- configStaticLib :: Flag Bool
- configDynExe :: Flag Bool
- configFullyStaticExe :: Flag Bool
- configProfExe :: Flag Bool
- configProf :: Flag Bool
- configProfShared :: Flag Bool
- configProfDetail :: Flag ProfDetailLevel
- configProfLibDetail :: Flag ProfDetailLevel
- configConfigureArgs :: [String]
- configOptimization :: Flag OptimisationLevel
- configProgPrefix :: Flag PathTemplate
- configProgSuffix :: Flag PathTemplate
- configInstallDirs :: InstallDirs (Flag PathTemplate)
- configScratchDir :: Flag FilePath
- configExtraLibDirs :: [SymbolicPath Pkg ('Dir Lib)]
- configExtraLibDirsStatic :: [SymbolicPath Pkg ('Dir Lib)]
- configExtraFrameworkDirs :: [SymbolicPath Pkg ('Dir Framework)]
- configExtraIncludeDirs :: [SymbolicPath Pkg ('Dir Include)]
- configIPID :: Flag String
- configCID :: Flag ComponentId
- configDeterministic :: Flag Bool
- configUserInstall :: Flag Bool
- configPackageDBs :: [Maybe PackageDB]
- configGHCiLib :: Flag Bool
- configSplitSections :: Flag Bool
- configSplitObjs :: Flag Bool
- configStripExes :: Flag Bool
- configStripLibs :: Flag Bool
- configConstraints :: [PackageVersionConstraint]
- configDependencies :: [GivenComponent]
- configPromisedDependencies :: [PromisedComponent]
- configInstantiateWith :: [(ModuleName, Module)]
- configConfigurationsFlags :: FlagAssignment
- configTests :: Flag Bool
- configBenchmarks :: Flag Bool
- configCoverage :: Flag Bool
- configLibCoverage :: Flag Bool
- configExactConfiguration :: Flag Bool
- configFlagError :: Flag String
- configRelocatable :: Flag Bool
- configDebugInfo :: Flag DebugInfoLevel
- configDumpBuildInfo :: Flag DumpBuildInfo
- configUseResponseFiles :: Flag Bool
- configAllowDependingOnPrivateLibs :: Flag Bool
- configCoverageFor :: Flag [UnitId]
- configIgnoreBuildTools :: Flag Bool
- pattern ConfigCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> ConfigFlags
- ConfigFlags {
- data BuildFlags where
- BuildFlags {
- buildCommonFlags :: !CommonSetupFlags
- buildProgramPaths :: [(String, FilePath)]
- buildProgramArgs :: [(String, [String])]
- buildNumJobs :: Flag (Maybe Int)
- buildUseSemaphore :: Flag String
- pattern BuildCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> BuildFlags
- BuildFlags {
- data ReplFlags where
- ReplFlags {
- replCommonFlags :: !CommonSetupFlags
- replProgramPaths :: [(String, FilePath)]
- replProgramArgs :: [(String, [String])]
- replReload :: Flag Bool
- replReplOptions :: ReplOptions
- pattern ReplCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> ReplFlags
- ReplFlags {
- data HaddockFlags where
- HaddockFlags {
- haddockCommonFlags :: !CommonSetupFlags
- haddockProgramPaths :: [(String, FilePath)]
- haddockProgramArgs :: [(String, [String])]
- haddockHoogle :: Flag Bool
- haddockHtml :: Flag Bool
- haddockHtmlLocation :: Flag String
- haddockForHackage :: Flag HaddockTarget
- haddockExecutables :: Flag Bool
- haddockTestSuites :: Flag Bool
- haddockBenchmarks :: Flag Bool
- haddockForeignLibs :: Flag Bool
- haddockInternal :: Flag Bool
- haddockCss :: Flag FilePath
- haddockLinkedSource :: Flag Bool
- haddockQuickJump :: Flag Bool
- haddockHscolourCss :: Flag FilePath
- haddockContents :: Flag PathTemplate
- haddockIndex :: Flag PathTemplate
- haddockKeepTempFiles :: Flag Bool
- haddockBaseUrl :: Flag String
- haddockResourcesDir :: Flag String
- haddockOutputDir :: Flag FilePath
- haddockUseUnicode :: Flag Bool
- pattern HaddockCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> HaddockFlags
- HaddockFlags {
- data HscolourFlags where
- HscolourFlags { }
- pattern HscolourCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> HscolourFlags
- data CopyFlags where
- CopyFlags { }
- pattern CopyCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> CopyFlags
- installFileGlob :: Verbosity -> CabalSpecVersion -> Maybe (SymbolicPath CWD ('Dir Pkg)) -> (Maybe (SymbolicPath CWD ('Dir DataDir)), SymbolicPath Pkg ('Dir DataDir)) -> RelativePath DataDir 'File -> IO ()
- data Program = Program {
- programName :: String
- programFindLocation :: Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))
- programFindVersion :: Verbosity -> FilePath -> IO (Maybe Version)
- programPostConf :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
- programNormaliseArgs :: Maybe Version -> PackageDescription -> [String] -> [String]
- data ConfiguredProgram = ConfiguredProgram {}
- type ProgArg = String
- data ProgramLocation
- = UserSpecified { }
- | FoundOnSystem { }
- data ProgramDb
- addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
- configureUnconfiguredProgram :: Verbosity -> Program -> ProgramDb -> IO (Maybe ConfiguredProgram)
- simpleProgram :: String -> Program
- data Verbosity
- data Compiler = Compiler {}
- data Platform = Platform Arch OS
- newtype Suffix = Suffix String
- data LocalBuildConfig
- data LocalBuildInfo
- data PackageBuildDescr
- data PackageDescription = PackageDescription {
- specVersion :: CabalSpecVersion
- package :: PackageIdentifier
- licenseRaw :: Either License License
- licenseFiles :: [RelativePath Pkg 'File]
- copyright :: !ShortText
- maintainer :: !ShortText
- author :: !ShortText
- stability :: !ShortText
- testedWith :: [(CompilerFlavor, VersionRange)]
- homepage :: !ShortText
- pkgUrl :: !ShortText
- bugReports :: !ShortText
- sourceRepos :: [SourceRepo]
- synopsis :: !ShortText
- description :: !ShortText
- category :: !ShortText
- customFieldsPD :: [(String, String)]
- buildTypeRaw :: Maybe BuildType
- setupBuildInfo :: Maybe SetupBuildInfo
- library :: Maybe Library
- subLibraries :: [Library]
- executables :: [Executable]
- foreignLibs :: [ForeignLib]
- testSuites :: [TestSuite]
- benchmarks :: [Benchmark]
- dataFiles :: [RelativePath DataDir 'File]
- dataDir :: SymbolicPath Pkg ('Dir DataDir)
- extraSrcFiles :: [RelativePath Pkg 'File]
- extraTmpFiles :: [RelativePath Pkg 'File]
- extraDocFiles :: [RelativePath Pkg 'File]
- extraFiles :: [RelativePath Pkg 'File]
- data Component
- data ComponentName where
- CLibName LibraryName
- CNotLibName NotLibComponentName
- pattern CBenchName :: UnqualComponentName -> ComponentName
- pattern CTestName :: UnqualComponentName -> ComponentName
- pattern CExeName :: UnqualComponentName -> ComponentName
- pattern CFLibName :: UnqualComponentName -> ComponentName
- componentName :: Component -> ComponentName
- data BuildInfo = BuildInfo {
- buildable :: Bool
- buildTools :: [LegacyExeDependency]
- buildToolDepends :: [ExeDependency]
- cppOptions :: [String]
- asmOptions :: [String]
- cmmOptions :: [String]
- ccOptions :: [String]
- cxxOptions :: [String]
- ldOptions :: [String]
- hsc2hsOptions :: [String]
- pkgconfigDepends :: [PkgconfigDependency]
- frameworks :: [RelativePath Framework 'File]
- extraFrameworkDirs :: [SymbolicPath Pkg ('Dir Framework)]
- asmSources :: [SymbolicPath Pkg 'File]
- cmmSources :: [SymbolicPath Pkg 'File]
- cSources :: [SymbolicPath Pkg 'File]
- cxxSources :: [SymbolicPath Pkg 'File]
- jsSources :: [SymbolicPath Pkg 'File]
- hsSourceDirs :: [SymbolicPath Pkg ('Dir Source)]
- otherModules :: [ModuleName]
- virtualModules :: [ModuleName]
- autogenModules :: [ModuleName]
- defaultLanguage :: Maybe Language
- otherLanguages :: [Language]
- defaultExtensions :: [Extension]
- otherExtensions :: [Extension]
- oldExtensions :: [Extension]
- extraLibs :: [String]
- extraLibsStatic :: [String]
- extraGHCiLibs :: [String]
- extraBundledLibs :: [String]
- extraLibFlavours :: [String]
- extraDynLibFlavours :: [String]
- extraLibDirs :: [SymbolicPath Pkg ('Dir Lib)]
- extraLibDirsStatic :: [SymbolicPath Pkg ('Dir Lib)]
- includeDirs :: [SymbolicPath Pkg ('Dir Include)]
- includes :: [SymbolicPath Include 'File]
- autogenIncludes :: [RelativePath Include 'File]
- installIncludes :: [RelativePath Include 'File]
- options :: PerCompilerFlavor [String]
- profOptions :: PerCompilerFlavor [String]
- sharedOptions :: PerCompilerFlavor [String]
- profSharedOptions :: PerCompilerFlavor [String]
- staticOptions :: PerCompilerFlavor [String]
- customFieldsBI :: [(String, String)]
- targetBuildDepends :: [Dependency]
- mixins :: [Mixin]
- emptyBuildInfo :: BuildInfo
- data TargetInfo = TargetInfo {}
- data ComponentLocalBuildInfo
- = LibComponentLocalBuildInfo {
- componentLocalName :: ComponentName
- componentComponentId :: ComponentId
- componentUnitId :: UnitId
- componentIsIndefinite_ :: Bool
- componentInstantiatedWith :: [(ModuleName, OpenModule)]
- componentPackageDeps :: [(UnitId, MungedPackageId)]
- componentIncludes :: [(OpenUnitId, ModuleRenaming)]
- componentExeDeps :: [UnitId]
- componentInternalDeps :: [UnitId]
- componentCompatPackageKey :: String
- componentCompatPackageName :: MungedPackageName
- componentExposedModules :: [ExposedModule]
- componentIsPublic :: Bool
- | FLibComponentLocalBuildInfo { }
- | ExeComponentLocalBuildInfo { }
- | TestComponentLocalBuildInfo { }
- | BenchComponentLocalBuildInfo { }
- = LibComponentLocalBuildInfo {
- data Library = Library {}
- data ForeignLib = ForeignLib {}
- data Executable = Executable {}
- data TestSuite = TestSuite {}
- data Benchmark = Benchmark {}
- data LibraryName
- emptyLibrary :: Library
- emptyForeignLib :: ForeignLib
- emptyExecutable :: Executable
- emptyTestSuite :: TestSuite
- emptyBenchmark :: Benchmark
Hooks
A Cabal package with Hooks
build-type
must define the Haskell module
SetupHooks
which defines a value setupHooks ::
.SetupHooks
These *setup hooks* allow package authors to customise the configuration and
building of a package by providing certain hooks that get folded into the
general package configuration and building logic within Cabal
.
This mechanism replaces the Custom
build-type
, providing better
integration with the rest of the Haskell ecosystem.
Usage example:
-- In your .cabal file build-type: Hooks custom-setup setup-depends: base >= 4.18 && < 5, Cabal-hooks >= 3.14 && < 3.15 The declared Cabal version should also be at least 3.14.
-- In SetupHooks.hs, next to your .cabal file module SetupHooks where import Distribution.Simple.SetupHooks ( SetupHooks, noSetupHooks ) setupHooks :: SetupHooks setupHooks = noSetupHooks { configureHooks = myConfigureHooks , buildHooks = myBuildHooks }
Note that SetupHooks
can be monoidally combined, e.g.:
module SetupHooks where import Distribution.Simple.SetupHooks import qualified SomeOtherLibrary ( setupHooks ) setupHooks :: SetupHooks setupHooks = SomeOtherLibrary.setupHooks <> mySetupHooks mySetupHooks :: SetupHooks mySetupHooks = ...
data SetupHooks #
Hooks into the cabal
build phases.
Usage:
- In your
.cabal
file, declarebuild-type: Hooks
(with acabal-version
greater than or equal to3.14
), - In your
.cabal
file, include acustom-setup
stanza which declares the dependencies of yourSetupHooks
module; this will usually contain a dependency on theCabal-hooks
package. - Provide a
SetupHooks.hs
module next to your.cabal
file; it must exportsetupHooks :: SetupHooks
.
SetupHooks | |
|
Instances
Monoid SetupHooks | |
Defined in Distribution.Simple.SetupHooks.Internal mempty :: SetupHooks # mappend :: SetupHooks -> SetupHooks -> SetupHooks # mconcat :: [SetupHooks] -> SetupHooks # | |
Semigroup SetupHooks |
Warning: this |
Defined in Distribution.Simple.SetupHooks.Internal (<>) :: SetupHooks -> SetupHooks -> SetupHooks # sconcat :: NonEmpty SetupHooks -> SetupHooks # stimes :: Integral b => b -> SetupHooks -> SetupHooks # |
Empty hooks.
Configure hooks
Configure hooks can be used to augment the Cabal configure logic with
package-specific logic. The main principle is that the configure hooks can
feed into updating the PackageDescription
of a cabal
package. From then on,
this package configuration is set in stone, and later hooks (e.g. hooks into
the build phase) can no longer modify this configuration; instead they will
receive this configuration in their inputs, and must honour it.
Configuration happens at two levels:
- global configuration covers the entire package,
- local configuration covers a single component.
Once the global package configuration is done, all hooks work on a per-component level. The configuration hooks thus follow a simple philosophy:
- All modifications to global package options must use
$sel:preConfPackageHook:ConfigureHooks
. - All modifications to component configuration options must use
$sel:preConfComponentHook:ConfigureHooks
.
For example, to generate modules inside a given component, you should:
- In the per-component configure hook, declare the modules you are going to
generate by adding them to the
autogenModules
field for that component (unless you know them ahead of time, in which case they can be listed textually in the.cabal
file of the project). - In the build hooks, describe the actions that will generate these modules.
data ConfigureHooks #
Configure-time hooks.
Order of execution:
$sel:preConfPackageHook:ConfigureHooks
,- configure the package,
$sel:postConfPackageHook:ConfigureHooks
,$sel:preConfComponentHook:ConfigureHooks
,- configure the components.
ConfigureHooks | |
|
Instances
Monoid ConfigureHooks | |
Defined in Distribution.Simple.SetupHooks.Internal mappend :: ConfigureHooks -> ConfigureHooks -> ConfigureHooks # mconcat :: [ConfigureHooks] -> ConfigureHooks # | |
Semigroup ConfigureHooks | |
Defined in Distribution.Simple.SetupHooks.Internal (<>) :: ConfigureHooks -> ConfigureHooks -> ConfigureHooks # sconcat :: NonEmpty ConfigureHooks -> ConfigureHooks # stimes :: Integral b => b -> ConfigureHooks -> ConfigureHooks # |
noConfigureHooks :: ConfigureHooks #
Empty configure phase hooks.
Per-package configure hooks
data PreConfPackageInputs #
Inputs to the package-wide pre-configure step.
PreConfPackageInputs | |
|
Instances
data PreConfPackageOutputs #
Outputs of the package-wide pre-configure step.
Prefer using noPreConfPackageOutputs
and overriding the fields
you care about, to avoid depending on implementation details
of this datatype.
Instances
noPreConfPackageOutputs :: PreConfPackageInputs -> PreConfPackageOutputs #
Use this smart constructor to declare an empty set of changes by the package-wide pre-configure hook, and override the fields you care about.
Use this rather than PreConfPackageOutputs
to avoid relying on
internal implementation details of the latter.
data PostConfPackageInputs #
Inputs to the package-wide post-configure step.
Instances
type PostConfPackageHook = PostConfPackageInputs -> IO () #
Package-wide post-configure step.
Perform side effects. Last opportunity for any package-wide logic; any subsequent hooks work per-component.
Per-component configure hooks
data PreConfComponentInputs #
Inputs to the per-component pre-configure step.
Instances
data PreConfComponentOutputs #
Outputs of the per-component pre-configure step.
Prefer using noPreComponentOutputs
and overriding the fields
you care about, to avoid depending on implementation details
of this datatype.
Instances
noPreConfComponentOutputs :: PreConfComponentInputs -> PreConfComponentOutputs #
Use this smart constructor to declare an empty set of changes by a per-component pre-configure hook, and override the fields you care about.
Use this rather than PreConfComponentOutputs
to avoid relying on
internal implementation details of the latter.
type PreConfComponentHook = PreConfComponentInputs -> IO PreConfComponentOutputs #
Per-component pre-configure step.
For each component of the package, this hook can perform side effects, and return a diff to the passed in component, e.g. to declare additional autogenerated modules.
newtype ComponentDiff #
Instances
Structured ComponentDiff | |
Defined in Distribution.Simple.SetupHooks.Internal structure :: Proxy ComponentDiff -> Structure # structureHash' :: Tagged ComponentDiff MD5 | |
Semigroup ComponentDiff | |
Defined in Distribution.Simple.SetupHooks.Internal (<>) :: ComponentDiff -> ComponentDiff -> ComponentDiff # sconcat :: NonEmpty ComponentDiff -> ComponentDiff # stimes :: Integral b => b -> ComponentDiff -> ComponentDiff # | |
Show ComponentDiff | |
Defined in Distribution.Simple.SetupHooks.Internal showsPrec :: Int -> ComponentDiff -> ShowS # show :: ComponentDiff -> String # showList :: [ComponentDiff] -> ShowS # | |
Binary ComponentDiff | |
Defined in Distribution.Simple.SetupHooks.Internal |
type LibraryDiff = Library #
type ForeignLibDiff = ForeignLib #
type ExecutableDiff = Executable #
type TestSuiteDiff = TestSuite #
type BenchmarkDiff = Benchmark #
type BuildInfoDiff = BuildInfo #
Build hooks
data BuildHooks #
Build-time hooks.
BuildHooks | |
|
Instances
Monoid BuildHooks | |
Defined in Distribution.Simple.SetupHooks.Internal mempty :: BuildHooks # mappend :: BuildHooks -> BuildHooks -> BuildHooks # mconcat :: [BuildHooks] -> BuildHooks # | |
Semigroup BuildHooks | |
Defined in Distribution.Simple.SetupHooks.Internal (<>) :: BuildHooks -> BuildHooks -> BuildHooks # sconcat :: NonEmpty BuildHooks -> BuildHooks # stimes :: Integral b => b -> BuildHooks -> BuildHooks # |
Empty build hooks.
data BuildingWhat #
What kind of build phase are we doing/hooking into?
Is this a normal build, or is it perhaps for running an interactive session or Haddock?
BuildNormal BuildFlags | A normal build. |
BuildRepl ReplFlags | Build steps for an interactive session. |
BuildHaddock HaddockFlags | Build steps for generating documentation. |
BuildHscolour HscolourFlags | Build steps for Hscolour. |
Instances
buildingWhatDistPref :: BuildingWhat -> SymbolicPath Pkg ('Dir Dist) #
Pre-build rules
Pre-build hooks are specified as a collection of pre-build Rules
.
Each Rule
consists of:
- a specification of its static dependencies and outputs,
- the commands that execute the rule.
Rules are constructed using either one of the staticRule
or dynamicRule
smart constructors. Directly constructing a Rule
using the constructors of
that data type is not advised, as this relies on internal implementation details
which are subject to change in between versions of the `Cabal-hooks` library.
Note that:
- To declare the dependency on the output of a rule, one must refer to the
rule directly, and not to the path to the output executing that rule will
eventually produce.
To do so, registering a
Rule
with the API returns a unique identifier for that rule, in the form of aRuleId
. - File dependencies and outputs are not specified directly by
FilePath
, but rather use theLocation
type (which is more convenient when working with preprocessors). - Rules refer to the actions that execute them using static pointers, in order to enable serialisation/deserialisation of rules.
- Rules can additionally monitor files or directories, which determines when to re-compute the entire set of rules.
data PreBuildComponentInputs #
PreBuildComponentInputs | |
|
Instances
Post-build hooks
data PostBuildComponentInputs #
Instances
type PostBuildComponentHook = PostBuildComponentInputs -> IO () #
Rules
A collection of Rule
s.
Use the rules
smart constructor instead of directly using the Rules
constructor.
- Rules are registered using
registerRule
, - Monitored files or directories are declared using
addRuleMonitors
; a change in these will trigger the recomputation of all rules.
The env
type parameter represents an extra argument, which usually
consists of information known to Cabal such as LocalBuildInfo
and
ComponentLocalBuildInfo
.
:: StaticPtr label | unique label for this collection of rules |
-> (env -> RulesM ()) | the computation of rules |
-> Rules env |
Construct a collection of rules with a given label.
A label for the rules can be constructed using the static
keyword,
using the StaticPointers
extension.
NB: separate calls to rules
should have different labels.
Example usage:
myRules :: Rules env myRules = rules (static ()) $ \ env -> do { .. } -- use the monadic API here
data Dependency #
A dependency of a rule.
RuleDependency !RuleOutput | A dependency on an output of another rule. |
FileDependency !Location | A direct dependency on a file at a particular location on disk. This should not be used for files that are generated by other rules;
use |
Instances
data RuleOutput #
A reference to an output of another rule.
RuleOutput | |
|
Instances
A unique identifier for a Rule
.
Instances
Structured RuleId | |
Defined in Distribution.Simple.SetupHooks.Rule | |
Generic RuleId | |
Show RuleId | |
Binary RuleId | |
Eq RuleId | |
Ord RuleId | |
type Rep RuleId | |
Defined in Distribution.Simple.SetupHooks.Rule type Rep RuleId = D1 ('MetaData "RuleId" "Distribution.Simple.SetupHooks.Rule" "Cabal-3.14.1.1-KNG8xgahazw32ECV34zzCb" 'False) (C1 ('MetaCons "RuleId" 'PrefixI 'True) (S1 ('MetaSel ('Just "ruleNameSpace") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RulesNameSpace) :*: S1 ('MetaSel ('Just "ruleName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShortText))) |
staticRule :: Typeable arg => Command arg (IO ()) -> [Dependency] -> NonEmpty Location -> Rule #
A rule with static dependencies.
Prefer using this smart constructor instead of Rule
whenever possible.
dynamicRule :: (Typeable depsArg, Typeable depsRes, Typeable arg) => StaticPtr (Dict (Binary depsRes, Show depsRes, Eq depsRes)) -> Command depsArg (IO ([Dependency], depsRes)) -> Command arg (depsRes -> IO ()) -> [Dependency] -> NonEmpty Location -> Rule #
A rule with dynamic dependencies.
Prefer using this smart constructor instead of Rule
whenever possible.
Rule inputs/outputs
Rules can declare various kinds of dependencies:
staticDependencies
: files or other rules that a rule statically depends on,- extra dynamic dependencies, using the
DynamicRuleCommands
constructor, MonitorFilePath
: additional files and directories to monitor.
Rules are considered out-of-date precisely when any of the following conditions apply:
- O1
- there has been a (relevant) change in the files and directories monitored by the rules,
- O2
- the environment passed to the computation of rules has changed.
If the rules are out-of-date, the build system is expected to re-run the computation that computes all rules.
After this re-computation of the set of all rules, we match up new rules
with old rules, by RuleId
. A rule is then considered stale if any of
following conditions apply:
- N
- the rule is new, or
- S
- the rule matches with an old rule, and either:
- S1
- a file dependency of the rule has been modifiedcreateddeleted, or a (transitive) rule dependency of the rule is itself stale, or
- S2
- the rule is different from the old rule, e.g. the argument stored in
the rule command has changed, or the pointer to the action to run the
rule has changed. (This is determined using the
Eq Rule
instance.)
A stale rule becomes no longer stale once we run its associated action. The build system is responsible for re-running the actions associated with each stale rule, in dependency order. This means the build system is expected to behave as follows:
- Any time the rules are out-of-date, query the rules to obtain up-to-date rules.
- Re-run stale rules.
A (fully resolved) location of a dependency or result of a rule, consisting of a base directory and of a file path relative to that base directory path.
In practice, this will be something like
,
where:Location
dir (moduleNameSymbolicPath
mod . "hs")
- for a file dependency,
dir
is one of the Cabal search directories, - for an output,
dir
is a directory such asautogenComponentModulesDir
orcomponentBuildDir
.
Location | |
|
Instances
location :: Location -> SymbolicPath Pkg 'File #
Get a (relative or absolute) un-interpreted path to a Location
.
autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> SymbolicPath Pkg ('Dir Source) #
The directory in which we put auto-generated modules for a particular component.
Actions
data RuleCommands (scope :: Scope) (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) where #
Commands to execute a rule:
- for a rule with static dependencies, a single command,
- for a rule with dynamic dependencies, a command for computing dynamic dependencies, and a command for executing the rule.
StaticRuleCommand | A rule with statically-known dependencies. |
| |
DynamicRuleCommands | |
|
Instances
(forall arg res. Show (ruleCmd 'User arg res), forall depsArg depsRes. Show depsRes => Show (deps 'User depsArg depsRes)) => Show (RuleCommands 'User deps ruleCmd) | |
Defined in Distribution.Simple.SetupHooks.Rule | |
(forall res. Binary (ruleCmd 'System ByteString res), Binary (deps 'System ByteString ByteString)) => Binary (RuleCommands 'System deps ruleCmd) | |
Defined in Distribution.Simple.SetupHooks.Rule put :: RuleCommands 'System deps ruleCmd -> Put # get :: Get (RuleCommands 'System deps ruleCmd) # putList :: [RuleCommands 'System deps ruleCmd] -> Put # | |
(forall arg res. Binary (ruleCmd 'User arg res), forall depsArg depsRes. Binary depsRes => Binary (deps 'User depsArg depsRes)) => Binary (RuleCommands 'User deps ruleCmd) | |
Defined in Distribution.Simple.SetupHooks.Rule put :: RuleCommands 'User deps ruleCmd -> Put # get :: Get (RuleCommands 'User deps ruleCmd) # putList :: [RuleCommands 'User deps ruleCmd] -> Put # | |
(forall res. Eq (ruleCmd 'System ByteString res), Eq (deps 'System ByteString ByteString)) => Eq (RuleCommands 'System deps ruleCmd) | |
Defined in Distribution.Simple.SetupHooks.Rule (==) :: RuleCommands 'System deps ruleCmd -> RuleCommands 'System deps ruleCmd -> Bool # (/=) :: RuleCommands 'System deps ruleCmd -> RuleCommands 'System deps ruleCmd -> Bool # | |
(forall arg res. Eq (ruleCmd 'User arg res), forall depsArg depsRes. Eq depsRes => Eq (deps 'User depsArg depsRes)) => Eq (RuleCommands 'User deps ruleCmd) | |
Defined in Distribution.Simple.SetupHooks.Rule (==) :: RuleCommands 'User deps ruleCmd -> RuleCommands 'User deps ruleCmd -> Bool # (/=) :: RuleCommands 'User deps ruleCmd -> RuleCommands 'User deps ruleCmd -> Bool # |
type Command = CommandData 'User #
A command consists of a statically-known action together with a (possibly dynamic) argument to that action.
For example, the action can consist of running an executable
(such as happy
or c2hs
), while the argument consists of the variable
component of the command, e.g. the specific file to run happy
on.
mkCommand :: StaticPtr (Dict (Binary arg, Show arg)) -> StaticPtr (arg -> res) -> arg -> Command arg res #
Construct a command.
Prefer using this smart constructor instead of Command
whenever possible.
A wrapper used to pass evidence of a constraint as an explicit value.
Rules API
Defining pre-build rules can be done in the following style:
{-# LANGUAGE BlockArguments, StaticPointers #-} myPreBuildRules :: PreBuildComponentRules myPreBuildRules = rules (static ()) $ \ preBuildEnvironment -> do let cmd1 = mkCommand (static Dict) $ static \ arg -> do { .. } cmd2 = mkCommand (static Dict) $ static \ arg -> do { .. } myData <- liftIO someIOAction addRuleMonitors [ monitorDirectory "someSearchDir" ] registerRule_ "rule_1_1" $ staticRule (cmd1 arg1) deps1 outs1 registerRule_ "rule_1_2" $ staticRule (cmd1 arg2) deps2 outs2 registerRule_ "rule_1_3" $ staticRule (cmd1 arg3) deps3 outs3 registerRule_ "rule_2_4" $ staticRule (cmd2 arg4) deps4 outs4
Here we use the rules
, staticRule
and mkCommand
smart constructors,
rather than directly using the Rules
, Rule
and Command
constructors,
which insulates us from internal changes to the Rules
, Rule
and Command
datatypes, respectively.
We use addRuleMonitors
to declare a monitored directory that the collection
of rules as a whole depends on. In this case, we declare that they depend on the
contents of the "searchDir" directory. This means that the rules will be
computed anew whenever the contents of this directory change.
:: ShortText | user-given rule name; these should be unique on a per-package level |
-> Rule | the rule to register |
-> RulesM RuleId |
Register a rule. Returns an identifier for that rule.
:: ShortText | user-given rule name; these should be unique on a per-package level |
-> Rule | the rule to register |
-> RulesT IO () |
Register a rule, discarding the produced RuleId
.
Using this function means that you don't expect any other rules to ever
depend on any outputs of this rule. Use registerRule
to retain the
RuleId
instead.
File/directory monitoring
addRuleMonitors :: Monad m => [MonitorFilePath] -> RulesT m () Source #
Declare additional monitored objects for the collection of all rules.
When these monitored objects change, the rules are re-computed.
Install hooks
data InstallHooks #
Copy/install hooks.
InstallHooks | |
|
Instances
Monoid InstallHooks | |
Defined in Distribution.Simple.SetupHooks.Internal mempty :: InstallHooks # mappend :: InstallHooks -> InstallHooks -> InstallHooks # mconcat :: [InstallHooks] -> InstallHooks # | |
Semigroup InstallHooks | |
Defined in Distribution.Simple.SetupHooks.Internal (<>) :: InstallHooks -> InstallHooks -> InstallHooks # sconcat :: NonEmpty InstallHooks -> InstallHooks # stimes :: Integral b => b -> InstallHooks -> InstallHooks # |
noInstallHooks :: InstallHooks #
Empty copy/install hooks.
data InstallComponentInputs #
Instances
type InstallComponentHook = InstallComponentInputs -> IO () #
A per-component install hook, which can only perform side effects (e.g. copying files).
Re-exports
Hooks
Configure hooks
data ConfigFlags #
Flags to configure
command.
IMPORTANT: every time a new flag is added, filterConfigureFlags
should be updated.
IMPORTANT: every time a new flag is added, it should be added to the Eq instance
ConfigFlags | |
|
pattern ConfigCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> ConfigFlags |
Instances
Build hooks
data BuildFlags #
BuildFlags | |
|
pattern BuildCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> BuildFlags |
Instances
ReplFlags | |
|
pattern ReplCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> ReplFlags |
Instances
Structured ReplFlags | |
Defined in Distribution.Simple.Setup.Repl | |
Monoid ReplFlags | |
Semigroup ReplFlags | |
Generic ReplFlags | |
Show ReplFlags | |
Binary ReplFlags | |
type Rep ReplFlags | |
Defined in Distribution.Simple.Setup.Repl type Rep ReplFlags = D1 ('MetaData "ReplFlags" "Distribution.Simple.Setup.Repl" "Cabal-3.14.1.1-KNG8xgahazw32ECV34zzCb" 'False) (C1 ('MetaCons "ReplFlags" 'PrefixI 'True) ((S1 ('MetaSel ('Just "replCommonFlags") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommonSetupFlags) :*: S1 ('MetaSel ('Just "replProgramPaths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(String, FilePath)])) :*: (S1 ('MetaSel ('Just "replProgramArgs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(String, [String])]) :*: (S1 ('MetaSel ('Just "replReload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "replReplOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ReplOptions))))) |
data HaddockFlags #
pattern HaddockCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> HaddockFlags |
Instances
data HscolourFlags #
pattern HscolourCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> HscolourFlags |
Instances
Install hooks
Flags to copy
: (destdir, copy-prefix (backwards compat), verbosity)
pattern CopyCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> CopyFlags |
Instances
Structured CopyFlags | |
Defined in Distribution.Simple.Setup.Copy | |
Monoid CopyFlags | |
Semigroup CopyFlags | |
Generic CopyFlags | |
Show CopyFlags | |
Binary CopyFlags | |
type Rep CopyFlags | |
Defined in Distribution.Simple.Setup.Copy type Rep CopyFlags = D1 ('MetaData "CopyFlags" "Distribution.Simple.Setup.Copy" "Cabal-3.14.1.1-KNG8xgahazw32ECV34zzCb" 'False) (C1 ('MetaCons "CopyFlags" 'PrefixI 'True) (S1 ('MetaSel ('Just "copyCommonFlags") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommonSetupFlags) :*: S1 ('MetaSel ('Just "copyDest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag CopyDest)))) |
Hooks
API
These are functions provided as part of the Hooks
API.
It is recommended to import them from this module as opposed to
manually importing them from inside the Cabal module hierarchy.
Copy/install functions
:: Verbosity | |
-> CabalSpecVersion | |
-> Maybe (SymbolicPath CWD ('Dir Pkg)) | |
-> (Maybe (SymbolicPath CWD ('Dir DataDir)), SymbolicPath Pkg ('Dir DataDir)) | (src_dir, dest_dir) |
-> RelativePath DataDir 'File | file glob pattern |
-> IO () |
Install the files specified by the given glob pattern.
Interacting with the program database
Represents a program which can be configured.
Note: rather than constructing this directly, start with simpleProgram
and
override any extra fields.
Program | |
|
data ConfiguredProgram #
Represents a program which has been configured and is thus ready to be run.
These are usually made by configuring a Program
, but if you have to
construct one directly then start with simpleConfiguredProgram
and
override any extra fields.
ConfiguredProgram | |
|
Instances
data ProgramLocation #
Where a program was found. Also tells us whether it's specified by user or not. This includes not just the path, but the program as well.
UserSpecified | The user gave the path to this program, eg. --ghc-path=/usr/bin/ghc-6.6 |
FoundOnSystem | The program was found automatically. |
Instances
The configuration is a collection of information about programs. It contains information both about configured programs and also about programs that we are yet to configure.
The idea is that we start from a collection of unconfigured programs and one
by one we try to configure them at which point we move them into the
configured collection. For unconfigured programs we record not just the
Program
but also any user-provided arguments and location for the program.
Instances
Structured ProgramDb | |
Defined in Distribution.Simple.Program.Db | |
Read ProgramDb | Note that this instance does not preserve the known |
Show ProgramDb | Note that this instance does not preserve the known |
Binary ProgramDb | Note that this instance does not preserve the known |
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb #
configureUnconfiguredProgram :: Verbosity -> Program -> ProgramDb -> IO (Maybe ConfiguredProgram) #
Try to configure a specific program. If the program is already included in the collection of unconfigured programs then we use any user-supplied location and arguments.
simpleProgram :: String -> Program #
Make a simple named program.
By default we'll just search for it in the path and not try to find the version name. You can override these behaviours if necessary, eg:
(simpleProgram "foo") { programFindLocation = ... , programFindVersion ... }
General Cabal
datatypes
Instances
Parsec Verbosity | Parser verbosity
Note: this parser will eat trailing spaces. |
Defined in Distribution.Verbosity parsec :: CabalParsing m => m Verbosity # | |
Pretty Verbosity | |
Defined in Distribution.Verbosity prettyVersioned :: CabalSpecVersion -> Verbosity -> Doc # | |
Structured Verbosity | |
Defined in Distribution.Verbosity | |
Bounded Verbosity | |
Enum Verbosity | |
Defined in Distribution.Verbosity succ :: Verbosity -> Verbosity # pred :: Verbosity -> Verbosity # fromEnum :: Verbosity -> Int # enumFrom :: Verbosity -> [Verbosity] # enumFromThen :: Verbosity -> Verbosity -> [Verbosity] # enumFromTo :: Verbosity -> Verbosity -> [Verbosity] # enumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity] # | |
Generic Verbosity | |
Read Verbosity | |
Show Verbosity | |
Binary Verbosity | |
Eq Verbosity | |
Ord Verbosity | |
Defined in Distribution.Verbosity | |
type Rep Verbosity | |
Defined in Distribution.Verbosity type Rep Verbosity = D1 ('MetaData "Verbosity" "Distribution.Verbosity" "Cabal-3.14.1.1-KNG8xgahazw32ECV34zzCb" 'False) (C1 ('MetaCons "Verbosity" 'PrefixI 'True) (S1 ('MetaSel ('Just "vLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityLevel) :*: (S1 ('MetaSel ('Just "vFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set VerbosityFlag)) :*: S1 ('MetaSel ('Just "vQuiet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
Compiler | |
|
Instances
Instances
Parsec Platform | |
Defined in Distribution.System parsec :: CabalParsing m => m Platform # | |
Pretty Platform | |
Defined in Distribution.System prettyVersioned :: CabalSpecVersion -> Platform -> Doc # | |
Structured Platform | |
Defined in Distribution.System | |
Data Platform | |
Defined in Distribution.System gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Platform -> c Platform # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Platform # toConstr :: Platform -> Constr # dataTypeOf :: Platform -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Platform) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Platform) # gmapT :: (forall b. Data b => b -> b) -> Platform -> Platform # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Platform -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Platform -> r # gmapQ :: (forall d. Data d => d -> u) -> Platform -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Platform -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Platform -> m Platform # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Platform -> m Platform # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Platform -> m Platform # | |
Generic Platform | |
Read Platform | |
Show Platform | |
Binary Platform | |
NFData Platform | |
Defined in Distribution.System | |
Eq Platform | |
Ord Platform | |
Defined in Distribution.System | |
type Rep Platform | |
Defined in Distribution.System type Rep Platform = D1 ('MetaData "Platform" "Distribution.System" "Cabal-syntax-3.14.1.0-Cm6co4XoXcLG0FTMtu5Sqa" 'False) (C1 ('MetaCons "Platform" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Arch) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OS))) |
A suffix (or file extension).
Mostly used to decide which preprocessor to use, e.g. files with suffix "y"
are usually processed by the "happy"
build tool.
Instances
Pretty Suffix | |
Defined in Distribution.Simple.PreProcess.Types prettyVersioned :: CabalSpecVersion -> Suffix -> Doc # | |
Structured Suffix | |
Defined in Distribution.Simple.PreProcess.Types | |
IsString Suffix | |
Defined in Distribution.Simple.PreProcess.Types fromString :: String -> Suffix # | |
Generic Suffix | |
Show Suffix | |
Binary Suffix | |
Eq Suffix | |
Ord Suffix | |
type Rep Suffix | |
Defined in Distribution.Simple.PreProcess.Types |
Package information
data LocalBuildConfig #
LocalBuildConfig
contains options that can be controlled
by the user and serve as inputs to the configuration of a package.
Instances
data LocalBuildInfo #
Data cached after configuration step. See also
ConfigFlags
.
Instances
data PackageBuildDescr #
PackageBuildDescr
contains the information Cabal determines after
performing package-wide configuration of a package, before doing any
per-component configuration.
Instances
data PackageDescription #
This data type is the internal representation of the file pkg.cabal
.
It contains two kinds of information about the package: information
which is needed for all packages, such as the package name and version, and
information which is needed for the simple build system only, such as
the compiler options and library name.
Instances
Component information
Instances
data ComponentName #
CLibName LibraryName | |
CNotLibName NotLibComponentName |
pattern CBenchName :: UnqualComponentName -> ComponentName | |
pattern CTestName :: UnqualComponentName -> ComponentName | |
pattern CExeName :: UnqualComponentName -> ComponentName | |
pattern CFLibName :: UnqualComponentName -> ComponentName |
Instances
componentName :: Component -> ComponentName #
BuildInfo | |
|
Instances
data TargetInfo #
The TargetInfo
contains all the information necessary to build a
specific target (e.g., componentmodulefile) in a package. In
principle, one can get the Component
from a
ComponentLocalBuildInfo
and LocalBuildInfo
, but it is much more
convenient to have the component in hand.
Instances
data ComponentLocalBuildInfo #
The first five fields are common across all algebraic variants.
LibComponentLocalBuildInfo | |
| |
FLibComponentLocalBuildInfo | |
| |
ExeComponentLocalBuildInfo | |
| |
TestComponentLocalBuildInfo | |
| |
BenchComponentLocalBuildInfo | |
|
Instances
Components
Library | |
|
Instances
data ForeignLib #
A foreign library stanza is like a library stanza, except that the built code is intended for consumption by a non-Haskell client.
ForeignLib | |
|
Instances
data Executable #
Instances
A "test-suite" stanza in a cabal file.
Instances
A "benchmark" stanza in a cabal file.
Instances
data LibraryName #
Instances
emptyLibrary :: Library #
emptyForeignLib :: ForeignLib #
An empty foreign library.