-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | API for the Hooks build-type
--
-- User-facing API for the Hooks build-type.
@package Cabal-hooks
@version 3.14
-- | 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 :: SetupHooks. This is a record that
-- declares actions that should be hooked into the cabal build process.
--
-- See SetupHooks for more details.
module Distribution.Simple.SetupHooks
-- | Hooks into the cabal build phases.
--
-- Usage:
--
--
-- - In your .cabal file, declare build-type: Hooks
-- (with a cabal-version greater than or equal to
-- 3.14),
-- - In your .cabal file, include a custom-setup
-- stanza which declares the dependencies of your SetupHooks
-- module; this will usually contain a dependency on the
-- Cabal-hooks package.
-- - Provide a SetupHooks.hs module next to your
-- .cabal file; it must export setupHooks ::
-- SetupHooks.
--
data () => SetupHooks
SetupHooks :: ConfigureHooks -> BuildHooks -> InstallHooks -> SetupHooks
-- | Hooks into the configure phase.
[$sel:configureHooks:SetupHooks] :: SetupHooks -> ConfigureHooks
-- | Hooks into the build phase.
--
-- These hooks are relevant to any build-like phase, such as repl or
-- haddock.
[$sel:buildHooks:SetupHooks] :: SetupHooks -> BuildHooks
-- | Hooks into the copy/install phase.
[$sel:installHooks:SetupHooks] :: SetupHooks -> InstallHooks
-- | Empty hooks.
noSetupHooks :: SetupHooks
-- | Configure-time hooks.
--
-- Order of execution:
--
--
data () => ConfigureHooks
ConfigureHooks :: Maybe PreConfPackageHook -> Maybe PostConfPackageHook -> Maybe PreConfComponentHook -> ConfigureHooks
-- | Package-wide pre-configure hook. See PreConfPackageHook.
[$sel:preConfPackageHook:ConfigureHooks] :: ConfigureHooks -> Maybe PreConfPackageHook
-- | Package-wide post-configure hook. See PostConfPackageHook.
[$sel:postConfPackageHook:ConfigureHooks] :: ConfigureHooks -> Maybe PostConfPackageHook
-- | Per-component pre-configure hook. See PreConfComponentHook.
[$sel:preConfComponentHook:ConfigureHooks] :: ConfigureHooks -> Maybe PreConfComponentHook
-- | Empty configure phase hooks.
noConfigureHooks :: ConfigureHooks
-- | Inputs to the package-wide pre-configure step.
data () => PreConfPackageInputs
PreConfPackageInputs :: ConfigFlags -> LocalBuildConfig -> Compiler -> Platform -> PreConfPackageInputs
[$sel:configFlags:PreConfPackageInputs] :: PreConfPackageInputs -> ConfigFlags
-- | Warning: the ProgramDb in the LocalBuildInfo field will
-- not contain any unconfigured programs.
[$sel:localBuildConfig:PreConfPackageInputs] :: PreConfPackageInputs -> LocalBuildConfig
[$sel:compiler:PreConfPackageInputs] :: PreConfPackageInputs -> Compiler
[$sel:platform:PreConfPackageInputs] :: PreConfPackageInputs -> Platform
-- | 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.
data () => PreConfPackageOutputs
PreConfPackageOutputs :: BuildOptions -> ConfiguredProgs -> PreConfPackageOutputs
[$sel:buildOptions:PreConfPackageOutputs] :: PreConfPackageOutputs -> BuildOptions
[$sel:extraConfiguredProgs:PreConfPackageOutputs] :: PreConfPackageOutputs -> ConfiguredProgs
-- | 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.
noPreConfPackageOutputs :: PreConfPackageInputs -> PreConfPackageOutputs
type PreConfPackageHook = PreConfPackageInputs -> IO PreConfPackageOutputs
-- | Inputs to the package-wide post-configure step.
data () => PostConfPackageInputs
PostConfPackageInputs :: LocalBuildConfig -> PackageBuildDescr -> PostConfPackageInputs
[$sel:localBuildConfig:PostConfPackageInputs] :: PostConfPackageInputs -> LocalBuildConfig
[$sel:packageBuildDescr:PostConfPackageInputs] :: PostConfPackageInputs -> PackageBuildDescr
-- | Package-wide post-configure step.
--
-- Perform side effects. Last opportunity for any package-wide logic; any
-- subsequent hooks work per-component.
type PostConfPackageHook = PostConfPackageInputs -> IO ()
-- | Inputs to the per-component pre-configure step.
data () => PreConfComponentInputs
PreConfComponentInputs :: LocalBuildConfig -> PackageBuildDescr -> Component -> PreConfComponentInputs
[$sel:localBuildConfig:PreConfComponentInputs] :: PreConfComponentInputs -> LocalBuildConfig
[$sel:packageBuildDescr:PreConfComponentInputs] :: PreConfComponentInputs -> PackageBuildDescr
[$sel:component:PreConfComponentInputs] :: PreConfComponentInputs -> Component
-- | 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.
data () => PreConfComponentOutputs
PreConfComponentOutputs :: ComponentDiff -> PreConfComponentOutputs
[$sel:componentDiff:PreConfComponentOutputs] :: PreConfComponentOutputs -> ComponentDiff
-- | 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.
noPreConfComponentOutputs :: PreConfComponentInputs -> 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.
type PreConfComponentHook = PreConfComponentInputs -> IO PreConfComponentOutputs
-- | A diff to a Cabal Component, that gets combined monoidally into
-- an existing Component.
newtype () => ComponentDiff
ComponentDiff :: Component -> ComponentDiff
[$sel:componentDiff:ComponentDiff] :: ComponentDiff -> Component
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
-- | Build-time hooks.
data () => BuildHooks
BuildHooks :: Maybe PreBuildComponentRules -> Maybe PostBuildComponentHook -> BuildHooks
-- | Per-component fine-grained pre-build rules.
[$sel:preBuildComponentRules:BuildHooks] :: BuildHooks -> Maybe PreBuildComponentRules
-- | Per-component post-build hook.
[$sel:postBuildComponentHook:BuildHooks] :: BuildHooks -> Maybe PostBuildComponentHook
-- | Empty build hooks.
noBuildHooks :: BuildHooks
-- | 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?
data () => BuildingWhat
-- | A normal build.
BuildNormal :: BuildFlags -> BuildingWhat
-- | Build steps for an interactive session.
BuildRepl :: ReplFlags -> BuildingWhat
-- | Build steps for generating documentation.
BuildHaddock :: HaddockFlags -> BuildingWhat
-- | Build steps for Hscolour.
BuildHscolour :: HscolourFlags -> BuildingWhat
buildingWhatVerbosity :: BuildingWhat -> Verbosity
buildingWhatDistPref :: BuildingWhat -> SymbolicPath Pkg ('Dir Dist)
data () => PreBuildComponentInputs
PreBuildComponentInputs :: BuildingWhat -> LocalBuildInfo -> TargetInfo -> PreBuildComponentInputs
-- | what kind of build phase are we hooking into?
[$sel:buildingWhat:PreBuildComponentInputs] :: PreBuildComponentInputs -> BuildingWhat
-- | information about the package
[$sel:localBuildInfo:PreBuildComponentInputs] :: PreBuildComponentInputs -> LocalBuildInfo
-- | information about an individual component
[$sel:targetInfo:PreBuildComponentInputs] :: PreBuildComponentInputs -> TargetInfo
type PreBuildComponentRules = Rules PreBuildComponentInputs
data () => PostBuildComponentInputs
PostBuildComponentInputs :: BuildFlags -> LocalBuildInfo -> TargetInfo -> PostBuildComponentInputs
[$sel:buildFlags:PostBuildComponentInputs] :: PostBuildComponentInputs -> BuildFlags
[$sel:localBuildInfo:PostBuildComponentInputs] :: PostBuildComponentInputs -> LocalBuildInfo
[$sel:targetInfo:PostBuildComponentInputs] :: PostBuildComponentInputs -> TargetInfo
type PostBuildComponentHook = PostBuildComponentInputs -> IO ()
-- | A collection of Rules.
--
-- 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.
data () => 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
--
rules :: StaticPtr label -> (env -> RulesM ()) -> Rules env
-- | An empty collection of rules.
noRules :: RulesM ()
type Rule = RuleData 'User
-- | A dependency of a rule.
data () => Dependency
-- | A dependency on an output of another rule.
RuleDependency :: !RuleOutput -> Dependency
-- | 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 RuleDependency instead.
FileDependency :: !Location -> Dependency
-- | A reference to an output of another rule.
data () => RuleOutput
RuleOutput :: !RuleId -> !Word -> RuleOutput
-- | which rule's outputs are we referring to?
[outputOfRule] :: RuleOutput -> !RuleId
-- | which particular output of that rule?
[outputIndex] :: RuleOutput -> !Word
-- | A unique identifier for a Rule.
data () => RuleId
-- | A rule with static dependencies.
--
-- Prefer using this smart constructor instead of Rule whenever
-- possible.
staticRule :: Typeable arg => Command arg (IO ()) -> [Dependency] -> NonEmpty Location -> Rule
-- | A rule with dynamic 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 (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 Location dir
-- (moduleNameSymbolicPath mod . "hs"), where:
--
--
-- - for a file dependency, dir is one of the Cabal search
-- directories,
-- - for an output, dir is a directory such as
-- autogenComponentModulesDir or
-- componentBuildDir.
--
data () => Location
[Location] :: forall baseDir. !SymbolicPath Pkg ('Dir baseDir) -> !RelativePath baseDir 'File -> Location
-- | Get a (relative or absolute) un-interpreted path to a Location.
location :: Location -> SymbolicPath Pkg 'File
-- | The directory in which we put auto-generated modules for a particular
-- component.
autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> SymbolicPath Pkg ('Dir Source)
componentBuildDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> SymbolicPath Pkg ('Dir Build)
-- | 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.
--
data () => RuleCommands (scope :: Scope) (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type)
-- | A rule with statically-known dependencies.
[StaticRuleCommand] :: forall arg (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) (scope :: Scope). If (scope == 'System) (arg ~ ByteString) () => !ruleCmd scope arg (IO ()) -> !If (scope == 'System) SomeTypeRep (TypeRep arg) -> 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) () => !Static scope (Dict (Binary depsRes, Show depsRes, Eq depsRes)) -> !deps scope depsArg depsRes -> !ruleCmd scope arg (depsRes -> IO ()) -> !If (scope == 'System) SomeTypeRep (TypeRep (depsArg, depsRes, arg)) -> RuleCommands scope deps ruleCmd
-- | 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.
type Command = CommandData 'User
-- | Construct a command.
--
-- Prefer using this smart constructor instead of Command whenever
-- possible.
mkCommand :: StaticPtr (Dict (Binary arg, Show arg)) -> StaticPtr (arg -> res) -> arg -> Command arg res
-- | A wrapper used to pass evidence of a constraint as an explicit value.
data () => Dict c
[Dict] :: forall c. c => Dict c
-- | Monad for constructing rules.
type RulesM a = RulesT IO a
-- | Register a rule. Returns an identifier for that rule.
registerRule :: ShortText -> Rule -> RulesM RuleId
-- | 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.
registerRule_ :: ShortText -> Rule -> RulesT IO ()
-- | Declare additional monitored objects for the collection of all rules.
--
-- When these monitored objects change, the rules are re-computed.
addRuleMonitors :: Monad m => [MonitorFilePath] -> RulesT m ()
-- | Copy/install hooks.
data () => InstallHooks
InstallHooks :: Maybe InstallComponentHook -> InstallHooks
-- | Per-component install hook.
[$sel:installComponentHook:InstallHooks] :: InstallHooks -> Maybe InstallComponentHook
-- | Empty copy/install hooks.
noInstallHooks :: InstallHooks
data () => InstallComponentInputs
InstallComponentInputs :: CopyFlags -> LocalBuildInfo -> TargetInfo -> InstallComponentInputs
[$sel:copyFlags:InstallComponentInputs] :: InstallComponentInputs -> CopyFlags
[$sel:localBuildInfo:InstallComponentInputs] :: InstallComponentInputs -> LocalBuildInfo
[$sel:targetInfo:InstallComponentInputs] :: InstallComponentInputs -> TargetInfo
-- | A per-component install hook, which can only perform side effects
-- (e.g. copying files).
type InstallComponentHook = InstallComponentInputs -> IO ()
-- | 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
data () => ConfigFlags
ConfigFlags :: !CommonSetupFlags -> Option' (Last' ProgramDb) -> [(String, FilePath)] -> [(String, [String])] -> NubList FilePath -> Flag CompilerFlavor -> Flag FilePath -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag ProfDetailLevel -> Flag ProfDetailLevel -> [String] -> Flag OptimisationLevel -> Flag PathTemplate -> Flag PathTemplate -> InstallDirs (Flag PathTemplate) -> Flag FilePath -> [SymbolicPath Pkg ('Dir Lib)] -> [SymbolicPath Pkg ('Dir Lib)] -> [SymbolicPath Pkg ('Dir Framework)] -> [SymbolicPath Pkg ('Dir Include)] -> Flag String -> Flag ComponentId -> Flag Bool -> Flag Bool -> [Maybe PackageDB] -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> [PackageVersionConstraint] -> [GivenComponent] -> [PromisedComponent] -> [(ModuleName, Module)] -> FlagAssignment -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag String -> Flag Bool -> Flag DebugInfoLevel -> Flag DumpBuildInfo -> Flag Bool -> Flag Bool -> Flag [UnitId] -> Flag Bool -> ConfigFlags
[configCommonFlags] :: ConfigFlags -> !CommonSetupFlags
-- | All programs that cabal may run
[configPrograms_] :: ConfigFlags -> Option' (Last' ProgramDb)
-- | user specified programs paths
[configProgramPaths] :: ConfigFlags -> [(String, FilePath)]
-- | user specified programs args
[configProgramArgs] :: ConfigFlags -> [(String, [String])]
-- | Extend the $PATH
[configProgramPathExtra] :: ConfigFlags -> NubList FilePath
-- | The "flavor" of the compiler, e.g. GHC.
[configHcFlavor] :: ConfigFlags -> Flag CompilerFlavor
-- | given compiler location
[configHcPath] :: ConfigFlags -> Flag FilePath
-- | given hc-pkg location
[configHcPkg] :: ConfigFlags -> Flag FilePath
-- | Enable vanilla library
[configVanillaLib] :: ConfigFlags -> Flag Bool
-- | Enable profiling in the library
[configProfLib] :: ConfigFlags -> Flag Bool
-- | Build shared library
[configSharedLib] :: ConfigFlags -> Flag Bool
-- | Build static library
[configStaticLib] :: ConfigFlags -> Flag Bool
-- | Enable dynamic linking of the executables.
[configDynExe] :: ConfigFlags -> Flag Bool
-- | Enable fully static linking of the executables.
[configFullyStaticExe] :: ConfigFlags -> Flag Bool
-- | Enable profiling in the executables.
[configProfExe] :: ConfigFlags -> Flag Bool
-- | Enable profiling in the library and executables.
[configProf] :: ConfigFlags -> Flag Bool
-- | Enable shared profiling objects
[configProfShared] :: ConfigFlags -> Flag Bool
-- | Profiling detail level in the library and executables.
[configProfDetail] :: ConfigFlags -> Flag ProfDetailLevel
-- | Profiling detail level in the library
[configProfLibDetail] :: ConfigFlags -> Flag ProfDetailLevel
-- | Extra arguments to configure
[configConfigureArgs] :: ConfigFlags -> [String]
-- | Enable optimization.
[configOptimization] :: ConfigFlags -> Flag OptimisationLevel
-- | Installed executable prefix.
[configProgPrefix] :: ConfigFlags -> Flag PathTemplate
-- | Installed executable suffix.
[configProgSuffix] :: ConfigFlags -> Flag PathTemplate
-- | Installation paths
[configInstallDirs] :: ConfigFlags -> InstallDirs (Flag PathTemplate)
[configScratchDir] :: ConfigFlags -> Flag FilePath
-- | path to search for extra libraries
[configExtraLibDirs] :: ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
-- | path to search for extra libraries when linking fully static
-- executables
[configExtraLibDirsStatic] :: ConfigFlags -> [SymbolicPath Pkg ('Dir Lib)]
-- | path to search for extra frameworks (OS X only)
[configExtraFrameworkDirs] :: ConfigFlags -> [SymbolicPath Pkg ('Dir Framework)]
-- | path to search for header files
[configExtraIncludeDirs] :: ConfigFlags -> [SymbolicPath Pkg ('Dir Include)]
-- | explicit IPID to be used
[configIPID] :: ConfigFlags -> Flag String
-- | explicit CID to be used
[configCID] :: ConfigFlags -> Flag ComponentId
-- | be as deterministic as possible (e.g., invariant over GHC, database,
-- etc). Used by the test suite
[configDeterministic] :: ConfigFlags -> Flag Bool
-- | The --user/--global flag
[configUserInstall] :: ConfigFlags -> Flag Bool
-- | Which package DBs to use
[configPackageDBs] :: ConfigFlags -> [Maybe PackageDB]
-- | Enable compiling library for GHCi
[configGHCiLib] :: ConfigFlags -> Flag Bool
-- | Enable -split-sections with GHC
[configSplitSections] :: ConfigFlags -> Flag Bool
-- | Enable -split-objs with GHC
[configSplitObjs] :: ConfigFlags -> Flag Bool
-- | Enable executable stripping
[configStripExes] :: ConfigFlags -> Flag Bool
-- | Enable library stripping
[configStripLibs] :: ConfigFlags -> Flag Bool
-- | Additional constraints for dependencies.
[configConstraints] :: ConfigFlags -> [PackageVersionConstraint]
-- | The packages depended on which already exist
[configDependencies] :: ConfigFlags -> [GivenComponent]
-- | The packages depended on which doesn't yet exist (i.e. promised).
-- Promising dependencies enables us to configure components in parallel,
-- and avoids expensive builds if they are not necessary. For example, in
-- multi-repl mode, we don't want to build dependencies that are loaded
-- into the interactive session, since we have to build them again.
[configPromisedDependencies] :: ConfigFlags -> [PromisedComponent]
-- | The requested Backpack instantiation. If empty, either this package
-- does not use Backpack, or we just want to typecheck the indefinite
-- package.
[configInstantiateWith] :: ConfigFlags -> [(ModuleName, Module)]
[configConfigurationsFlags] :: ConfigFlags -> FlagAssignment
-- | Enable test suite compilation
[configTests] :: ConfigFlags -> Flag Bool
-- | Enable benchmark compilation
[configBenchmarks] :: ConfigFlags -> Flag Bool
-- | Enable program coverage
[configCoverage] :: ConfigFlags -> Flag Bool
-- | Enable program coverage (deprecated)
[configLibCoverage] :: ConfigFlags -> Flag Bool
-- | All direct dependencies and flags are provided on the command line by
-- the user via the '--dependency' and '--flags' options.
[configExactConfiguration] :: ConfigFlags -> Flag Bool
-- | Halt and show an error message indicating an error in flag assignment
[configFlagError] :: ConfigFlags -> Flag String
-- | Enable relocatable package built
[configRelocatable] :: ConfigFlags -> Flag Bool
-- | Emit debug info.
[configDebugInfo] :: ConfigFlags -> Flag DebugInfoLevel
-- | Should we dump available build information on build? Dump build
-- information to disk before attempting to build, tooling can parse
-- these files and use them to compile the source files themselves.
[configDumpBuildInfo] :: ConfigFlags -> Flag DumpBuildInfo
-- | Whether to use response files at all. They're used for such tools as
-- haddock, or ld.
[configUseResponseFiles] :: ConfigFlags -> Flag Bool
-- | Allow depending on private sublibraries. This is used by external
-- tools (like cabal-install) so they can add multiple-public-libraries
-- compatibility to older ghcs by checking visibility externally.
[configAllowDependingOnPrivateLibs] :: ConfigFlags -> Flag Bool
-- | The list of libraries to be included in the hpc coverage report for
-- testsuites run with --enable-coverage. Notably, this list
-- must exclude indefinite libraries and instantiations because HPC does
-- not support backpack (Nov. 2023).
[configCoverageFor] :: ConfigFlags -> Flag [UnitId]
-- | When this flag is set, all tools declared in `build-tool`s and
-- `build-tool-depends` will be ignored. This allows a Cabal package with
-- build-tool-dependencies to be built even if the tool is not found.
[configIgnoreBuildTools] :: ConfigFlags -> Flag Bool
pattern ConfigCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> ConfigFlags
data () => BuildFlags
BuildFlags :: !CommonSetupFlags -> [(String, FilePath)] -> [(String, [String])] -> Flag (Maybe Int) -> Flag String -> BuildFlags
[buildCommonFlags] :: BuildFlags -> !CommonSetupFlags
[buildProgramPaths] :: BuildFlags -> [(String, FilePath)]
[buildProgramArgs] :: BuildFlags -> [(String, [String])]
[buildNumJobs] :: BuildFlags -> Flag (Maybe Int)
[buildUseSemaphore] :: BuildFlags -> Flag String
pattern BuildCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> BuildFlags
data () => ReplFlags
ReplFlags :: !CommonSetupFlags -> [(String, FilePath)] -> [(String, [String])] -> Flag Bool -> ReplOptions -> ReplFlags
[replCommonFlags] :: ReplFlags -> !CommonSetupFlags
[replProgramPaths] :: ReplFlags -> [(String, FilePath)]
[replProgramArgs] :: ReplFlags -> [(String, [String])]
[replReload] :: ReplFlags -> Flag Bool
[replReplOptions] :: ReplFlags -> ReplOptions
pattern ReplCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> ReplFlags
data () => HaddockFlags
HaddockFlags :: !CommonSetupFlags -> [(String, FilePath)] -> [(String, [String])] -> Flag Bool -> Flag Bool -> Flag String -> Flag HaddockTarget -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag FilePath -> Flag PathTemplate -> Flag PathTemplate -> Flag Bool -> Flag String -> Flag String -> Flag FilePath -> Flag Bool -> HaddockFlags
[haddockCommonFlags] :: HaddockFlags -> !CommonSetupFlags
[haddockProgramPaths] :: HaddockFlags -> [(String, FilePath)]
[haddockProgramArgs] :: HaddockFlags -> [(String, [String])]
[haddockHoogle] :: HaddockFlags -> Flag Bool
[haddockHtml] :: HaddockFlags -> Flag Bool
[haddockHtmlLocation] :: HaddockFlags -> Flag String
[haddockForHackage] :: HaddockFlags -> Flag HaddockTarget
[haddockExecutables] :: HaddockFlags -> Flag Bool
[haddockTestSuites] :: HaddockFlags -> Flag Bool
[haddockBenchmarks] :: HaddockFlags -> Flag Bool
[haddockForeignLibs] :: HaddockFlags -> Flag Bool
[haddockInternal] :: HaddockFlags -> Flag Bool
[haddockCss] :: HaddockFlags -> Flag FilePath
[haddockLinkedSource] :: HaddockFlags -> Flag Bool
[haddockQuickJump] :: HaddockFlags -> Flag Bool
[haddockHscolourCss] :: HaddockFlags -> Flag FilePath
[haddockContents] :: HaddockFlags -> Flag PathTemplate
[haddockIndex] :: HaddockFlags -> Flag PathTemplate
[haddockKeepTempFiles] :: HaddockFlags -> Flag Bool
[haddockBaseUrl] :: HaddockFlags -> Flag String
[haddockResourcesDir] :: HaddockFlags -> Flag String
[haddockOutputDir] :: HaddockFlags -> Flag FilePath
[haddockUseUnicode] :: HaddockFlags -> Flag Bool
pattern HaddockCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> HaddockFlags
data () => HscolourFlags
HscolourFlags :: !CommonSetupFlags -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> HscolourFlags
[hscolourCommonFlags] :: HscolourFlags -> !CommonSetupFlags
[hscolourCSS] :: HscolourFlags -> Flag FilePath
[hscolourExecutables] :: HscolourFlags -> Flag Bool
[hscolourTestSuites] :: HscolourFlags -> Flag Bool
[hscolourBenchmarks] :: HscolourFlags -> Flag Bool
[hscolourForeignLibs] :: HscolourFlags -> Flag Bool
pattern HscolourCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> HscolourFlags
-- | Flags to copy: (destdir, copy-prefix (backwards compat),
-- verbosity)
data () => CopyFlags
CopyFlags :: !CommonSetupFlags -> Flag CopyDest -> CopyFlags
[copyCommonFlags] :: CopyFlags -> !CommonSetupFlags
[copyDest] :: CopyFlags -> Flag CopyDest
pattern CopyCommonFlags :: Flag Verbosity -> Flag (SymbolicPath Pkg ('Dir Dist)) -> Flag (SymbolicPath CWD ('Dir Pkg)) -> Flag (SymbolicPath Pkg 'File) -> [String] -> CopyFlags
-- | Install the files specified by the given glob pattern.
installFileGlob :: Verbosity -> CabalSpecVersion -> Maybe (SymbolicPath CWD ('Dir Pkg)) -> (Maybe (SymbolicPath CWD ('Dir DataDir)), SymbolicPath Pkg ('Dir DataDir)) -> RelativePath DataDir 'File -> IO ()
-- | Represents a program which can be configured.
--
-- Note: rather than constructing this directly, start with
-- simpleProgram and override any extra fields.
data () => Program
Program :: String -> (Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))) -> (Verbosity -> FilePath -> IO (Maybe Version)) -> (Verbosity -> ConfiguredProgram -> IO ConfiguredProgram) -> (Maybe Version -> PackageDescription -> [String] -> [String]) -> Program
-- | The simple name of the program, eg. ghc
[programName] :: Program -> String
-- | A function to search for the program if its location was not specified
-- by the user. Usually this will just be a call to
-- findProgramOnSearchPath.
--
-- It is supplied with the prevailing search path which will typically
-- just be used as-is, but can be extended or ignored as needed.
--
-- For the purpose of change monitoring, in addition to the location
-- where the program was found, it returns all the other places that were
-- tried.
[programFindLocation] :: Program -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))
-- | Try to find the version of the program. For many programs this is not
-- possible or is not necessary so it's OK to return Nothing.
[programFindVersion] :: Program -> Verbosity -> FilePath -> IO (Maybe Version)
-- | A function to do any additional configuration after we have located
-- the program (and perhaps identified its version). For example it could
-- add args, or environment vars.
[programPostConf] :: Program -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
-- | A function that filters any arguments that don't impact the output
-- from a commandline. Used to limit the volatility of dependency hashes
-- when using new-build.
[programNormaliseArgs] :: Program -> Maybe Version -> PackageDescription -> [String] -> [String]
-- | 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.
data () => ConfiguredProgram
ConfiguredProgram :: String -> Maybe Version -> [String] -> [String] -> [(String, Maybe String)] -> Map String String -> ProgramLocation -> [FilePath] -> ConfiguredProgram
-- | Just the name again
[programId] :: ConfiguredProgram -> String
-- | The version of this program, if it is known.
[programVersion] :: ConfiguredProgram -> Maybe Version
-- | Default command-line args for this program. These flags will appear
-- first on the command line, so they can be overridden by subsequent
-- flags.
[programDefaultArgs] :: ConfiguredProgram -> [String]
-- | Override command-line args for this program. These flags will appear
-- last on the command line, so they override all earlier flags.
[programOverrideArgs] :: ConfiguredProgram -> [String]
-- | Override environment variables for this program. These env vars will
-- extend/override the prevailing environment of the current to form the
-- environment for the new process.
[programOverrideEnv] :: ConfiguredProgram -> [(String, Maybe String)]
-- | A key-value map listing various properties of the program, useful for
-- feature detection. Populated during the configuration step, key names
-- depend on the specific program.
[programProperties] :: ConfiguredProgram -> Map String String
-- | Location of the program. eg. /usr/bin/ghc-6.4
[programLocation] :: ConfiguredProgram -> ProgramLocation
-- | In addition to the programLocation where the program was found,
-- these are additional locations that were looked at. The combination of
-- ths found location and these not-found locations can be used to
-- monitor to detect when the re-configuring the program might give a
-- different result (e.g. found in a different location).
[programMonitorFiles] :: ConfiguredProgram -> [FilePath]
type ProgArg = String
-- | 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.
data () => ProgramLocation
-- | The user gave the path to this program, eg.
-- --ghc-path=/usr/bin/ghc-6.6
UserSpecified :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath
-- | The program was found automatically.
FoundOnSystem :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath
-- | 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.
data () => ProgramDb
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
-- | 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.
configureUnconfiguredProgram :: Verbosity -> Program -> ProgramDb -> IO (Maybe ConfiguredProgram)
-- | 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 ... }
--
simpleProgram :: String -> Program
data () => Verbosity
data () => Compiler
Compiler :: CompilerId -> AbiTag -> [CompilerId] -> [(Language, CompilerFlag)] -> [(Extension, Maybe CompilerFlag)] -> Map String String -> Compiler
-- | Compiler flavour and version.
[compilerId] :: Compiler -> CompilerId
-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerAbiTag] :: Compiler -> AbiTag
-- | Other implementations that this compiler claims to be compatible with.
[compilerCompat] :: Compiler -> [CompilerId]
-- | Supported language standards.
[compilerLanguages] :: Compiler -> [(Language, CompilerFlag)]
-- | Supported extensions.
[compilerExtensions] :: Compiler -> [(Extension, Maybe CompilerFlag)]
-- | A key-value map for properties not covered by the above fields.
[compilerProperties] :: Compiler -> Map String String
data () => Platform
Platform :: Arch -> OS -> Platform
-- | 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.
newtype () => Suffix
Suffix :: String -> Suffix
-- | LocalBuildConfig contains options that can be controlled by the
-- user and serve as inputs to the configuration of a package.
data () => LocalBuildConfig
-- | Data cached after configuration step. See also ConfigFlags.
data () => LocalBuildInfo
-- | PackageBuildDescr contains the information Cabal determines
-- after performing package-wide configuration of a package, before doing
-- any per-component configuration.
data () => PackageBuildDescr
-- | 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.
data () => PackageDescription
PackageDescription :: CabalSpecVersion -> PackageIdentifier -> Either License License -> [RelativePath Pkg 'File] -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> [(CompilerFlavor, VersionRange)] -> !ShortText -> !ShortText -> !ShortText -> [SourceRepo] -> !ShortText -> !ShortText -> !ShortText -> [(String, String)] -> Maybe BuildType -> Maybe SetupBuildInfo -> Maybe Library -> [Library] -> [Executable] -> [ForeignLib] -> [TestSuite] -> [Benchmark] -> [RelativePath DataDir 'File] -> SymbolicPath Pkg ('Dir DataDir) -> [RelativePath Pkg 'File] -> [RelativePath Pkg 'File] -> [RelativePath Pkg 'File] -> [RelativePath Pkg 'File] -> PackageDescription
-- | The version of the Cabal spec that this package description uses.
[specVersion] :: PackageDescription -> CabalSpecVersion
[package] :: PackageDescription -> PackageIdentifier
[licenseRaw] :: PackageDescription -> Either License License
[licenseFiles] :: PackageDescription -> [RelativePath Pkg 'File]
[copyright] :: PackageDescription -> !ShortText
[maintainer] :: PackageDescription -> !ShortText
[author] :: PackageDescription -> !ShortText
[stability] :: PackageDescription -> !ShortText
[testedWith] :: PackageDescription -> [(CompilerFlavor, VersionRange)]
[homepage] :: PackageDescription -> !ShortText
[pkgUrl] :: PackageDescription -> !ShortText
[bugReports] :: PackageDescription -> !ShortText
[sourceRepos] :: PackageDescription -> [SourceRepo]
-- | A one-line summary of this package
[synopsis] :: PackageDescription -> !ShortText
-- | A more verbose description of this package
[description] :: PackageDescription -> !ShortText
[category] :: PackageDescription -> !ShortText
-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsPD] :: PackageDescription -> [(String, String)]
-- | The original build-type value as parsed from the
-- .cabal file without defaulting. See also buildType.
[buildTypeRaw] :: PackageDescription -> Maybe BuildType
[setupBuildInfo] :: PackageDescription -> Maybe SetupBuildInfo
[library] :: PackageDescription -> Maybe Library
[subLibraries] :: PackageDescription -> [Library]
[executables] :: PackageDescription -> [Executable]
[foreignLibs] :: PackageDescription -> [ForeignLib]
[testSuites] :: PackageDescription -> [TestSuite]
[benchmarks] :: PackageDescription -> [Benchmark]
-- | data file globs, relative to data directory
[dataFiles] :: PackageDescription -> [RelativePath DataDir 'File]
-- | data directory (may be absolute, or relative to package)
[dataDir] :: PackageDescription -> SymbolicPath Pkg ('Dir DataDir)
[extraSrcFiles] :: PackageDescription -> [RelativePath Pkg 'File]
[extraTmpFiles] :: PackageDescription -> [RelativePath Pkg 'File]
[extraDocFiles] :: PackageDescription -> [RelativePath Pkg 'File]
[extraFiles] :: PackageDescription -> [RelativePath Pkg 'File]
data () => Component
CLib :: Library -> Component
CFLib :: ForeignLib -> Component
CExe :: Executable -> Component
CTest :: TestSuite -> Component
CBench :: Benchmark -> Component
data () => ComponentName
CLibName :: LibraryName -> ComponentName
CNotLibName :: NotLibComponentName -> ComponentName
pattern CBenchName :: UnqualComponentName -> ComponentName
pattern CTestName :: UnqualComponentName -> ComponentName
pattern CExeName :: UnqualComponentName -> ComponentName
pattern CFLibName :: UnqualComponentName -> ComponentName
componentName :: Component -> ComponentName
data () => BuildInfo
BuildInfo :: Bool -> [LegacyExeDependency] -> [ExeDependency] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [PkgconfigDependency] -> [RelativePath Framework 'File] -> [SymbolicPath Pkg ('Dir Framework)] -> [SymbolicPath Pkg 'File] -> [SymbolicPath Pkg 'File] -> [SymbolicPath Pkg 'File] -> [SymbolicPath Pkg 'File] -> [SymbolicPath Pkg 'File] -> [SymbolicPath Pkg ('Dir Source)] -> [ModuleName] -> [ModuleName] -> [ModuleName] -> Maybe Language -> [Language] -> [Extension] -> [Extension] -> [Extension] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [SymbolicPath Pkg ('Dir Lib)] -> [SymbolicPath Pkg ('Dir Lib)] -> [SymbolicPath Pkg ('Dir Include)] -> [SymbolicPath Include 'File] -> [RelativePath Include 'File] -> [RelativePath Include 'File] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> [(String, String)] -> [Dependency] -> [Mixin] -> BuildInfo
-- | component is buildable here
[buildable] :: BuildInfo -> Bool
-- | Tools needed to build this bit.
--
-- This is a legacy field that buildToolDepends largely
-- supersedes.
--
-- Unless use are very sure what you are doing, use the functions in
-- Distribution.Simple.BuildToolDepends rather than accessing this
-- field directly.
[buildTools] :: BuildInfo -> [LegacyExeDependency]
-- | Haskell tools needed to build this bit
--
-- This field is better than buildTools because it allows one to
-- precisely specify an executable in a package.
--
-- Unless use are very sure what you are doing, use the functions in
-- Distribution.Simple.BuildToolDepends rather than accessing this
-- field directly.
[buildToolDepends] :: BuildInfo -> [ExeDependency]
-- | options for pre-processing Haskell code
[cppOptions] :: BuildInfo -> [String]
-- | options for assembler
[asmOptions] :: BuildInfo -> [String]
-- | options for C-- compiler
[cmmOptions] :: BuildInfo -> [String]
-- | options for C compiler
[ccOptions] :: BuildInfo -> [String]
-- | options for C++ compiler
[cxxOptions] :: BuildInfo -> [String]
-- | options for linker
[ldOptions] :: BuildInfo -> [String]
-- | options for hsc2hs
[hsc2hsOptions] :: BuildInfo -> [String]
-- | pkg-config packages that are used
[pkgconfigDepends] :: BuildInfo -> [PkgconfigDependency]
-- | support frameworks for Mac OS X
[frameworks] :: BuildInfo -> [RelativePath Framework 'File]
-- | extra locations to find frameworks.
[extraFrameworkDirs] :: BuildInfo -> [SymbolicPath Pkg ('Dir Framework)]
-- | Assembly files.
[asmSources] :: BuildInfo -> [SymbolicPath Pkg 'File]
-- | C-- files.
[cmmSources] :: BuildInfo -> [SymbolicPath Pkg 'File]
[cSources] :: BuildInfo -> [SymbolicPath Pkg 'File]
[cxxSources] :: BuildInfo -> [SymbolicPath Pkg 'File]
[jsSources] :: BuildInfo -> [SymbolicPath Pkg 'File]
-- | where to look for the Haskell module hierarchy
[hsSourceDirs] :: BuildInfo -> [SymbolicPath Pkg ('Dir Source)]
-- | non-exposed or non-main modules
[otherModules] :: BuildInfo -> [ModuleName]
-- | exposed modules that do not have a source file (e.g. GHC.Prim
-- from ghc-prim package)
[virtualModules] :: BuildInfo -> [ModuleName]
-- | not present on sdist, Paths_* or user-generated with a custom Setup.hs
[autogenModules] :: BuildInfo -> [ModuleName]
-- | language used when not explicitly specified
[defaultLanguage] :: BuildInfo -> Maybe Language
-- | other languages used within the package
[otherLanguages] :: BuildInfo -> [Language]
-- | language extensions used by all modules
[defaultExtensions] :: BuildInfo -> [Extension]
-- | other language extensions used within the package
[otherExtensions] :: BuildInfo -> [Extension]
-- | the old extensions field, treated same as defaultExtensions
[oldExtensions] :: BuildInfo -> [Extension]
-- | what libraries to link with when compiling a program that uses your
-- package
[extraLibs] :: BuildInfo -> [String]
-- | what libraries to link with when compiling a program fully statically
-- that uses your package
[extraLibsStatic] :: BuildInfo -> [String]
-- | if present, overrides extraLibs when package is loaded with GHCi.
[extraGHCiLibs] :: BuildInfo -> [String]
-- | if present, adds libs to hs-libraries, which become part of the
-- package. Example 1: the Cffi library shipping with the rts, alongside
-- the HSrts-1.0.a,.o,... Example 2: a library that is being built by a
-- foreign tool (e.g. rust) and copied and registered together with this
-- library. The logic on how this library is built will have to be
-- encoded in a custom Setup for now. Otherwise cabal would need to learn
-- how to call arbitrary library builders.
[extraBundledLibs] :: BuildInfo -> [String]
-- | Hidden Flag. This set of strings, will be appended to all libraries
-- when copying. E.g. [libHSname_flavour | flavour <-
-- extraLibFlavours]. This should only be needed in very specific cases,
-- e.g. the rts package, where there are multiple copies of
-- slightly differently built libs.
[extraLibFlavours] :: BuildInfo -> [String]
-- | Hidden Flag. This set of strings will be appended to all
-- dynamic libraries when copying. This is particularly useful
-- with the rts package, where we want different dynamic
-- flavours of the RTS library to be installed.
[extraDynLibFlavours] :: BuildInfo -> [String]
[extraLibDirs] :: BuildInfo -> [SymbolicPath Pkg ('Dir Lib)]
[extraLibDirsStatic] :: BuildInfo -> [SymbolicPath Pkg ('Dir Lib)]
-- | directories to find .h files
[includeDirs] :: BuildInfo -> [SymbolicPath Pkg ('Dir Include)]
-- | The .h files to be found in includeDirs
[includes] :: BuildInfo -> [SymbolicPath Include 'File]
-- | The .h files to be generated (e.g. by autoconf)
[autogenIncludes] :: BuildInfo -> [RelativePath Include 'File]
-- | .h files to install with the package
[installIncludes] :: BuildInfo -> [RelativePath Include 'File]
[options] :: BuildInfo -> PerCompilerFlavor [String]
[profOptions] :: BuildInfo -> PerCompilerFlavor [String]
[sharedOptions] :: BuildInfo -> PerCompilerFlavor [String]
[profSharedOptions] :: BuildInfo -> PerCompilerFlavor [String]
[staticOptions] :: BuildInfo -> PerCompilerFlavor [String]
-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsBI] :: BuildInfo -> [(String, String)]
-- | Dependencies specific to a library or executable target
[targetBuildDepends] :: BuildInfo -> [Dependency]
[mixins] :: BuildInfo -> [Mixin]
emptyBuildInfo :: BuildInfo
-- | 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.
data () => TargetInfo
TargetInfo :: ComponentLocalBuildInfo -> Component -> TargetInfo
[targetCLBI] :: TargetInfo -> ComponentLocalBuildInfo
[targetComponent] :: TargetInfo -> Component
-- | The first five fields are common across all algebraic variants.
data () => ComponentLocalBuildInfo
LibComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> Bool -> [(ModuleName, OpenModule)] -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> String -> MungedPackageName -> [ExposedModule] -> Bool -> ComponentLocalBuildInfo
-- | It would be very convenient to store the literal Library here, but if
-- we do that, it will get serialized (via the Binary) instance twice. So
-- instead we just provide the ComponentName, which can be used to find
-- the Component in the PackageDescription. NB: eventually, this will NOT
-- uniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName
-- | The computed ComponentId of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId
-- | The computed UnitId which uniquely identifies this component.
-- Might be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId
-- | Is this an indefinite component (i.e. has unfilled holes)?
[componentIsIndefinite_] :: ComponentLocalBuildInfo -> Bool
-- | How the component was instantiated
[componentInstantiatedWith] :: ComponentLocalBuildInfo -> [(ModuleName, OpenModule)]
-- | Resolved internal and external package dependencies for this
-- component. The BuildInfo specifies a set of build
-- dependencies that must be satisfied in terms of version ranges. This
-- field fixes those dependencies to the specific versions available on
-- this machine for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]
-- | The set of packages that are brought into scope during compilation,
-- including a ModuleRenaming which may used to hide or rename
-- modules. This is what gets translated into -package-id
-- arguments. This is a modernized version of
-- componentPackageDeps, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]
-- | The internal dependencies which induce a graph on the
-- ComponentLocalBuildInfo of this package. This does NOT coincide
-- with componentPackageDeps because it ALSO records 'build-tool'
-- dependencies on executables. Maybe one day cabal-install will
-- also handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
-- | Compatibility "package key" that we pass to older versions of GHC.
[componentCompatPackageKey] :: ComponentLocalBuildInfo -> String
-- | Compatibility "package name" that we register this component as.
[componentCompatPackageName] :: ComponentLocalBuildInfo -> MungedPackageName
-- | A list of exposed modules (either defined in this component, or
-- reexported from another component.)
[componentExposedModules] :: ComponentLocalBuildInfo -> [ExposedModule]
-- | Convenience field, specifying whether or not this is the "public
-- library" that has the same name as the package.
[componentIsPublic] :: ComponentLocalBuildInfo -> Bool
FLibComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo
-- | It would be very convenient to store the literal Library here, but if
-- we do that, it will get serialized (via the Binary) instance twice. So
-- instead we just provide the ComponentName, which can be used to find
-- the Component in the PackageDescription. NB: eventually, this will NOT
-- uniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName
-- | The computed ComponentId of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId
-- | The computed UnitId which uniquely identifies this component.
-- Might be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId
-- | Resolved internal and external package dependencies for this
-- component. The BuildInfo specifies a set of build
-- dependencies that must be satisfied in terms of version ranges. This
-- field fixes those dependencies to the specific versions available on
-- this machine for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]
-- | The set of packages that are brought into scope during compilation,
-- including a ModuleRenaming which may used to hide or rename
-- modules. This is what gets translated into -package-id
-- arguments. This is a modernized version of
-- componentPackageDeps, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]
-- | The internal dependencies which induce a graph on the
-- ComponentLocalBuildInfo of this package. This does NOT coincide
-- with componentPackageDeps because it ALSO records 'build-tool'
-- dependencies on executables. Maybe one day cabal-install will
-- also handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
ExeComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo
-- | It would be very convenient to store the literal Library here, but if
-- we do that, it will get serialized (via the Binary) instance twice. So
-- instead we just provide the ComponentName, which can be used to find
-- the Component in the PackageDescription. NB: eventually, this will NOT
-- uniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName
-- | The computed ComponentId of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId
-- | The computed UnitId which uniquely identifies this component.
-- Might be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId
-- | Resolved internal and external package dependencies for this
-- component. The BuildInfo specifies a set of build
-- dependencies that must be satisfied in terms of version ranges. This
-- field fixes those dependencies to the specific versions available on
-- this machine for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]
-- | The set of packages that are brought into scope during compilation,
-- including a ModuleRenaming which may used to hide or rename
-- modules. This is what gets translated into -package-id
-- arguments. This is a modernized version of
-- componentPackageDeps, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]
-- | The internal dependencies which induce a graph on the
-- ComponentLocalBuildInfo of this package. This does NOT coincide
-- with componentPackageDeps because it ALSO records 'build-tool'
-- dependencies on executables. Maybe one day cabal-install will
-- also handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
TestComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo
-- | It would be very convenient to store the literal Library here, but if
-- we do that, it will get serialized (via the Binary) instance twice. So
-- instead we just provide the ComponentName, which can be used to find
-- the Component in the PackageDescription. NB: eventually, this will NOT
-- uniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName
-- | The computed ComponentId of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId
-- | The computed UnitId which uniquely identifies this component.
-- Might be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId
-- | Resolved internal and external package dependencies for this
-- component. The BuildInfo specifies a set of build
-- dependencies that must be satisfied in terms of version ranges. This
-- field fixes those dependencies to the specific versions available on
-- this machine for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]
-- | The set of packages that are brought into scope during compilation,
-- including a ModuleRenaming which may used to hide or rename
-- modules. This is what gets translated into -package-id
-- arguments. This is a modernized version of
-- componentPackageDeps, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]
-- | The internal dependencies which induce a graph on the
-- ComponentLocalBuildInfo of this package. This does NOT coincide
-- with componentPackageDeps because it ALSO records 'build-tool'
-- dependencies on executables. Maybe one day cabal-install will
-- also handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
BenchComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo
-- | It would be very convenient to store the literal Library here, but if
-- we do that, it will get serialized (via the Binary) instance twice. So
-- instead we just provide the ComponentName, which can be used to find
-- the Component in the PackageDescription. NB: eventually, this will NOT
-- uniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName
-- | The computed ComponentId of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId
-- | The computed UnitId which uniquely identifies this component.
-- Might be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId
-- | Resolved internal and external package dependencies for this
-- component. The BuildInfo specifies a set of build
-- dependencies that must be satisfied in terms of version ranges. This
-- field fixes those dependencies to the specific versions available on
-- this machine for this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]
-- | The set of packages that are brought into scope during compilation,
-- including a ModuleRenaming which may used to hide or rename
-- modules. This is what gets translated into -package-id
-- arguments. This is a modernized version of
-- componentPackageDeps, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]
-- | The internal dependencies which induce a graph on the
-- ComponentLocalBuildInfo of this package. This does NOT coincide
-- with componentPackageDeps because it ALSO records 'build-tool'
-- dependencies on executables. Maybe one day cabal-install will
-- also handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
data () => Library
Library :: LibraryName -> [ModuleName] -> [ModuleReexport] -> [ModuleName] -> Bool -> LibraryVisibility -> BuildInfo -> Library
[libName] :: Library -> LibraryName
[exposedModules] :: Library -> [ModuleName]
[reexportedModules] :: Library -> [ModuleReexport]
-- | What sigs need implementations?
[signatures] :: Library -> [ModuleName]
-- | Is the lib to be exposed by default? (i.e. whether its modules
-- available in GHCi for example)
[libExposed] :: Library -> Bool
-- | Whether this multilib can be used as a dependency for other packages.
[libVisibility] :: Library -> LibraryVisibility
[libBuildInfo] :: Library -> BuildInfo
-- | A foreign library stanza is like a library stanza, except that the
-- built code is intended for consumption by a non-Haskell client.
data () => ForeignLib
ForeignLib :: UnqualComponentName -> ForeignLibType -> [ForeignLibOption] -> BuildInfo -> Maybe LibVersionInfo -> Maybe Version -> [RelativePath Source 'File] -> ForeignLib
-- | Name of the foreign library
[foreignLibName] :: ForeignLib -> UnqualComponentName
-- | What kind of foreign library is this (static or dynamic).
[foreignLibType] :: ForeignLib -> ForeignLibType
-- | What options apply to this foreign library (e.g., are we merging in
-- all foreign dependencies.)
[foreignLibOptions] :: ForeignLib -> [ForeignLibOption]
-- | Build information for this foreign library.
[foreignLibBuildInfo] :: ForeignLib -> BuildInfo
-- | Libtool-style version-info data to compute library version. Refer to
-- the libtool documentation on the current:revision:age versioning
-- scheme.
[foreignLibVersionInfo] :: ForeignLib -> Maybe LibVersionInfo
-- | Linux library version
[foreignLibVersionLinux] :: ForeignLib -> Maybe Version
-- | (Windows-specific) module definition files
--
-- This is a list rather than a maybe field so that we can flatten the
-- condition trees (for instance, when creating an sdist)
[foreignLibModDefFile] :: ForeignLib -> [RelativePath Source 'File]
data () => Executable
Executable :: UnqualComponentName -> RelativePath Source 'File -> ExecutableScope -> BuildInfo -> Executable
[exeName] :: Executable -> UnqualComponentName
[modulePath] :: Executable -> RelativePath Source 'File
[exeScope] :: Executable -> ExecutableScope
[buildInfo] :: Executable -> BuildInfo
-- | A "test-suite" stanza in a cabal file.
data () => TestSuite
TestSuite :: UnqualComponentName -> TestSuiteInterface -> BuildInfo -> [String] -> TestSuite
[testName] :: TestSuite -> UnqualComponentName
[testInterface] :: TestSuite -> TestSuiteInterface
[testBuildInfo] :: TestSuite -> BuildInfo
[testCodeGenerators] :: TestSuite -> [String]
-- | A "benchmark" stanza in a cabal file.
data () => Benchmark
Benchmark :: UnqualComponentName -> BenchmarkInterface -> BuildInfo -> Benchmark
[benchmarkName] :: Benchmark -> UnqualComponentName
[benchmarkInterface] :: Benchmark -> BenchmarkInterface
[benchmarkBuildInfo] :: Benchmark -> BuildInfo
data () => LibraryName
LMainLibName :: LibraryName
LSubLibName :: UnqualComponentName -> LibraryName
emptyLibrary :: Library
-- | An empty foreign library.
emptyForeignLib :: ForeignLib
emptyExecutable :: Executable
emptyTestSuite :: TestSuite
emptyBenchmark :: Benchmark