-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | User-facing API for the Hooks build-type. @package Cabal-hooks @version 3.18 -- | 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 also the introductory how to guide in the Cabal user -- manual. module Distribution.Simple.SetupHooks -- | Hooks into the cabal build phases. -- -- 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 ()
-- | Monad for constructing rules.
type RulesM a = RulesT IO a
type ShortText = Text
-- | 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 ()
type Rule = RuleData 'User
-- | A rule with static dependencies.
--
-- Prefer using this smart constructor instead of Rule whenever
-- possible.
--
-- See also dynamicRule which adds support for dynamic
-- dependencies.
staticRule :: Typeable arg => Command arg (IO ()) -> [Dependency] -> NonEmpty Location -> Rule
-- | A rule with dynamic dependencies, which consists of two parts:
--
-- -- dirGlob/glob --GlobDir :: !GlobPieces -> !Glob -> Glob -- | **/glob, where ** denotes recursively -- traversing all directories and matching filenames on glob. -- -- Note that the glob portion can only match on -- filenames, not paths, so for example **foo*.txt is not -- supported. GlobDirRecursive :: !GlobPieces -> Glob -- | A file glob. GlobFile :: !GlobPieces -> Glob -- | Trailing dir; a glob ending in /. GlobDirTrailing :: Glob -- | A piece of a globbing pattern data GlobPiece -- | A wildcard * WildCard :: GlobPiece -- | A literal string dirABC Literal :: String -> GlobPiece -- | A union of patterns, e.g. dir{a,*.txt,c}... Union :: [GlobPieces] -> GlobPiece data GlobSyntaxError StarInDirectory :: GlobSyntaxError StarInFileName :: GlobSyntaxError StarInExtension :: GlobSyntaxError NoExtensionOnStar :: GlobSyntaxError EmptyGlob :: GlobSyntaxError LiteralFileNameGlobStar :: GlobSyntaxError VersionDoesNotSupportGlobStar :: GlobSyntaxError VersionDoesNotSupportGlob :: GlobSyntaxError parseFileGlob :: CabalSpecVersion -> FilePath -> Either GlobSyntaxError Glob -- | Extract the matches from a list of GlobResults. -- -- Note: throws away the GlobMissingDirectory results; chances are -- that you want to check for these and error out if any are present. globMatches :: [GlobResult a] -> [a] -- | Match files against a pre-parsed glob, starting in a directory. -- -- The Version argument must be the spec version of the package -- description being processed, as globs behave slightly differently in -- different spec versions. -- -- The FilePath argument is the directory that the glob is -- relative to. It must be a valid directory (and hence it can't be the -- empty string). The returned values will not include this prefix. runDirFileGlob :: Verbosity -> Maybe CabalSpecVersion -> FilePath -> Glob -> IO [GlobResult FilePath] -- | Commands to execute a rule: -- --
-- decode . encode == id ---- -- That is, the get and put methods should be the inverse -- of each other. A range of instances are provided for basic Haskell -- types. class Binary t -- | Declare additional monitored objects for the collection of all rules. -- -- When these monitored objects change, the rules are re-computed. -- -- See also findAndMonitorDirFileGlob which combines the search -- and the monitoring. addRuleMonitors :: forall (m :: Type -> Type). Monad m => [MonitorFilePath] -> RulesT m () -- | Monitor a single directory for changes, based on its modification -- time. The monitored directory is considered to have changed if it no -- longer exists or if its modification time has changed. monitorDirectory :: FilePath -> MonitorFilePath -- | Monitor a single directory for existence. The monitored directory is -- considered to have changed only if it no longer exists. monitorDirectoryExistence :: FilePath -> MonitorFilePath -- | Monitor a single file for changes, based on its modification time. The -- monitored file is considered to have changed if it no longer exists or -- if its modification time has changed. monitorFile :: FilePath -> MonitorFilePath -- | Monitor a single file for existence only. The monitored file is -- considered to have changed if it no longer exists. monitorFileExistence :: FilePath -> MonitorFilePath -- | Monitor a set of files (or directories) identified by a file glob. The -- monitored glob is considered to have changed if the set of files -- matching the glob changes (i.e. creations or deletions), or for files -- if the modification time and content hash of any matching file has -- changed. monitorFileGlob :: RootedGlob -> MonitorFilePath -- | Monitor a set of files (or directories) identified by a file glob for -- existence only. The monitored glob is considered to have changed if -- the set of files matching the glob changes (i.e. creations or -- deletions). monitorFileGlobExistence :: RootedGlob -> MonitorFilePath -- | Monitor a single file for changes, based on its modification time and -- content hash. The monitored file is considered to have changed if it -- no longer exists or if its modification time and content hash have -- changed. monitorFileHashed :: FilePath -> MonitorFilePath -- | Similar to monitorFileSearchPath, but also instructs us to -- monitor the hash of the found file. monitorFileHashedSearchPath :: [FilePath] -> FilePath -> [MonitorFilePath] -- | Monitor a single file or directory for changes, based on its -- modification time. The monitored file is considered to have changed if -- it no longer exists or if its modification time has changed. monitorFileOrDirectory :: FilePath -> MonitorFilePath -- | Creates a list of files to monitor when you search for a file which -- unsuccessfully looked in notFoundAtPaths before finding it at -- foundAtPath. monitorFileSearchPath :: [FilePath] -> FilePath -> [MonitorFilePath] -- | Monitor a single non-existent directory for changes. The monitored -- directory is considered to have changed if it exists. monitorNonExistentDirectory :: FilePath -> MonitorFilePath -- | Monitor a single non-existent file for changes. The monitored file is -- considered to have changed if it exists. monitorNonExistentFile :: FilePath -> MonitorFilePath data FilePathRoot FilePathRelative :: FilePathRoot -- | e.g. "/", "c:" or result of takeDrive FilePathRoot :: FilePath -> FilePathRoot FilePathHomeDir :: FilePathRoot -- | A description of a file (or set of files) to monitor for changes. -- -- Where file paths are relative they are relative to a common directory -- (e.g. project root), not necessarily the process current directory. data MonitorFilePath MonitorFile :: !MonitorKindFile -> !MonitorKindDir -> !FilePath -> MonitorFilePath [monitorKindFile] :: MonitorFilePath -> !MonitorKindFile [monitorKindDir] :: MonitorFilePath -> !MonitorKindDir [monitorPath] :: MonitorFilePath -> !FilePath MonitorFileGlob :: !MonitorKindFile -> !MonitorKindDir -> !RootedGlob -> MonitorFilePath [monitorKindFile] :: MonitorFilePath -> !MonitorKindFile [monitorKindDir] :: MonitorFilePath -> !MonitorKindDir [monitorPathGlob] :: MonitorFilePath -> !RootedGlob data MonitorKindDir DirExists :: MonitorKindDir DirModTime :: MonitorKindDir DirNotExists :: MonitorKindDir data MonitorKindFile FileExists :: MonitorKindFile FileModTime :: MonitorKindFile FileHashed :: MonitorKindFile FileNotExists :: MonitorKindFile -- | A file path specified by globbing, relative to some root directory. data RootedGlob RootedGlob :: FilePathRoot -> Glob -> RootedGlob -- | Copy/install hooks. data InstallHooks InstallHooks :: Maybe InstallComponentHook -> InstallHooks -- | Per-component install hook. [installComponentHook] :: InstallHooks -> Maybe InstallComponentHook -- | Empty copy/install hooks. noInstallHooks :: InstallHooks data InstallComponentInputs InstallComponentInputs :: CopyFlags -> LocalBuildInfo -> TargetInfo -> InstallComponentInputs [copyFlags] :: InstallComponentInputs -> CopyFlags [localBuildInfo] :: InstallComponentInputs -> LocalBuildInfo [targetInfo] :: 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 -> Maybe (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 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 -> Maybe (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 -- | Build bytecode library [configBytecodeLib] :: 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 VerbosityFlags -> 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 VerbosityFlags -> 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 VerbosityFlags -> 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 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 [haddockBaseUrl] :: HaddockFlags -> Flag String [haddockResourcesDir] :: HaddockFlags -> Flag String [haddockOutputDir] :: HaddockFlags -> Flag FilePath [haddockUseUnicode] :: HaddockFlags -> Flag Bool pattern HaddockCommonFlags :: Flag VerbosityFlags -> 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 VerbosityFlags -> 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 VerbosityFlags -> 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 -- this 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) -- | Try to find a configured program lookupProgram :: Program -> ProgramDb -> Maybe ConfiguredProgram -- | Try to find a configured program lookupProgramByName :: String -> ProgramDb -> 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
-- | Runs the given configured program.
runProgramCwd :: Verbosity -> Maybe (SymbolicPath CWD ('Dir to)) -> ConfiguredProgram -> [ProgArg] -> IO ()
-- | Non fatal conditions that may be indicative of an error or problem.
--
-- We display these at the normal verbosity level.
warn :: Verbosity -> String -> IO ()
-- | Same as createDirectoryIfMissing but logs at higher verbosity
-- levels.
createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO ()
-- | Write a file but only if it would have new content. If we would be
-- writing the same as the existing content then leave the file as is so
-- that we do not update the file's modification time.
--
-- NB: Before Cabal-3.0 the file content was assumed to be
-- ASCII-representable. Since Cabal-3.0 the file is assumed to be UTF-8
-- encoded.
rewriteFileEx :: Verbosity -> FilePath -> String -> IO ()
data Compiler
Compiler :: CompilerId -> AbiTag -> [CompilerId] -> [(Language, CompilerFlag)] -> [(Extension, Maybe CompilerFlag)] -> Maybe [(PackageName, UnitId)] -> 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)]
-- | UnitIds that the compiler doesn't support reinstalling. For
-- instance, when using GHC plugins, one wants to use the exact same
-- version of the ghc package as the one the compiler was linked
-- against. Nothing indicates that the compiler hasn't supplied
-- this information and that we should act pessimistically.
[compilerWiredInUnitIds] :: Compiler -> Maybe [(PackageName, UnitId)]
-- | 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
-- | Rich verbosity, used for the Cabal library interface.
data Verbosity
-- | Verbosity information which can be passed by the CLI.
data VerbosityFlags
-- | Handles to use for logging (e.g. log to stdout, or log to a file).
data VerbosityHandles
mkVerbosity :: VerbosityHandles -> VerbosityFlags -> Verbosity
defaultVerbosityHandles :: VerbosityHandles
-- | 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]
localPkgDescr :: LocalBuildInfo -> PackageDescription
-- | Retrieve an optional working directory from LocalBuildInfo.
mbWorkDirLBI :: LocalBuildInfo -> Maybe (SymbolicPath CWD ('Dir Pkg))
withPrograms :: LocalBuildInfo -> ProgramDb
-- | Interpret a symbolic path with respect to the working directory stored
-- in LocalBuildInfo.
--
-- Use this before directly interacting with the file system.
--
-- NB: when invoking external programs (such as GHC), it is
-- preferable to set the working directory of the process rather than
-- calling this function, as this function will turn relative paths into
-- absolute paths if the working directory is an absolute path. This can
-- degrade error messages, or worse, break the behaviour entirely
-- (because the program might expect certain paths to be relative).
--
-- See Note [Symbolic paths] in Distribution.Utils.Path
interpretSymbolicPathLBI :: forall (allowAbsolute :: AllowAbsolute) (to :: FileOrDir). LocalBuildInfo -> SymbolicPathX allowAbsolute Pkg to -> FilePath
componentBuildInfo :: Component -> BuildInfo
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 CExeName :: UnqualComponentName -> ComponentName
pattern CFLibName :: UnqualComponentName -> ComponentName
pattern CTestName :: UnqualComponentName -> ComponentName
componentName :: Component -> ComponentName
-- | A valid Haskell module name.
data ModuleName
data BuildInfo
BuildInfo :: Bool -> [LegacyExeDependency] -> [ExeDependency] -> [String] -> [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 pre-processing JavaScript code @since 3.16.0.0
[jsppOptions] :: 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