-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A framework for packaging Haskell software -- -- The Haskell Common Architecture for Building Applications and -- Libraries: a framework defining a common interface for authors to more -- easily build their Haskell applications in a portable way. -- -- The Haskell Cabal is part of a larger infrastructure for distributing, -- organizing, and cataloging Haskell libraries and tools. @package Cabal @version 3.10.2.1 module Distribution.Backpack.FullUnitId data FullUnitId FullUnitId :: ComponentId -> OpenModuleSubst -> FullUnitId type FullDb = DefUnitId -> FullUnitId expandOpenUnitId :: FullDb -> OpenUnitId -> FullUnitId expandUnitId :: FullDb -> DefUnitId -> FullUnitId instance GHC.Generics.Generic Distribution.Backpack.FullUnitId.FullUnitId instance GHC.Show.Show Distribution.Backpack.FullUnitId.FullUnitId -- | A type class ModSubst for objects which can have -- ModuleSubst applied to them. -- -- See also -- https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst module Distribution.Backpack.ModSubst -- | Applying module substitutions to semantic objects. class ModSubst a modSubst :: ModSubst a => OpenModuleSubst -> a -> a instance Distribution.Backpack.ModSubst.ModSubst Distribution.Backpack.OpenModule instance Distribution.Backpack.ModSubst.ModSubst Distribution.Backpack.OpenUnitId instance Distribution.Backpack.ModSubst.ModSubst (Data.Set.Internal.Set Distribution.ModuleName.ModuleName) instance Distribution.Backpack.ModSubst.ModSubst a => Distribution.Backpack.ModSubst.ModSubst (Data.Map.Internal.Map k a) instance Distribution.Backpack.ModSubst.ModSubst a => Distribution.Backpack.ModSubst.ModSubst [a] instance Distribution.Backpack.ModSubst.ModSubst a => Distribution.Backpack.ModSubst.ModSubst (k, a) -- | See -- https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst module Distribution.Backpack.ModuleShape -- | A ModuleShape describes the provisions and requirements of a -- library. We can extract a ModuleShape from an -- InstalledPackageInfo. data ModuleShape ModuleShape :: OpenModuleSubst -> Set ModuleName -> ModuleShape [modShapeProvides] :: ModuleShape -> OpenModuleSubst [modShapeRequires] :: ModuleShape -> Set ModuleName -- | The default module shape, with no provisions and no requirements. emptyModuleShape :: ModuleShape shapeInstalledPackage :: InstalledPackageInfo -> ModuleShape instance GHC.Generics.Generic Distribution.Backpack.ModuleShape.ModuleShape instance GHC.Show.Show Distribution.Backpack.ModuleShape.ModuleShape instance GHC.Classes.Eq Distribution.Backpack.ModuleShape.ModuleShape instance Data.Binary.Class.Binary Distribution.Backpack.ModuleShape.ModuleShape instance Distribution.Utils.Structured.Structured Distribution.Backpack.ModuleShape.ModuleShape instance Distribution.Backpack.ModSubst.ModSubst Distribution.Backpack.ModuleShape.ModuleShape module Distribution.Backpack.PreModuleShape data PreModuleShape PreModuleShape :: Set ModuleName -> Set ModuleName -> PreModuleShape [preModShapeProvides] :: PreModuleShape -> Set ModuleName [preModShapeRequires] :: PreModuleShape -> Set ModuleName toPreModuleShape :: ModuleShape -> PreModuleShape renamePreModuleShape :: PreModuleShape -> IncludeRenaming -> PreModuleShape mixLinkPreModuleShape :: [PreModuleShape] -> PreModuleShape instance GHC.Generics.Generic Distribution.Backpack.PreModuleShape.PreModuleShape instance GHC.Show.Show Distribution.Backpack.PreModuleShape.PreModuleShape instance GHC.Classes.Eq Distribution.Backpack.PreModuleShape.PreModuleShape -- | Deprecated: Use System.Process from package process directly module Distribution.Compat.CreatePipe -- | Create a pipe for interprocess communication and return a -- (readEnd, writeEnd) Handle pair. createPipe :: IO (Handle, Handle) module Distribution.Compat.Directory -- | listDirectory dir returns a list of all entries -- in dir without the special entries (. and -- ..). -- -- The operation may fail with: -- --
-- "png" `isExtensionOf` "/directory/file.png" == True -- ".png" `isExtensionOf` "/directory/file.png" == True -- ".tar.gz" `isExtensionOf` "bar/foo.tar.gz" == True -- "ar.gz" `isExtensionOf` "bar/foo.tar.gz" == False -- "png" `isExtensionOf` "/directory/file.png.jpg" == False -- "csv/table.csv" `isExtensionOf` "/data/csv/table.csv" == False --isExtensionOf :: String -> FilePath -> Bool -- | Drop the given extension from a FilePath, and the "." -- preceding it. Returns Nothing if the FilePath does not have the -- given extension, or Just and the part before the extension if -- it does. -- -- This function can be more predictable than dropExtensions, -- especially if the filename might itself contain . characters. -- --
-- stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x" -- stripExtension "hi.o" "foo.x.hs.o" == Nothing -- dropExtension x == fromJust (stripExtension (takeExtension x) x) -- dropExtensions x == fromJust (stripExtension (takeExtensions x) x) -- stripExtension ".c.d" "a.b.c.d" == Just "a.b" -- stripExtension ".c.d" "a.b..c.d" == Just "a.b." -- stripExtension "baz" "foo.bar" == Nothing -- stripExtension "bar" "foobar" == Nothing -- stripExtension "" x == Just x --stripExtension :: String -> FilePath -> Maybe FilePath -- | This module re-exports the non-exposed -- Distribution.Compat.Prelude module for reuse by -- cabal-install's Distribution.Client.Compat.Prelude -- module. -- -- It is highly discouraged to rely on this module for Setup.hs -- scripts since its API is not stable. -- | Warning: This modules' API is not stable. Use at your own risk, or -- better yet, use base-compat! module Distribution.Compat.Prelude.Internal module Distribution.Compat.Process -- | proc with process jobs enabled when appropriate, and defaulting -- delegate_ctlc to True. proc :: FilePath -> [String] -> CreateProcess -- | Enable process jobs to ensure accurate determination of process -- completion in the presence of exec(3) on Windows. -- -- Unfortunately the process job support is badly broken in -- process releases prior to 1.6.9, so we disable it in these -- versions, despite the fact that this means we may see sporadic build -- failures without jobs. -- -- On Windows 7 or before the jobs are disabled due to the fact that -- processes on these systems can only have one job. This prevents -- spawned process from assigning jobs to its own children. Suppose -- process A spawns process B. The B process has a job assigned (call it -- J1) and when it tries to spawn a new process C the C automatically -- inherits the job. But at it also tries to assign a new job J2 to C -- since it doesn’t have access J1. This fails on Windows 7 or before. enableProcessJobs :: CreateProcess -> CreateProcess module Distribution.Compat.ResponseFile expandResponse :: [String] -> IO [String] module Distribution.Compat.Stack type WithCallStack a = HasCallStack => a -- | CallStacks are a lightweight method of obtaining a partial -- call-stack at any point in the program. -- -- A function can request its call-site with the HasCallStack -- constraint. For example, we can define -- --
-- putStrLnWithCallStack :: HasCallStack => String -> IO () ---- -- as a variant of putStrLn that will get its call-site and -- print it, along with the string given as argument. We can access the -- call-stack inside putStrLnWithCallStack with -- callStack. -- --
-- >>> :{
-- putStrLnWithCallStack :: HasCallStack => String -> IO ()
-- putStrLnWithCallStack msg = do
-- putStrLn msg
-- putStrLn (prettyCallStack callStack)
-- :}
--
--
-- Thus, if we call putStrLnWithCallStack we will get a
-- formatted call-stack alongside our string.
--
-- -- >>> putStrLnWithCallStack "hello" -- hello -- CallStack (from HasCallStack): -- putStrLnWithCallStack, called at <interactive>:... in interactive:Ghci... ---- -- GHC solves HasCallStack constraints in three steps: -- --
-- --ghc-option=foo --ghc-option=bar ---- -- gives us all the values ["foo", "bar"] -- --
-- --enable-foo --disable-foo ---- -- gives us Just False So this Flag type is for the latter singular kind -- of flag. Its monoid instance gives us the behaviour where it starts -- out as NoFlag and later flags override earlier ones. data Flag a Flag :: a -> Flag a NoFlag :: Flag a allFlags :: [Flag Bool] -> Flag Bool toFlag :: a -> Flag a fromFlag :: WithCallStack (Flag a -> a) fromFlagOrDefault :: a -> Flag a -> a flagElim :: b -> (a -> b) -> Flag a -> b flagToMaybe :: Flag a -> Maybe a flagToList :: Flag a -> [a] maybeToFlag :: Maybe a -> Flag a -- | Types that represent boolean flags. class BooleanFlag a asBool :: BooleanFlag a => a -> Bool instance GHC.Read.Read a => GHC.Read.Read (Distribution.Simple.Flag.Flag a) instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.Flag.Flag a) instance GHC.Generics.Generic (Distribution.Simple.Flag.Flag a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Simple.Flag.Flag a) instance Distribution.Simple.Flag.BooleanFlag GHC.Types.Bool instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Simple.Flag.Flag a) instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (Distribution.Simple.Flag.Flag a) instance GHC.Base.Functor Distribution.Simple.Flag.Flag instance GHC.Base.Applicative Distribution.Simple.Flag.Flag instance GHC.Base.Monoid (Distribution.Simple.Flag.Flag a) instance GHC.Base.Semigroup (Distribution.Simple.Flag.Flag a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Distribution.Simple.Flag.Flag a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Distribution.Simple.Flag.Flag a) module Distribution.Simple.InstallDirs.Internal data PathComponent Ordinary :: FilePath -> PathComponent Variable :: PathTemplateVariable -> PathComponent data PathTemplateVariable -- | The $prefix path variable PrefixVar :: PathTemplateVariable -- | The $bindir path variable BindirVar :: PathTemplateVariable -- | The $libdir path variable LibdirVar :: PathTemplateVariable -- | The $libsubdir path variable LibsubdirVar :: PathTemplateVariable -- | The $dynlibdir path variable DynlibdirVar :: PathTemplateVariable -- | The $datadir path variable DatadirVar :: PathTemplateVariable -- | The $datasubdir path variable DatasubdirVar :: PathTemplateVariable -- | The $docdir path variable DocdirVar :: PathTemplateVariable -- | The $htmldir path variable HtmldirVar :: PathTemplateVariable -- | The $pkg package name path variable PkgNameVar :: PathTemplateVariable -- | The $version package version path variable PkgVerVar :: PathTemplateVariable -- | The $pkgid package Id path variable, eg foo-1.0 PkgIdVar :: PathTemplateVariable -- | The $libname path variable LibNameVar :: PathTemplateVariable -- | The compiler name and version, eg ghc-6.6.1 CompilerVar :: PathTemplateVariable -- | The operating system name, eg windows or linux OSVar :: PathTemplateVariable -- | The CPU architecture name, eg i386 or x86_64 ArchVar :: PathTemplateVariable -- | The compiler's ABI identifier, AbiVar :: PathTemplateVariable -- | The optional ABI tag for the compiler AbiTagVar :: PathTemplateVariable -- | The executable name; used in shell wrappers ExecutableNameVar :: PathTemplateVariable -- | The name of the test suite being run TestSuiteNameVar :: PathTemplateVariable -- | The result of the test suite being run, eg pass, -- fail, or error. TestSuiteResultVar :: PathTemplateVariable -- | The name of the benchmark being run BenchmarkNameVar :: PathTemplateVariable instance GHC.Generics.Generic Distribution.Simple.InstallDirs.Internal.PathTemplateVariable instance GHC.Classes.Ord Distribution.Simple.InstallDirs.Internal.PathTemplateVariable instance GHC.Classes.Eq Distribution.Simple.InstallDirs.Internal.PathTemplateVariable instance GHC.Generics.Generic Distribution.Simple.InstallDirs.Internal.PathComponent instance GHC.Classes.Ord Distribution.Simple.InstallDirs.Internal.PathComponent instance GHC.Classes.Eq Distribution.Simple.InstallDirs.Internal.PathComponent instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.Internal.PathComponent instance Distribution.Utils.Structured.Structured Distribution.Simple.InstallDirs.Internal.PathComponent instance GHC.Show.Show Distribution.Simple.InstallDirs.Internal.PathComponent instance GHC.Read.Read Distribution.Simple.InstallDirs.Internal.PathComponent instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.Internal.PathTemplateVariable instance Distribution.Utils.Structured.Structured Distribution.Simple.InstallDirs.Internal.PathTemplateVariable instance GHC.Show.Show Distribution.Simple.InstallDirs.Internal.PathTemplateVariable instance GHC.Read.Read Distribution.Simple.InstallDirs.Internal.PathTemplateVariable -- | This manages everything to do with where files get installed (though -- does not get involved with actually doing any installation). It -- provides an InstallDirs type which is a set of directories for -- where to install things. It also handles the fact that we use -- templates in these install dirs. For example most install dirs are -- relative to some $prefix and by changing the prefix all other -- dirs still end up changed appropriately. So it provides a -- PathTemplate type and functions for substituting for these -- templates. module Distribution.Simple.InstallDirs -- | The directories where we will install files for packages. -- -- We have several different directories for different types of files -- since many systems have conventions whereby different types of files -- in a package are installed in different directories. This is -- particularly the case on Unix style systems. data InstallDirs dir InstallDirs :: dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> InstallDirs dir [prefix] :: InstallDirs dir -> dir [bindir] :: InstallDirs dir -> dir [libdir] :: InstallDirs dir -> dir [libsubdir] :: InstallDirs dir -> dir [dynlibdir] :: InstallDirs dir -> dir -- | foreign libraries [flibdir] :: InstallDirs dir -> dir [libexecdir] :: InstallDirs dir -> dir [libexecsubdir] :: InstallDirs dir -> dir [includedir] :: InstallDirs dir -> dir [datadir] :: InstallDirs dir -> dir [datasubdir] :: InstallDirs dir -> dir [docdir] :: InstallDirs dir -> dir [mandir] :: InstallDirs dir -> dir [htmldir] :: InstallDirs dir -> dir [haddockdir] :: InstallDirs dir -> dir [sysconfdir] :: InstallDirs dir -> dir -- | The installation directories in terms of PathTemplates that -- contain variables. -- -- The defaults for most of the directories are relative to each other, -- in particular they are all relative to a single prefix. This makes it -- convenient for the user to override the default installation directory -- by only having to specify --prefix=... rather than overriding each -- individually. This is done by allowing $-style variables in the dirs. -- These are expanded by textual substitution (see -- substPathTemplate). -- -- A few of these installation directories are split into two components, -- the dir and subdir. The full installation path is formed by combining -- the two together with /. The reason for this is compatibility -- with other Unix build systems which also support --libdir and -- --datadir. We would like users to be able to configure -- --libdir=/usr/lib64 for example but because by default we -- want to support installing multiple versions of packages and building -- the same package for multiple compilers we append the libsubdir to -- get: /usr/lib64/$libname/$compiler. -- -- An additional complication is the need to support relocatable packages -- on systems which support such things, like Windows. type InstallDirTemplates = InstallDirs PathTemplate defaultInstallDirs :: CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates defaultInstallDirs' :: Bool -> CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates combineInstallDirs :: (a -> b -> c) -> InstallDirs a -> InstallDirs b -> InstallDirs c -- | Convert from abstract install directories to actual absolute ones by -- substituting for all the variables in the abstract paths, to get real -- absolute path. absoluteInstallDirs :: PackageIdentifier -> UnitId -> CompilerInfo -> CopyDest -> Platform -> InstallDirs PathTemplate -> InstallDirs FilePath -- | The location prefix for the copy command. data CopyDest NoCopyDest :: CopyDest CopyTo :: FilePath -> CopyDest -- | when using the ${pkgroot} as prefix. The CopyToDb will adjust the -- paths to be relative to the provided package database when copying / -- installing. CopyToDb :: FilePath -> CopyDest -- | Check which of the paths are relative to the installation $prefix. -- -- If any of the paths are not relative, ie they are absolute paths, then -- it prevents us from making a relocatable package (also known as a -- "prefix independent" package). prefixRelativeInstallDirs :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> InstallDirTemplates -> InstallDirs (Maybe FilePath) -- | Substitute the install dir templates into each other. -- -- To prevent cyclic substitutions, only some variables are allowed in -- particular dir templates. If out of scope vars are present, they are -- not substituted for. Checking for any remaining unsubstituted vars can -- be done as a subsequent operation. -- -- The reason it is done this way is so that in -- prefixRelativeInstallDirs we can replace prefix with the -- PrefixVar and get resulting PathTemplates that still -- have the PrefixVar in them. Doing this makes it each to check -- which paths are relative to the $prefix. substituteInstallDirTemplates :: PathTemplateEnv -> InstallDirTemplates -> InstallDirTemplates -- | An abstract path, possibly containing variables that need to be -- substituted for to get a real FilePath. data PathTemplate data PathTemplateVariable -- | The $prefix path variable PrefixVar :: PathTemplateVariable -- | The $bindir path variable BindirVar :: PathTemplateVariable -- | The $libdir path variable LibdirVar :: PathTemplateVariable -- | The $libsubdir path variable LibsubdirVar :: PathTemplateVariable -- | The $dynlibdir path variable DynlibdirVar :: PathTemplateVariable -- | The $datadir path variable DatadirVar :: PathTemplateVariable -- | The $datasubdir path variable DatasubdirVar :: PathTemplateVariable -- | The $docdir path variable DocdirVar :: PathTemplateVariable -- | The $htmldir path variable HtmldirVar :: PathTemplateVariable -- | The $pkg package name path variable PkgNameVar :: PathTemplateVariable -- | The $version package version path variable PkgVerVar :: PathTemplateVariable -- | The $pkgid package Id path variable, eg foo-1.0 PkgIdVar :: PathTemplateVariable -- | The $libname path variable LibNameVar :: PathTemplateVariable -- | The compiler name and version, eg ghc-6.6.1 CompilerVar :: PathTemplateVariable -- | The operating system name, eg windows or linux OSVar :: PathTemplateVariable -- | The CPU architecture name, eg i386 or x86_64 ArchVar :: PathTemplateVariable -- | The compiler's ABI identifier, AbiVar :: PathTemplateVariable -- | The optional ABI tag for the compiler AbiTagVar :: PathTemplateVariable -- | The executable name; used in shell wrappers ExecutableNameVar :: PathTemplateVariable -- | The name of the test suite being run TestSuiteNameVar :: PathTemplateVariable -- | The result of the test suite being run, eg pass, -- fail, or error. TestSuiteResultVar :: PathTemplateVariable -- | The name of the benchmark being run BenchmarkNameVar :: PathTemplateVariable type PathTemplateEnv = [(PathTemplateVariable, PathTemplate)] -- | Convert a FilePath to a PathTemplate including any -- template vars. toPathTemplate :: FilePath -> PathTemplate -- | Convert back to a path, any remaining vars are included fromPathTemplate :: PathTemplate -> FilePath combinePathTemplate :: PathTemplate -> PathTemplate -> PathTemplate substPathTemplate :: PathTemplateEnv -> PathTemplate -> PathTemplate -- | The initial environment has all the static stuff but no paths initialPathTemplateEnv :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> PathTemplateEnv platformTemplateEnv :: Platform -> PathTemplateEnv compilerTemplateEnv :: CompilerInfo -> PathTemplateEnv packageTemplateEnv :: PackageIdentifier -> UnitId -> PathTemplateEnv abiTemplateEnv :: CompilerInfo -> Platform -> PathTemplateEnv installDirsTemplateEnv :: InstallDirs PathTemplate -> PathTemplateEnv instance GHC.Generics.Generic (Distribution.Simple.InstallDirs.InstallDirs dir) instance GHC.Base.Functor Distribution.Simple.InstallDirs.InstallDirs instance GHC.Show.Show dir => GHC.Show.Show (Distribution.Simple.InstallDirs.InstallDirs dir) instance GHC.Read.Read dir => GHC.Read.Read (Distribution.Simple.InstallDirs.InstallDirs dir) instance GHC.Classes.Eq dir => GHC.Classes.Eq (Distribution.Simple.InstallDirs.InstallDirs dir) instance GHC.Generics.Generic Distribution.Simple.InstallDirs.CopyDest instance GHC.Show.Show Distribution.Simple.InstallDirs.CopyDest instance GHC.Classes.Eq Distribution.Simple.InstallDirs.CopyDest instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathTemplate instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathTemplate instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathTemplate instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathTemplate instance Distribution.Utils.Structured.Structured Distribution.Simple.InstallDirs.PathTemplate instance GHC.Show.Show Distribution.Simple.InstallDirs.PathTemplate instance GHC.Read.Read Distribution.Simple.InstallDirs.PathTemplate instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.CopyDest instance Data.Binary.Class.Binary dir => Data.Binary.Class.Binary (Distribution.Simple.InstallDirs.InstallDirs dir) instance Distribution.Utils.Structured.Structured dir => Distribution.Utils.Structured.Structured (Distribution.Simple.InstallDirs.InstallDirs dir) instance (GHC.Base.Semigroup dir, GHC.Base.Monoid dir) => GHC.Base.Monoid (Distribution.Simple.InstallDirs.InstallDirs dir) instance GHC.Base.Semigroup dir => GHC.Base.Semigroup (Distribution.Simple.InstallDirs.InstallDirs dir) -- | Remove the "literal" markups from a Haskell source file, including -- ">", "\begin{code}", "\end{code}", and -- "#" module Distribution.Simple.PreProcess.Unlit -- | unlit takes a filename (for error reports), and transforms the -- given string, to eliminate the literate comments from the program -- text. unlit :: FilePath -> String -> Either String String -- | No unliteration. plain :: String -> String -> String -- | Internal utilities used by Distribution.Simple.Program.*. module Distribution.Simple.Program.Internal -- | Extract the version number from the output of 'strip --version'. -- -- Invoking "strip --version" gives very inconsistent results. We ignore -- everything in parentheses (see #2497), look for the first word that -- starts with a number, and try parsing out the first two components of -- it. Non-GNU strip doesn't appear to have a version flag. stripExtractVersion :: String -> String -- | This module defines the detailed test suite interface which makes it -- possible to expose individual tests to Cabal or other test agents. module Distribution.TestSuite data TestInstance TestInstance :: IO Progress -> String -> [String] -> [OptionDescr] -> (String -> String -> Either String TestInstance) -> TestInstance -- | Perform the test. [run] :: TestInstance -> IO Progress -- | A name for the test, unique within a test suite. [name] :: TestInstance -> String -- | Users can select groups of tests by their tags. [tags] :: TestInstance -> [String] -- | Descriptions of the options recognized by this test. [options] :: TestInstance -> [OptionDescr] -- | Try to set the named option to the given value. Returns an error -- message if the option is not supported or the value could not be -- correctly parsed; otherwise, a TestInstance with the option set -- to the given value is returned. [setOption] :: TestInstance -> String -> String -> Either String TestInstance data OptionDescr OptionDescr :: String -> String -> OptionType -> Maybe String -> OptionDescr [optionName] :: OptionDescr -> String -- | A human-readable description of the option to guide the user setting -- it. [optionDescription] :: OptionDescr -> String [optionType] :: OptionDescr -> OptionType [optionDefault] :: OptionDescr -> Maybe String data OptionType OptionFile :: Bool -> Bool -> [String] -> OptionType [optionFileMustExist] :: OptionType -> Bool [optionFileIsDir] :: OptionType -> Bool [optionFileExtensions] :: OptionType -> [String] OptionString :: Bool -> OptionType [optionStringMultiline] :: OptionType -> Bool OptionNumber :: Bool -> (Maybe String, Maybe String) -> OptionType [optionNumberIsInt] :: OptionType -> Bool [optionNumberBounds] :: OptionType -> (Maybe String, Maybe String) OptionBool :: OptionType OptionEnum :: [String] -> OptionType OptionSet :: [String] -> OptionType OptionRngSeed :: OptionType data Test Test :: TestInstance -> Test Group :: String -> Bool -> [Test] -> Test [groupName] :: Test -> String -- | If true, then children of this group may be run in parallel. Note that -- this setting is not inherited by children. In particular, consider a -- group F with "concurrently = False" that has some children, including -- a group T with "concurrently = True". The children of group T may be -- run concurrently with each other, as long as none are run at the same -- time as any of the direct children of group F. [concurrently] :: Test -> Bool [groupTests] :: Test -> [Test] ExtraOptions :: [OptionDescr] -> Test -> Test type Options = [(String, String)] data Progress Finished :: Result -> Progress Progress :: String -> IO Progress -> Progress data Result Pass :: Result Fail :: String -> Result Error :: String -> Result -- | Create a named group of tests, which are assumed to be safe to run in -- parallel. testGroup :: String -> [Test] -> Test instance GHC.Show.Show Distribution.TestSuite.OptionType instance GHC.Read.Read Distribution.TestSuite.OptionType instance GHC.Classes.Eq Distribution.TestSuite.OptionType instance GHC.Show.Show Distribution.TestSuite.OptionDescr instance GHC.Read.Read Distribution.TestSuite.OptionDescr instance GHC.Classes.Eq Distribution.TestSuite.OptionDescr instance GHC.Show.Show Distribution.TestSuite.Result instance GHC.Read.Read Distribution.TestSuite.Result instance GHC.Classes.Eq Distribution.TestSuite.Result module Distribution.Types.AnnotatedId -- | An AnnotatedId is a ComponentId, UnitId, etc. -- which is annotated with some other useful information that is useful -- for printing to users, etc. -- -- Invariant: if ann_id x == ann_id y, then ann_pid x == ann_pid y and -- ann_cname x == ann_cname y data AnnotatedId id AnnotatedId :: PackageId -> ComponentName -> id -> AnnotatedId id [ann_pid] :: AnnotatedId id -> PackageId [ann_cname] :: AnnotatedId id -> ComponentName [ann_id] :: AnnotatedId id -> id instance GHC.Show.Show id => GHC.Show.Show (Distribution.Types.AnnotatedId.AnnotatedId id) instance GHC.Classes.Eq id => GHC.Classes.Eq (Distribution.Types.AnnotatedId.AnnotatedId id) instance GHC.Classes.Ord id => GHC.Classes.Ord (Distribution.Types.AnnotatedId.AnnotatedId id) instance Distribution.Package.Package (Distribution.Types.AnnotatedId.AnnotatedId id) instance GHC.Base.Functor Distribution.Types.AnnotatedId.AnnotatedId module Distribution.Types.ComponentInclude data ComponentInclude id rn ComponentInclude :: AnnotatedId id -> rn -> Bool -> ComponentInclude id rn [ci_ann_id] :: ComponentInclude id rn -> AnnotatedId id [ci_renaming] :: ComponentInclude id rn -> rn -- | Did this come from an entry in mixins, or was implicitly -- generated by build-depends? [ci_implicit] :: ComponentInclude id rn -> Bool ci_id :: ComponentInclude id rn -> id ci_pkgid :: ComponentInclude id rn -> PackageId -- | This should always return CLibName or CSubLibName ci_cname :: ComponentInclude id rn -> ComponentName module Distribution.Types.ComponentLocalBuildInfo -- | 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] componentIsIndefinite :: ComponentLocalBuildInfo -> Bool maybeComponentInstantiatedWith :: ComponentLocalBuildInfo -> Maybe [(ModuleName, OpenModule)] instance GHC.Show.Show Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo instance GHC.Read.Read Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo instance GHC.Generics.Generic Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo instance Data.Binary.Class.Binary Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo instance Distribution.Utils.Structured.Structured Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo instance Distribution.Compat.Graph.IsNode Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo module Distribution.Types.DumpBuildInfo data DumpBuildInfo NoDumpBuildInfo :: DumpBuildInfo DumpBuildInfo :: DumpBuildInfo instance GHC.Generics.Generic Distribution.Types.DumpBuildInfo.DumpBuildInfo instance GHC.Enum.Bounded Distribution.Types.DumpBuildInfo.DumpBuildInfo instance GHC.Enum.Enum Distribution.Types.DumpBuildInfo.DumpBuildInfo instance GHC.Classes.Ord Distribution.Types.DumpBuildInfo.DumpBuildInfo instance GHC.Classes.Eq Distribution.Types.DumpBuildInfo.DumpBuildInfo instance GHC.Show.Show Distribution.Types.DumpBuildInfo.DumpBuildInfo instance GHC.Read.Read Distribution.Types.DumpBuildInfo.DumpBuildInfo instance Data.Binary.Class.Binary Distribution.Types.DumpBuildInfo.DumpBuildInfo instance Distribution.Utils.Structured.Structured Distribution.Types.DumpBuildInfo.DumpBuildInfo module Distribution.Types.GivenComponent -- | A GivenComponent represents a library depended on and -- explicitly specified by the user/client with --dependency -- -- It enables Cabal to know which ComponentId to associate with a -- library data GivenComponent GivenComponent :: PackageName -> LibraryName -> ComponentId -> GivenComponent [givenComponentPackage] :: GivenComponent -> PackageName [givenComponentName] :: GivenComponent -> LibraryName [givenComponentId] :: GivenComponent -> ComponentId instance GHC.Classes.Eq Distribution.Types.GivenComponent.GivenComponent instance GHC.Show.Show Distribution.Types.GivenComponent.GivenComponent instance GHC.Read.Read Distribution.Types.GivenComponent.GivenComponent instance GHC.Generics.Generic Distribution.Types.GivenComponent.GivenComponent instance Data.Binary.Class.Binary Distribution.Types.GivenComponent.GivenComponent instance Distribution.Utils.Structured.Structured Distribution.Types.GivenComponent.GivenComponent -- | Magic PackageNames. module Distribution.Types.PackageName.Magic -- | Used as a placeholder in Distribution.Backpack.ReadyComponent nonExistentPackageThisIsCabalBug :: PackageName -- | Used by cabal new-repl, cabal new-run and cabal -- new-build fakePackageName :: PackageName -- | Used by cabal new-run and cabal new-build fakePackageCabalFileName :: FilePath -- | fakePackageName with version0. fakePackageId :: PackageId module Distribution.Types.TargetInfo -- | The TargetInfo contains all the information necessary to build -- a specific target (e.g., componentmodulefile) in a package. In -- principle, one can get the Component from a -- ComponentLocalBuildInfo and LocalBuildInfo, but it is -- much more convenient to have the component in hand. data TargetInfo TargetInfo :: ComponentLocalBuildInfo -> Component -> TargetInfo [targetCLBI] :: TargetInfo -> ComponentLocalBuildInfo [targetComponent] :: TargetInfo -> Component instance Distribution.Compat.Graph.IsNode Distribution.Types.TargetInfo.TargetInfo module Distribution.Utils.IOData -- | Represents either textual or binary data passed via I/O functions -- which support binary/text mode data IOData -- | How Text gets encoded is usually locale-dependent. IODataText :: String -> IOData -- | Raw binary which gets read/written in binary mode. IODataBinary :: ByteString -> IOData data IODataMode mode [IODataModeText] :: IODataMode String [IODataModeBinary] :: IODataMode ByteString class NFData mode => KnownIODataMode mode -- | IOData Wrapper for hGetContents -- -- Note: This operation uses lazy I/O. Use NFData to force -- all data to be read and consequently the internal file handle to be -- closed. hGetIODataContents :: KnownIODataMode mode => Handle -> IO mode toIOData :: KnownIODataMode mode => mode -> IOData iodataMode :: KnownIODataMode mode => IODataMode mode withIOData :: IOData -> (forall mode. IODataMode mode -> mode -> r) -> r -- | Test whether IOData is empty null :: IOData -> Bool -- | IOData Wrapper for hPutStr and hClose -- -- This is the dual operation ot hGetIODataContents, and -- consequently the handle is closed with hClose. -- -- Note: this performs lazy-IO. hPutContents :: Handle -> IOData -> IO () instance (a GHC.Types.~ GHC.Types.Char) => Distribution.Utils.IOData.KnownIODataMode [a] instance Distribution.Utils.IOData.KnownIODataMode Data.ByteString.Lazy.Internal.ByteString instance Control.DeepSeq.NFData Distribution.Utils.IOData.IOData -- | Extremely simple JSON helper. Don't do anything too fancy with this! module Distribution.Utils.Json data Json JsonArray :: [Json] -> Json JsonBool :: !Bool -> Json JsonNull :: Json JsonNumber :: !Int -> Json JsonObject :: [(String, Json)] -> Json JsonString :: !String -> Json -- | A shorthand for building up JsonObjects >>> JsonObject -- [ "a" .= JsonNumber 42, "b" .= JsonBool True ] JsonObject -- [("a",JsonNumber 42),("b",JsonBool True)] (.=) :: String -> Json -> (String, Json) -- | Convert a Json into a ByteString renderJson :: Json -> ByteString instance GHC.Show.Show Distribution.Utils.Json.Json module Distribution.Utils.MapAccum -- | Monadic variant of mapAccumL. mapAccumM :: (Monad m, Traversable t) => (a -> b -> m (a, c)) -> a -> t b -> m (a, t c) instance GHC.Base.Functor m => GHC.Base.Functor (Distribution.Utils.MapAccum.StateM s m) instance GHC.Base.Monad m => GHC.Base.Applicative (Distribution.Utils.MapAccum.StateM s m) -- | A progress monad, which we use to report failure and logging from -- otherwise pure code. module Distribution.Utils.Progress -- | A type to represent the unfolding of an expensive long running -- calculation that may fail (or maybe not expensive, but complicated!) -- We may get intermediate steps before the final result which may be -- used to indicate progress and/or logging messages. -- -- TODO: Apply Codensity to avoid left-associativity problem. See -- http://comonad.com/reader/2011/free-monads-for-less/ and -- http://blog.ezyang.com/2012/01/problem-set-the-codensity-transformation/ data Progress step fail done -- | Emit a step and then continue. stepProgress :: step -> Progress step fail () -- | Fail the computation. failProgress :: fail -> Progress step fail done -- | Consume a Progress calculation. Much like foldr for -- lists but with two base cases, one for a final result and one for -- failure. -- -- Eg to convert into a simple Either result use: -- --
-- foldProgress (flip const) Left Right --foldProgress :: (step -> a -> a) -> (fail -> a) -> (done -> a) -> Progress step fail done -> a instance GHC.Base.Functor (Distribution.Utils.Progress.Progress step fail) instance GHC.Base.Monad (Distribution.Utils.Progress.Progress step fail) instance GHC.Base.Applicative (Distribution.Utils.Progress.Progress step fail) instance GHC.Base.Monoid fail => GHC.Base.Alternative (Distribution.Utils.Progress.Progress step fail) module Distribution.Verbosity.Internal data VerbosityLevel Silent :: VerbosityLevel Normal :: VerbosityLevel Verbose :: VerbosityLevel Deafening :: VerbosityLevel data VerbosityFlag VCallStack :: VerbosityFlag VCallSite :: VerbosityFlag VNoWrap :: VerbosityFlag VMarkOutput :: VerbosityFlag VTimestamp :: VerbosityFlag VStderr :: VerbosityFlag VNoWarn :: VerbosityFlag instance GHC.Enum.Bounded Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Enum.Enum Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Classes.Ord Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Classes.Eq Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Read.Read Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Show.Show Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Generics.Generic Distribution.Verbosity.Internal.VerbosityLevel instance GHC.Enum.Bounded Distribution.Verbosity.Internal.VerbosityFlag instance GHC.Enum.Enum Distribution.Verbosity.Internal.VerbosityFlag instance GHC.Classes.Ord Distribution.Verbosity.Internal.VerbosityFlag instance GHC.Classes.Eq Distribution.Verbosity.Internal.VerbosityFlag instance GHC.Read.Read Distribution.Verbosity.Internal.VerbosityFlag instance GHC.Show.Show Distribution.Verbosity.Internal.VerbosityFlag instance GHC.Generics.Generic Distribution.Verbosity.Internal.VerbosityFlag instance Data.Binary.Class.Binary Distribution.Verbosity.Internal.VerbosityFlag instance Distribution.Utils.Structured.Structured Distribution.Verbosity.Internal.VerbosityFlag instance Data.Binary.Class.Binary Distribution.Verbosity.Internal.VerbosityLevel instance Distribution.Utils.Structured.Structured Distribution.Verbosity.Internal.VerbosityLevel -- | A Verbosity type with associated utilities. -- -- There are 4 standard verbosity levels from silent, -- normal, verbose up to deafening. This is used for -- deciding what logging messages to print. -- -- Verbosity also is equipped with some internal settings which can be -- used to control at a fine granularity the verbosity of specific -- settings (e.g., so that you can trace only particular things you are -- interested in.) It's important to note that the instances for -- Verbosity assume that this does not exist. module Distribution.Verbosity data Verbosity -- | In silent mode, we should not print anything unless an -- error occurs. silent :: Verbosity -- | Print stuff we want to see by default. normal :: Verbosity -- | Be more verbose about what's going on. verbose :: Verbosity -- | Not only are we verbose ourselves (perhaps even noisier than when -- being verbose), but we tell everything we run to be verbose -- too. deafening :: Verbosity -- | Increase verbosity level, but stay silent if we are. moreVerbose :: Verbosity -> Verbosity -- | Decrease verbosity level, but stay deafening if we are. lessVerbose :: Verbosity -> Verbosity -- | Test if we had called lessVerbose on the verbosity. isVerboseQuiet :: Verbosity -> Bool -- | Numeric verbosity level 0..3: 0 is silent, -- 3 is deafening. intToVerbosity :: Int -> Maybe Verbosity flagToVerbosity :: ReadE Verbosity showForCabal :: Verbosity -> String showForGHC :: Verbosity -> String -- | Turn off all flags. verboseNoFlags :: Verbosity -> Verbosity verboseHasFlags :: Verbosity -> Bool -- | Combinator for transforming verbosity level while retaining the -- original hidden state. -- -- For instance, the following property holds -- --
-- isVerboseNoWrap (modifyVerbosity (max verbose) v) == isVerboseNoWrap v ---- -- Note: you can use modifyVerbosity (const v1) v0 to -- overwrite v1's flags with v0's flags. modifyVerbosity :: (Verbosity -> Verbosity) -> Verbosity -> Verbosity -- | Turn on verbose call-site printing when we log. verboseCallSite :: Verbosity -> Verbosity -- | Turn on verbose call-stack printing when we log. verboseCallStack :: Verbosity -> Verbosity -- | Test if we should output call sites when we log. isVerboseCallSite :: Verbosity -> Bool -- | Test if we should output call stacks when we log. isVerboseCallStack :: Verbosity -> Bool -- | Turn on -----BEGIN CABAL OUTPUT----- markers for output from -- Cabal (as opposed to GHC, or system dependent). verboseMarkOutput :: Verbosity -> Verbosity -- | Test if we should output markets. isVerboseMarkOutput :: Verbosity -> Bool -- | Turn off marking; useful for suppressing nondeterministic output. verboseUnmarkOutput :: Verbosity -> Verbosity -- | Disable line-wrapping for log messages. verboseNoWrap :: Verbosity -> Verbosity -- | Test if line-wrapping is disabled for log messages. isVerboseNoWrap :: Verbosity -> Bool -- | Turn on timestamps for log messages. verboseTimestamp :: Verbosity -> Verbosity -- | Test if we should output timestamps when we log. isVerboseTimestamp :: Verbosity -> Bool -- | Turn off timestamps for log messages. verboseNoTimestamp :: Verbosity -> Verbosity -- | Switch logging to stderr. verboseStderr :: Verbosity -> Verbosity -- | Test if we should output to stderr when we log. isVerboseStderr :: Verbosity -> Bool -- | Switch logging to stdout. verboseNoStderr :: Verbosity -> Verbosity -- | Turn off warnings for log messages. verboseNoWarn :: Verbosity -> Verbosity -- | Test if we should output warnings when we log. isVerboseNoWarn :: Verbosity -> Bool instance GHC.Read.Read Distribution.Verbosity.Verbosity instance GHC.Show.Show Distribution.Verbosity.Verbosity instance GHC.Generics.Generic Distribution.Verbosity.Verbosity instance GHC.Classes.Eq Distribution.Verbosity.Verbosity instance GHC.Classes.Ord Distribution.Verbosity.Verbosity instance GHC.Enum.Enum Distribution.Verbosity.Verbosity instance GHC.Enum.Bounded Distribution.Verbosity.Verbosity instance Data.Binary.Class.Binary Distribution.Verbosity.Verbosity instance Distribution.Utils.Structured.Structured Distribution.Verbosity.Verbosity instance Distribution.Parsec.Parsec Distribution.Verbosity.Verbosity instance Distribution.Pretty.Pretty Distribution.Verbosity.Verbosity -- | A large and somewhat miscellaneous collection of utility functions -- used throughout the rest of the Cabal lib and in other tools that use -- the Cabal lib like cabal-install. It has a very simple set of -- logging actions. It has low level functions for running programs, a -- bunch of wrappers for various directory and file functions that do -- extra logging. module Distribution.Simple.Utils cabalVersion :: Version dieNoVerbosity :: String -> IO a die' :: Verbosity -> String -> IO a dieWithLocation' :: Verbosity -> FilePath -> Maybe Int -> String -> IO a dieNoWrap :: Verbosity -> String -> IO a topHandler :: IO a -> IO a topHandlerWith :: forall a. (SomeException -> IO a) -> IO a -> IO a -- | Non fatal conditions that may be indicative of an error or problem. -- -- We display these at the normal verbosity level. warn :: Verbosity -> String -> IO () -- | Useful status messages. -- -- We display these at the normal verbosity level. -- -- This is for the ordinary helpful status messages that users see. Just -- enough information to know that things are working but not floods of -- detail. notice :: Verbosity -> String -> IO () -- | Display a message at normal verbosity level, but without -- wrapping. noticeNoWrap :: Verbosity -> String -> IO () -- | Pretty-print a Doc status message at normal verbosity -- level. Use this if you need fancy formatting. noticeDoc :: Verbosity -> Doc -> IO () -- | Display a "setup status message". Prefer using setupMessage' if -- possible. setupMessage :: Verbosity -> String -> PackageIdentifier -> IO () -- | More detail on the operation of some action. -- -- We display these messages when the verbosity level is verbose info :: Verbosity -> String -> IO () infoNoWrap :: Verbosity -> String -> IO () -- | Detailed internal debugging information -- -- We display these messages when the verbosity level is deafening debug :: Verbosity -> String -> IO () -- | A variant of debug that doesn't perform the automatic line -- wrapping. Produces better output in some cases. debugNoWrap :: Verbosity -> String -> IO () -- | Perform an IO action, catching any IO exceptions and printing an error -- if one occurs. chattyTry :: String -> IO () -> IO () -- | Given a block of IO code that may raise an exception, annotate it with -- the metadata from the current scope. Use this as close to external -- code that raises IO exceptions as possible, since this function -- unconditionally wraps the error message with a trace (so it is NOT -- idempotent.) annotateIO :: Verbosity -> IO a -> IO a -- | Wrap output with a marker if +markoutput verbosity flag is -- set. -- -- NB: Why is markoutput done with start/end markers, and not prefixes? -- Markers are more convenient to add (if we want to add prefixes, we -- have to lines and then map; here's it's just some -- concatenates). Note that even in the prefix case, we can't guarantee -- that the markers are unambiguous, because some of Cabal's output comes -- straight from external programs, where we don't have the ability to -- interpose on the output. -- -- This is used by withMetadata withOutputMarker :: Verbosity -> String -> String -- | Run an IO computation, returning e if it raises a "file does -- not exist" error. handleDoesNotExist :: a -> IO a -> IO a -- | Ignore SIGPIPE in a subcomputation. ignoreSigPipe :: IO () -> IO () -- | Execute the given command with the given arguments, exiting with the -- same exit code if the command fails. rawSystemExit :: Verbosity -> FilePath -> [String] -> IO () -- | Execute the given command with the given arguments, returning the -- command's exit code. rawSystemExitCode :: Verbosity -> FilePath -> [String] -> IO ExitCode -- | Execute the given command with the given arguments, returning the -- command's exit code. -- -- Create the process argument with proc to ensure consistent -- options with other rawSystem functions in this module. rawSystemProc :: Verbosity -> CreateProcess -> IO ExitCode -- | Execute the given command with the given arguments, returning the -- command's exit code. action is executed while the command is -- running, and would typically be used to communicate with the process -- through pipes. -- -- Create the process argument with proc to ensure consistent -- options with other rawSystem functions in this module. rawSystemProcAction :: Verbosity -> CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> IO a) -> IO (ExitCode, a) -- | Execute the given command with the given arguments and environment, -- exiting with the same exit code if the command fails. rawSystemExitWithEnv :: Verbosity -> FilePath -> [String] -> [(String, String)] -> IO () -- | Execute the given command with the given arguments, returning the -- command's output. Exits if the command exits with error. -- -- Provides control over the binary/text mode of the output. rawSystemStdout :: forall mode. KnownIODataMode mode => Verbosity -> FilePath -> [String] -> IO mode -- | Execute the given command with the given arguments, returning the -- command's output, errors and exit code. -- -- Optional arguments allow setting working directory, environment and -- command input. -- -- Provides control over the binary/text mode of the input and output. rawSystemStdInOut :: KnownIODataMode mode => Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe IOData -> IODataMode mode -> IO (mode, String, ExitCode) -- | Execute the given command with the given arguments, returning the -- command's exit code. -- -- Optional arguments allow setting working directory, environment and -- input and output handles. rawSystemIOWithEnv :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO ExitCode -- | Execute the given command with the given arguments, returning the -- command's exit code. action is executed while the command is -- running, and would typically be used to communicate with the process -- through pipes. -- -- Optional arguments allow setting working directory, environment and -- input and output handles. rawSystemIOWithEnvAndAction :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO a -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO (ExitCode, a) -- | fromJust for dealing with 'Maybe Handle' values as obtained via -- CreatePipe. Creating a pipe using CreatePipe -- guarantees a Just value for the corresponding handle. fromCreatePipe :: Maybe Handle -> Handle -- | Helper to use with one of the rawSystem variants, and exit -- unless the command completes successfully. maybeExit :: IO ExitCode -> IO () -- | Like the Unix xargs program. Useful for when we've got very long -- command lines that might overflow an OS limit on command line length -- and so you need to invoke a command multiple times to get all the args -- in. -- -- Use it with either of the rawSystem variants above. For example: -- --
-- xargs (32*1024) (rawSystemExit verbosity) prog fixedArgs bigArgs --xargs :: Int -> ([String] -> IO ()) -> [String] -> [String] -> IO () -- | Look for a program and try to find it's version number. It can accept -- either an absolute path or the name of a program binary, in which case -- we will look for the program on the path. findProgramVersion :: String -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version) -- | Represents either textual or binary data passed via I/O functions -- which support binary/text mode data IOData -- | How Text gets encoded is usually locale-dependent. IODataText :: String -> IOData -- | Raw binary which gets read/written in binary mode. IODataBinary :: ByteString -> IOData class NFData mode => KnownIODataMode mode -- | IOData Wrapper for hGetContents -- -- Note: This operation uses lazy I/O. Use NFData to force -- all data to be read and consequently the internal file handle to be -- closed. hGetIODataContents :: KnownIODataMode mode => Handle -> IO mode toIOData :: KnownIODataMode mode => mode -> IOData iodataMode :: KnownIODataMode mode => IODataMode mode data IODataMode mode [IODataModeText] :: IODataMode String [IODataModeBinary] :: IODataMode ByteString -- | Same as createDirectoryIfMissing but logs at higher verbosity -- levels. createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO () -- | Copies a file without copying file permissions. The target file is -- created with default permissions. Any existing target file is -- replaced. -- -- At higher verbosity levels it logs an info message. copyFileVerbose :: Verbosity -> FilePath -> FilePath -> IO () -- | Copies a bunch of files to a target directory, preserving the -- directory structure in the target location. The target directories are -- created if they do not exist. -- -- The files are identified by a pair of base directory and a path -- relative to that base. It is only the relative part that is preserved -- in the destination. -- -- For example: -- --
-- copyFiles normal "dist/src"
-- [("", "src/Foo.hs"), ("dist/build/", "src/Bar.hs")]
--
--
-- This would copy "src/Foo.hs" to "dist/src/src/Foo.hs" and copy
-- "dist/build/src/Bar.hs" to "dist/src/src/Bar.hs".
--
-- This operation is not atomic. Any IO failure during the copy
-- (including any missing source files) leaves the target in an unknown
-- state so it is best to use it with a freshly created directory so that
-- it can be simply deleted if anything goes wrong.
copyFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | Given a relative path to a file, copy it to the given directory,
-- preserving the relative path and creating the parent directories if
-- needed.
copyFileTo :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Install an ordinary file. This is like a file copy but the permissions
-- are set appropriately for an installed file. On Unix it is
-- "-rw-r--r--" while on Windows it uses the default permissions for the
-- target directory.
installOrdinaryFile :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Install an executable file. This is like a file copy but the
-- permissions are set appropriately for an installed file. On Unix it is
-- "-rwxr-xr-x" while on Windows it uses the default permissions for the
-- target directory.
installExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Install a file that may or not be executable, preserving permissions.
installMaybeExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()
-- | This is like copyFiles but uses installOrdinaryFile.
installOrdinaryFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | This is like copyFiles but uses installExecutableFile.
installExecutableFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | This is like copyFiles but uses
-- installMaybeExecutableFile.
installMaybeExecutableFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()
-- | This installs all the files in a directory to a target location,
-- preserving the directory layout. All the files are assumed to be
-- ordinary rather than executable files.
installDirectoryContents :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Recursively copy the contents of one directory to another path.
copyDirectoryRecursive :: Verbosity -> FilePath -> FilePath -> IO ()
-- | Like doesFileExist, but also checks that the file is
-- executable.
doesExecutableExist :: FilePath -> IO Bool
setFileOrdinary :: FilePath -> IO ()
setFileExecutable :: FilePath -> IO ()
-- | The path name that represents the current directory. In Unix, it's
-- ".", but this is system-specific. (E.g. AmigaOS uses the
-- empty string "" for the current directory.)
currentDir :: FilePath
shortRelativePath :: FilePath -> FilePath -> FilePath
-- | Drop the extension if it's one of exeExtensions, or return the
-- path unchanged.
dropExeExtension :: FilePath -> FilePath
-- | List of possible executable file extensions on the current build
-- platform.
exeExtensions :: [String]
-- | Find a file by looking in a search path. The file path must match
-- exactly.
findFileEx :: Verbosity -> [FilePath] -> FilePath -> IO FilePath
-- | Find a file by looking in a search path. The file path must match
-- exactly.
findFileCwd :: Verbosity -> FilePath -> [FilePath] -> FilePath -> IO FilePath
findFirstFile :: (a -> FilePath) -> [a] -> IO (Maybe a)
-- | Find a file by looking in a search path with one of a list of possible
-- file extensions. The file base name should be given and it will be
-- tried with each of the extensions in each element of the search path.
findFileWithExtension :: [String] -> [FilePath] -> FilePath -> IO (Maybe FilePath)
findFileCwdWithExtension :: FilePath -> [String] -> [FilePath] -> FilePath -> IO (Maybe FilePath)
-- | Like findFileWithExtension but returns which element of the
-- search path the file was found in, and the file path relative to that
-- base directory.
findFileWithExtension' :: [String] -> [FilePath] -> FilePath -> IO (Maybe (FilePath, FilePath))
findAllFilesWithExtension :: [String] -> [FilePath] -> FilePath -> IO [FilePath]
findAllFilesCwdWithExtension :: FilePath -> [String] -> [FilePath] -> FilePath -> IO [FilePath]
-- | Find the file corresponding to a Haskell module name.
--
-- This is similar to findFileWithExtension' but specialised to a
-- module name. The function fails if the file corresponding to the
-- module is missing.
findModuleFileEx :: Verbosity -> [FilePath] -> [String] -> ModuleName -> IO (FilePath, FilePath)
-- | Finds the files corresponding to a list of Haskell module names.
--
-- As findModuleFile but for a list of module names.
findModuleFilesEx :: Verbosity -> [FilePath] -> [String] -> [ModuleName] -> IO [(FilePath, FilePath)]
-- | List all the files in a directory and all subdirectories.
--
-- The order places files in sub-directories after all the files in their
-- parent directories. The list is generated lazily so is not well
-- defined if the source directory structure changes before the list is
-- used.
getDirectoryContentsRecursive :: FilePath -> IO [FilePath]
-- | Is this directory in the system search path?
isInSearchPath :: FilePath -> IO Bool
addLibraryPath :: OS -> [FilePath] -> [(String, String)] -> [(String, String)]
-- | Compare the modification times of two files to see if the first is
-- newer than the second. The first file must exist but the second need
-- not. The expected use case is when the second file is generated using
-- the first. In this use case, if the result is True then the second
-- file is out of date.
moreRecentFile :: FilePath -> FilePath -> IO Bool
-- | Like moreRecentFile, but also checks that the first file
-- exists.
existsAndIsMoreRecentThan :: FilePath -> FilePath -> IO Bool
-- | Advanced options for withTempFile and withTempDirectory.
data TempFileOptions
TempFileOptions :: Bool -> TempFileOptions
-- | Keep temporary files?
[optKeepTempFiles] :: TempFileOptions -> Bool
defaultTempFileOptions :: TempFileOptions
-- | Use a temporary filename that doesn't already exist.
withTempFile :: FilePath -> String -> (FilePath -> Handle -> IO a) -> IO a
-- | A version of withTempFile that additionally takes a
-- TempFileOptions argument.
withTempFileEx :: TempFileOptions -> FilePath -> String -> (FilePath -> Handle -> IO a) -> IO a
-- | Create and use a temporary directory.
--
-- Creates a new temporary directory inside the given directory, making
-- use of the template. The temp directory is deleted after use. For
-- example:
--
-- -- withTempDirectory verbosity "src" "sdist." $ \tmpDir -> do ... ---- -- The tmpDir will be a new subdirectory of the given directory, -- e.g. src/sdist.342. withTempDirectory :: Verbosity -> FilePath -> String -> (FilePath -> IO a) -> IO a -- | A version of withTempDirectory that additionally takes a -- TempFileOptions argument. withTempDirectoryEx :: Verbosity -> TempFileOptions -> FilePath -> String -> (FilePath -> IO a) -> IO a createTempDirectory :: FilePath -> String -> IO FilePath -- | Package description file (pkgname.cabal) defaultPackageDesc :: Verbosity -> IO FilePath -- | Find a package description file in the given directory. Looks for -- .cabal files. findPackageDesc :: FilePath -> IO (Either String FilePath) findPackageDescCwd :: FilePath -> FilePath -> IO (Either String FilePath) -- | Like findPackageDesc, but calls die in case of error. tryFindPackageDesc :: Verbosity -> FilePath -> IO FilePath -- | Like findPackageDescCwd, but calls die in case of -- error. tryFindPackageDescCwd :: Verbosity -> FilePath -> FilePath -> IO FilePath -- | Find auxiliary package information in the given directory. Looks for -- .buildinfo files. findHookedPackageDesc :: Verbosity -> FilePath -> IO (Maybe FilePath) -- | Gets the contents of a file, but guarantee that it gets closed. -- -- The file is read lazily but if it is not fully consumed by the action -- then the remaining input is truncated and the file is closed. withFileContents :: FilePath -> (String -> IO a) -> IO a -- | Writes a file atomically. -- -- The file is either written successfully or an IO exception is raised -- and the original file is left unchanged. -- -- On windows it is not possible to delete a file that is open by a -- process. This case will give an IO exception but the atomic property -- is not affected. writeFileAtomic :: FilePath -> ByteString -> 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 () -- | Same as rewriteFileEx but for ByteStrings. rewriteFileLBS :: Verbosity -> FilePath -> ByteString -> IO () -- | Decode String from UTF8-encoded ByteString -- -- Invalid data in the UTF8 stream (this includes code-points -- U+D800 through U+DFFF) will be decoded as the -- replacement character (U+FFFD). fromUTF8BS :: ByteString -> String -- | Variant of fromUTF8BS for lazy ByteStrings fromUTF8LBS :: ByteString -> String -- | Encode String to UTF8-encoded ByteString -- -- Code-points in the U+D800-U+DFFF range will be -- encoded as the replacement character (i.e. U+FFFD). toUTF8BS :: String -> ByteString -- | Variant of toUTF8BS for lazy ByteStrings toUTF8LBS :: String -> ByteString -- | Reads a UTF8 encoded text file as a Unicode String -- -- Reads lazily using ordinary readFile. readUTF8File :: FilePath -> IO String -- | Reads a UTF8 encoded text file as a Unicode String -- -- Same behaviour as withFileContents. withUTF8FileContents :: FilePath -> (String -> IO a) -> IO a -- | Writes a Unicode String as a UTF8 encoded text file. -- -- Uses writeFileAtomic, so provides the same guarantees. writeUTF8File :: FilePath -> String -> IO () -- | Fix different systems silly line ending conventions normaliseLineEndings :: String -> String -- | Ignore a Unicode byte order mark (BOM) at the beginning of the input ignoreBOM :: String -> String -- | dropWhileEndLE p is equivalent to reverse . dropWhile p . -- reverse, but quite a bit faster. The difference between -- "Data.List.dropWhileEnd" and this version is that the one in -- Data.List is strict in elements, but spine-lazy, while this one -- is spine-strict but lazy in elements. That's what LE stands -- for - "lazy in elements". -- -- Example: -- --
-- >>> safeTail $ Data.List.dropWhileEnd (<3) [undefined, 5, 4, 3, 2, 1] -- *** Exception: Prelude.undefined -- ... ---- --
-- >>> safeTail $ dropWhileEndLE (<3) [undefined, 5, 4, 3, 2, 1] -- [5,4,3] ---- --
-- >>> take 3 $ Data.List.dropWhileEnd (<3) [5, 4, 3, 2, 1, undefined] -- [5,4,3] ---- --
-- >>> take 3 $ dropWhileEndLE (<3) [5, 4, 3, 2, 1, undefined] -- *** Exception: Prelude.undefined -- ... --dropWhileEndLE :: (a -> Bool) -> [a] -> [a] -- | takeWhileEndLE p is equivalent to reverse . takeWhile p . -- reverse, but is usually faster (as well as being easier to read). takeWhileEndLE :: (a -> Bool) -> [a] -> [a] equating :: Eq a => (b -> a) -> b -> b -> Bool -- |
-- comparing p x y = compare (p x) (p y) ---- -- Useful combinator for use in conjunction with the xxxBy -- family of functions from Data.List, for example: -- --
-- ... sortBy (comparing fst) ... --comparing :: Ord a => (b -> a) -> b -> b -> Ordering -- | The isInfixOf function takes two lists and returns True -- iff the first list is contained, wholly and intact, anywhere within -- the second. -- --
-- >>> isInfixOf "Haskell" "I really like Haskell." -- True ---- --
-- >>> isInfixOf "Ial" "I really like Haskell." -- False --isInfixOf :: Eq a => [a] -> [a] -> Bool -- | intercalate xs xss is equivalent to (concat -- (intersperse xs xss)). It inserts the list xs in -- between the lists in xss and concatenates the result. -- --
-- >>> intercalate ", " ["Lorem", "ipsum", "dolor"] -- "Lorem, ipsum, dolor" --intercalate :: [a] -> [[a]] -> [a] -- | Lower case string -- --
-- >>> lowercase "Foobar" -- "foobar" --lowercase :: String -> String -- | Like "Data.List.union", but has O(n log n) complexity instead -- of O(n^2). listUnion :: Ord a => [a] -> [a] -> [a] -- | A right-biased version of listUnion. -- -- Example: -- --
-- >>> listUnion [1,2,3,4,3] [2,1,1] -- [1,2,3,4,3] ---- --
-- >>> listUnionRight [1,2,3,4,3] [2,1,1] -- [4,3,2,1,1] --listUnionRight :: Ord a => [a] -> [a] -> [a] -- | Like nub, but has O(n log n) complexity instead of -- O(n^2). Code for ordNub and listUnion taken -- from Niklas HambĂĽchen's ordnub package. ordNub :: Ord a => [a] -> [a] -- | Like ordNub and nubBy. Selects a key for each element -- and takes the nub based on that key. ordNubBy :: Ord b => (a -> b) -> [a] -> [a] -- | A right-biased version of ordNub. -- -- Example: -- --
-- >>> ordNub [1,2,1] :: [Int] -- [1,2] ---- --
-- >>> ordNubRight [1,2,1] :: [Int] -- [2,1] --ordNubRight :: Ord a => [a] -> [a] -- | A total variant of head. safeHead :: [a] -> Maybe a -- | A total variant of tail. safeTail :: [a] -> [a] -- | A total variant of last. safeLast :: [a] -> Maybe a -- | A total variant of init. safeInit :: [a] -> [a] unintersperse :: Char -> String -> [String] -- | Wraps text to the default line width. Existing newlines are preserved. wrapText :: String -> String -- | Wraps a list of words to a list of lines of words of a particular -- width. wrapLine :: Int -> [String] -> [[String]] -- | isAbsoluteOnAnyPlatform and isRelativeOnAnyPlatform are -- like isAbsolute and isRelative but have platform -- independent heuristics. The System.FilePath exists in two versions, -- Windows and Posix. The two versions don't agree on what is a relative -- path and we don't know if we're given Windows or Posix paths. This -- results in false positives when running on Posix and inspecting -- Windows paths, like the hackage server does. -- System.FilePath.Posix.isAbsolute "C:\hello" == False -- System.FilePath.Windows.isAbsolute "/hello" == False This means that -- we would treat paths that start with "/" to be absolute. On Posix they -- are indeed absolute, while on Windows they are not. -- -- The portable versions should be used when we might deal with paths -- that are from another OS than the host OS. For example, the Hackage -- Server deals with both Windows and Posix paths while performing the -- PackageDescription checks. In contrast, when we run 'cabal configure' -- we do expect the paths to be correct for our OS and we should not have -- to use the platform independent heuristics. isAbsoluteOnAnyPlatform :: FilePath -> Bool -- |
-- isRelativeOnAnyPlatform = not . isAbsoluteOnAnyPlatform --isRelativeOnAnyPlatform :: FilePath -> Bool instance GHC.Classes.Eq Distribution.Simple.Utils.TraceWhen module Distribution.Utils.NubList -- | NubList : A de-duplicated list that maintains the original order. data NubList a -- | Smart constructor for the NubList type. toNubList :: Ord a => [a] -> NubList a fromNubList :: NubList a -> [a] -- | Lift a function over lists to a function over NubLists. overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a -- | NubListR : A right-biased version of NubList. That is -- toNubListR ["-XNoFoo", "-XFoo", "-XNoFoo"] will result in -- ["-XFoo", "-XNoFoo"], unlike the normal NubList, which -- is left-biased. Built on top of ordNubRight and -- listUnionRight. data NubListR a -- | Smart constructor for the NubListR type. toNubListR :: Ord a => [a] -> NubListR a fromNubListR :: NubListR a -> [a] -- | Lift a function over lists to a function over NubListRs. overNubListR :: Ord a => ([a] -> [a]) -> NubListR a -> NubListR a instance GHC.Generics.Generic (Distribution.Utils.NubList.NubList a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Utils.NubList.NubList a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Utils.NubList.NubListR a) instance GHC.Classes.Ord a => GHC.Base.Monoid (Distribution.Utils.NubList.NubListR a) instance GHC.Classes.Ord a => GHC.Base.Semigroup (Distribution.Utils.NubList.NubListR a) instance GHC.Show.Show a => GHC.Show.Show (Distribution.Utils.NubList.NubListR a) instance (GHC.Classes.Ord a, GHC.Read.Read a) => GHC.Read.Read (Distribution.Utils.NubList.NubListR a) instance GHC.Classes.Ord a => GHC.Base.Monoid (Distribution.Utils.NubList.NubList a) instance GHC.Classes.Ord a => GHC.Base.Semigroup (Distribution.Utils.NubList.NubList a) instance GHC.Show.Show a => GHC.Show.Show (Distribution.Utils.NubList.NubList a) instance (GHC.Classes.Ord a, GHC.Read.Read a) => GHC.Read.Read (Distribution.Utils.NubList.NubList a) instance (GHC.Classes.Ord a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Distribution.Utils.NubList.NubList a) instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (Distribution.Utils.NubList.NubList a) module Distribution.Utils.LogProgress -- | The Progress monad with specialized logging and error messages. data LogProgress a -- | Run LogProgress, outputting traces according to -- Verbosity, die if there is an error. runLogProgress :: Verbosity -> LogProgress a -> IO a -- | Output a warning trace message in LogProgress. warnProgress :: Doc -> LogProgress () -- | Output an informational trace message in LogProgress. infoProgress :: Doc -> LogProgress () -- | Fail the computation with an error message. dieProgress :: Doc -> LogProgress a -- | Add a message to the error/warning context. addProgressCtx :: CtxMsg -> LogProgress a -> LogProgress a instance GHC.Base.Functor Distribution.Utils.LogProgress.LogProgress instance GHC.Base.Applicative Distribution.Utils.LogProgress.LogProgress instance GHC.Base.Monad Distribution.Utils.LogProgress.LogProgress module Distribution.Simple.Program.ResponseFile withResponseFile :: Verbosity -> TempFileOptions -> FilePath -> FilePath -> Maybe TextEncoding -> [String] -> (FilePath -> IO a) -> IO a -- | A somewhat extended notion of the normal program search path concept. -- -- Usually when finding executables we just want to look in the usual -- places using the OS's usual method for doing so. In Haskell the normal -- OS-specific method is captured by findExecutable. On all common -- OSs that makes use of a PATH environment variable, (though on -- Windows it is not just the PATH). -- -- However it is sometimes useful to be able to look in additional -- locations without having to change the process-global PATH -- environment variable. So we need an extension of the usual -- findExecutable that can look in additional locations, either -- before, after or instead of the normal OS locations. module Distribution.Simple.Program.Find -- | A search path to use when locating executables. This is analogous to -- the unix $PATH or win32 %PATH% but with the ability -- to use the system default method for finding executables -- (findExecutable which on unix is simply looking on the -- $PATH but on win32 is a bit more complicated). -- -- The default to use is [ProgSearchPathDefault] but you can add -- extra dirs either before, after or instead of the default, e.g. here -- we add an extra dir to search after the usual ones. -- --
-- ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir] --type ProgramSearchPath = [ProgramSearchPathEntry] data ProgramSearchPathEntry -- | A specific dir ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry -- | The system default ProgramSearchPathDefault :: ProgramSearchPathEntry defaultProgramSearchPath :: ProgramSearchPath findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath])) -- | Interpret a ProgramSearchPath to construct a new $PATH -- env var. Note that this is close but not perfect because on Windows -- the search algorithm looks at more than just the %PATH%. programSearchPathAsPATHVar :: ProgramSearchPath -> IO String -- | Get the system search path. On Unix systems this is just the -- $PATH env var, but on windows it's a bit more complicated. getSystemSearchPath :: IO [FilePath] instance GHC.Generics.Generic Distribution.Simple.Program.Find.ProgramSearchPathEntry instance GHC.Classes.Eq Distribution.Simple.Program.Find.ProgramSearchPathEntry instance Data.Binary.Class.Binary Distribution.Simple.Program.Find.ProgramSearchPathEntry instance Distribution.Utils.Structured.Structured Distribution.Simple.Program.Find.ProgramSearchPathEntry -- | This provides an abstraction which deals with configuring and running -- programs. A Program is a static notion of a known program. A -- ConfiguredProgram is a Program that has been found on -- the current machine and is ready to be run (possibly with some -- user-supplied default args). Configuring a program involves finding -- its location and if necessary finding its version. There's reasonable -- default behavior for trying to find "foo" in PATH, being able to -- override its location, etc. module Distribution.Simple.Program.Types -- | 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] -- | A search path to use when locating executables. This is analogous to -- the unix $PATH or win32 %PATH% but with the ability -- to use the system default method for finding executables -- (findExecutable which on unix is simply looking on the -- $PATH but on win32 is a bit more complicated). -- -- The default to use is [ProgSearchPathDefault] but you can add -- extra dirs either before, after or instead of the default, e.g. here -- we add an extra dir to search after the usual ones. -- --
-- ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir] --type ProgramSearchPath = [ProgramSearchPathEntry] data ProgramSearchPathEntry -- | A specific dir ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry -- | The system default ProgramSearchPathDefault :: ProgramSearchPathEntry -- | 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
-- | 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]
-- | The full path of a configured program.
programPath :: ConfiguredProgram -> FilePath
-- | Suppress any extra arguments added by the user.
suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram
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
-- | Make a simple ConfiguredProgram.
--
-- -- simpleConfiguredProgram "foo" (FoundOnSystem path) --simpleConfiguredProgram :: String -> ProgramLocation -> ConfiguredProgram instance GHC.Show.Show Distribution.Simple.Program.Types.ProgramLocation instance GHC.Read.Read Distribution.Simple.Program.Types.ProgramLocation instance GHC.Generics.Generic Distribution.Simple.Program.Types.ProgramLocation instance GHC.Classes.Eq Distribution.Simple.Program.Types.ProgramLocation instance GHC.Show.Show Distribution.Simple.Program.Types.ConfiguredProgram instance GHC.Read.Read Distribution.Simple.Program.Types.ConfiguredProgram instance GHC.Generics.Generic Distribution.Simple.Program.Types.ConfiguredProgram instance GHC.Classes.Eq Distribution.Simple.Program.Types.ConfiguredProgram instance GHC.Show.Show Distribution.Simple.Program.Types.Program instance Data.Binary.Class.Binary Distribution.Simple.Program.Types.ConfiguredProgram instance Distribution.Utils.Structured.Structured Distribution.Simple.Program.Types.ConfiguredProgram instance Data.Binary.Class.Binary Distribution.Simple.Program.Types.ProgramLocation instance Distribution.Utils.Structured.Structured Distribution.Simple.Program.Types.ProgramLocation -- | This module provides a data type for program invocations and functions -- to run them. module Distribution.Simple.Program.Run -- | Represents a specific invocation of a specific program. -- -- This is used as an intermediate type between deciding how to call a -- program and actually doing it. This provides the opportunity to the -- caller to adjust how the program will be called. These invocations can -- either be run directly or turned into shell or batch scripts. data ProgramInvocation ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> [FilePath] -> Maybe FilePath -> Maybe IOData -> IOEncoding -> IOEncoding -> ProgramInvocation [progInvokePath] :: ProgramInvocation -> FilePath [progInvokeArgs] :: ProgramInvocation -> [String] [progInvokeEnv] :: ProgramInvocation -> [(String, Maybe String)] [progInvokePathEnv] :: ProgramInvocation -> [FilePath] [progInvokeCwd] :: ProgramInvocation -> Maybe FilePath [progInvokeInput] :: ProgramInvocation -> Maybe IOData -- | TODO: remove this, make user decide when constructing -- progInvokeInput. [progInvokeInputEncoding] :: ProgramInvocation -> IOEncoding [progInvokeOutputEncoding] :: ProgramInvocation -> IOEncoding data IOEncoding IOEncodingText :: IOEncoding IOEncodingUTF8 :: IOEncoding emptyProgramInvocation :: ProgramInvocation simpleProgramInvocation :: FilePath -> [String] -> ProgramInvocation programInvocation :: ConfiguredProgram -> [String] -> ProgramInvocation -- | Like the unix xargs program. Useful for when we've got very long -- command lines that might overflow an OS limit on command line length -- and so you need to invoke a command multiple times to get all the args -- in. -- -- It takes four template invocations corresponding to the simple, -- initial, middle and last invocations. If the number of args given is -- small enough that we can get away with just a single invocation then -- the simple one is used: -- --
-- $ simple args ---- -- If the number of args given means that we need to use multiple -- invocations then the templates for the initial, middle and last -- invocations are used: -- --
-- $ initial args_0 -- $ middle args_1 -- $ middle args_2 -- ... -- $ final args_n --multiStageProgramInvocation :: ProgramInvocation -> (ProgramInvocation, ProgramInvocation, ProgramInvocation) -> [String] -> [ProgramInvocation] runProgramInvocation :: Verbosity -> ProgramInvocation -> IO () getProgramInvocationOutput :: Verbosity -> ProgramInvocation -> IO String getProgramInvocationLBS :: Verbosity -> ProgramInvocation -> IO ByteString getProgramInvocationOutputAndErrors :: Verbosity -> ProgramInvocation -> IO (String, String, ExitCode) -- | Return the current environment extended with the given overrides. If -- an entry is specified twice in overrides, the second entry -- takes precedence. getEffectiveEnvironment :: [(String, Maybe String)] -> IO (Maybe [(String, String)]) -- | This module provides an library interface to the hc-pkg -- program. Currently only GHC and LHC have hc-pkg programs. module Distribution.Simple.Program.Script -- | Generate a system script, either POSIX shell script or Windows batch -- file as appropriate for the given system. invocationAsSystemScript :: OS -> ProgramInvocation -> String -- | Generate a POSIX shell script that invokes a program. invocationAsShellScript :: ProgramInvocation -> String -- | Generate a Windows batch file that invokes a program. invocationAsBatchFile :: ProgramInvocation -> String -- | This module provides an library interface to the hpc program. module Distribution.Simple.Program.Hpc -- | Invoke hpc with the given parameters. -- -- Prior to HPC version 0.7 (packaged with GHC 7.8), hpc did not handle -- multiple .mix paths correctly, so we print a warning, and only pass it -- the first path in the list. This means that e.g. test suites that -- import their library as a dependency can still work, but those that -- include the library modules directly (in other-modules) don't. markup :: ConfiguredProgram -> Version -> Verbosity -> FilePath -> [FilePath] -> FilePath -> [ModuleName] -> IO () union :: ConfiguredProgram -> Verbosity -> [FilePath] -> FilePath -> [ModuleName] -> IO () -- | An index of packages whose primary key is UnitId. Public -- libraries are additionally indexed by PackageName and -- Version. Technically, these are an index of *units* (so we -- should eventually rename it to UnitIndex); but in the absence -- of internal libraries or Backpack each unit is equivalent to a -- package. -- -- While PackageIndex is parametric over what it actually records, -- it is in fact only ever instantiated with a single element: The -- InstalledPackageIndex (defined here) contains a graph of -- InstalledPackageInfos representing the packages in a package -- database stack. It is used in a variety of ways: -- --
-- if compilerCompatFlavor GHC compiler then ... else ... --compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool -- | Is this compiler compatible with the compiler flavour we're interested -- in, and if so what version does it claim to be compatible with. -- -- For example this checks if the compiler is actually GHC-7.x or is -- another compiler that claims to be compatible with some GHC-7.x -- version. -- --
-- case compilerCompatVersion GHC compiler of -- Just (Version (7:_)) -> ... -- _ -> ... --compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version compilerInfo :: Compiler -> CompilerInfo -- | Some compilers have a notion of a database of available packages. For -- some there is just one global db of packages, other compilers support -- a per-user or an arbitrary db specified at some location in the file -- system. This can be used to build isolated environments of packages, -- for example to build a collection of related packages without -- installing them globally. data PackageDB GlobalPackageDB :: PackageDB UserPackageDB :: PackageDB SpecificPackageDB :: FilePath -> PackageDB -- | We typically get packages from several databases, and stack them -- together. This type lets us be explicit about that stacking. For -- example typical stacks include: -- --
-- [GlobalPackageDB] -- [GlobalPackageDB, UserPackageDB] -- [GlobalPackageDB, SpecificPackageDB "package.conf.inplace"] ---- -- Note that the GlobalPackageDB is invariably at the bottom since -- it contains the rts, base and other special compiler-specific -- packages. -- -- We are not restricted to using just the above combinations. In -- particular we can use several custom package dbs and the user package -- db together. -- -- When it comes to writing, the top most (last) package is used. type PackageDBStack = [PackageDB] -- | Return the package that we should register into. This is the package -- db at the top of the stack. registrationPackageDB :: PackageDBStack -> PackageDB -- | Make package paths absolute absolutePackageDBPaths :: PackageDBStack -> IO PackageDBStack absolutePackageDBPath :: PackageDB -> IO PackageDB -- | Some compilers support optimising. Some have different levels. For -- compilers that do not the level is just capped to the level they do -- support. data OptimisationLevel NoOptimisation :: OptimisationLevel NormalOptimisation :: OptimisationLevel MaximumOptimisation :: OptimisationLevel flagToOptimisationLevel :: Maybe String -> OptimisationLevel -- | Some compilers support emitting debug info. Some have different -- levels. For compilers that do not the level is just capped to the -- level they do support. data DebugInfoLevel NoDebugInfo :: DebugInfoLevel MinimalDebugInfo :: DebugInfoLevel NormalDebugInfo :: DebugInfoLevel MaximalDebugInfo :: DebugInfoLevel flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel type CompilerFlag = String languageToFlags :: Compiler -> Maybe Language -> [CompilerFlag] unsupportedLanguages :: Compiler -> [Language] -> [Language] -- | For the given compiler, return the flags for the supported extensions. extensionsToFlags :: Compiler -> [Extension] -> [CompilerFlag] -- | For the given compiler, return the extensions it does not support. unsupportedExtensions :: Compiler -> [Extension] -> [Extension] -- | Does this compiler support parallel --make mode? parmakeSupported :: Compiler -> Bool -- | Does this compiler support reexported-modules? reexportedModulesSupported :: Compiler -> Bool -- | Does this compiler support thinning/renaming on package flags? renamingPackageFlagsSupported :: Compiler -> Bool -- | Does this compiler have unified IPIDs (so no package keys) unifiedIPIDRequired :: Compiler -> Bool -- | Does this compiler support package keys? packageKeySupported :: Compiler -> Bool -- | Does this compiler support unit IDs? unitIdSupported :: Compiler -> Bool -- | Does this compiler support Haskell program coverage? coverageSupported :: Compiler -> Bool -- | Does this compiler support profiling? profilingSupported :: Compiler -> Bool -- | Does this compiler support Backpack? backpackSupported :: Compiler -> Bool -- | Does this compiler's "ar" command supports response file arguments -- (i.e. @file-style arguments). arResponseFilesSupported :: Compiler -> Bool -- | Does this compiler's "ar" command support llvm-ar's -L flag, which -- compels the archiver to add an input archive's members rather than -- adding the archive itself. arDashLSupported :: Compiler -> Bool -- | Does this compiler support a package database entry with: -- "dynamic-library-dirs"? libraryDynDirSupported :: Compiler -> Bool -- | Does this compiler support a package database entry with: -- "visibility"? libraryVisibilitySupported :: Compiler -> Bool -- | Some compilers (notably GHC) support profiling and can instrument -- programs so the system can account costs to different functions. There -- are different levels of detail that can be used for this accounting. -- For compilers that do not support this notion or the particular detail -- levels, this is either ignored or just capped to some similar level -- they do support. data ProfDetailLevel ProfDetailNone :: ProfDetailLevel ProfDetailDefault :: ProfDetailLevel ProfDetailExportedFunctions :: ProfDetailLevel ProfDetailToplevelFunctions :: ProfDetailLevel ProfDetailAllFunctions :: ProfDetailLevel ProfDetailTopLate :: ProfDetailLevel ProfDetailOther :: String -> ProfDetailLevel knownProfDetailLevels :: [(String, [String], ProfDetailLevel)] flagToProfDetailLevel :: String -> ProfDetailLevel showProfDetailLevel :: ProfDetailLevel -> String instance GHC.Read.Read Distribution.Simple.Compiler.PackageDB instance GHC.Show.Show Distribution.Simple.Compiler.PackageDB instance GHC.Classes.Ord Distribution.Simple.Compiler.PackageDB instance GHC.Generics.Generic Distribution.Simple.Compiler.PackageDB instance GHC.Classes.Eq Distribution.Simple.Compiler.PackageDB instance GHC.Show.Show Distribution.Simple.Compiler.OptimisationLevel instance GHC.Read.Read Distribution.Simple.Compiler.OptimisationLevel instance GHC.Generics.Generic Distribution.Simple.Compiler.OptimisationLevel instance GHC.Classes.Eq Distribution.Simple.Compiler.OptimisationLevel instance GHC.Enum.Enum Distribution.Simple.Compiler.OptimisationLevel instance GHC.Enum.Bounded Distribution.Simple.Compiler.OptimisationLevel instance GHC.Show.Show Distribution.Simple.Compiler.DebugInfoLevel instance GHC.Read.Read Distribution.Simple.Compiler.DebugInfoLevel instance GHC.Generics.Generic Distribution.Simple.Compiler.DebugInfoLevel instance GHC.Classes.Eq Distribution.Simple.Compiler.DebugInfoLevel instance GHC.Enum.Enum Distribution.Simple.Compiler.DebugInfoLevel instance GHC.Enum.Bounded Distribution.Simple.Compiler.DebugInfoLevel instance GHC.Read.Read Distribution.Simple.Compiler.Compiler instance GHC.Show.Show Distribution.Simple.Compiler.Compiler instance GHC.Generics.Generic Distribution.Simple.Compiler.Compiler instance GHC.Classes.Eq Distribution.Simple.Compiler.Compiler instance GHC.Show.Show Distribution.Simple.Compiler.ProfDetailLevel instance GHC.Read.Read Distribution.Simple.Compiler.ProfDetailLevel instance GHC.Generics.Generic Distribution.Simple.Compiler.ProfDetailLevel instance GHC.Classes.Eq Distribution.Simple.Compiler.ProfDetailLevel instance Data.Binary.Class.Binary Distribution.Simple.Compiler.ProfDetailLevel instance Distribution.Utils.Structured.Structured Distribution.Simple.Compiler.ProfDetailLevel instance Data.Binary.Class.Binary Distribution.Simple.Compiler.Compiler instance Distribution.Utils.Structured.Structured Distribution.Simple.Compiler.Compiler instance Data.Binary.Class.Binary Distribution.Simple.Compiler.DebugInfoLevel instance Distribution.Utils.Structured.Structured Distribution.Simple.Compiler.DebugInfoLevel instance Data.Binary.Class.Binary Distribution.Simple.Compiler.OptimisationLevel instance Distribution.Utils.Structured.Structured Distribution.Simple.Compiler.OptimisationLevel instance Data.Binary.Class.Binary Distribution.Simple.Compiler.PackageDB instance Distribution.Utils.Structured.Structured Distribution.Simple.Compiler.PackageDB -- | This module provides an library interface to the hc-pkg -- program. Currently only GHC and GHCJS have hc-pkg programs. module Distribution.Simple.Program.HcPkg -- | Information about the features and capabilities of an hc-pkg -- program. data HcPkgInfo HcPkgInfo :: ConfiguredProgram -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> HcPkgInfo [hcPkgProgram] :: HcPkgInfo -> ConfiguredProgram -- | no package DB stack supported [noPkgDbStack] :: HcPkgInfo -> Bool -- | hc-pkg does not support verbosity flags [noVerboseFlag] :: HcPkgInfo -> Bool -- | use package-conf option instead of package-db [flagPackageConf] :: HcPkgInfo -> Bool -- | supports directory style package databases [supportsDirDbs] :: HcPkgInfo -> Bool -- | requires directory style package databases [requiresDirDbs] :: HcPkgInfo -> Bool -- | supports --enable-multi-instance flag [nativeMultiInstance] :: HcPkgInfo -> Bool -- | supports multi-instance via recache [recacheMultiInstance] :: HcPkgInfo -> Bool -- | supports --force-files or equivalent [suppressFilesCheck] :: HcPkgInfo -> Bool -- | Additional variations in the behaviour for register. data RegisterOptions RegisterOptions :: Bool -> Bool -> Bool -> RegisterOptions -- | Allows re-registering / overwriting an existing package [registerAllowOverwrite] :: RegisterOptions -> Bool -- | Insist on the ability to register multiple instances of a single -- version of a single package. This will fail if the hc-pkg -- does not support it, see nativeMultiInstance and -- recacheMultiInstance. [registerMultiInstance] :: RegisterOptions -> Bool -- | Require that no checks are performed on the existence of package files -- mentioned in the registration info. This must be used if registering -- prior to putting the files in their final place. This will fail if the -- hc-pkg does not support it, see suppressFilesCheck. [registerSuppressFilesCheck] :: RegisterOptions -> Bool -- | Defaults are True, False and False defaultRegisterOptions :: RegisterOptions -- | Call hc-pkg to initialise a package database at the location -- {path}. -- --
-- hc-pkg init {path}
--
init :: HcPkgInfo -> Verbosity -> Bool -> FilePath -> IO ()
-- | Run hc-pkg using a given package DB stack, directly
-- forwarding the provided command-line arguments to it.
invoke :: HcPkgInfo -> Verbosity -> PackageDBStack -> [String] -> IO ()
-- | Call hc-pkg to register a package.
--
--
-- hc-pkg register {filename | -} [--user | --global | --package-db]
--
register :: HcPkgInfo -> Verbosity -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> IO ()
-- | Call hc-pkg to unregister a package
--
-- -- hc-pkg unregister [pkgid] [--user | --global | --package-db] --unregister :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO () -- | Call hc-pkg to recache the registered packages. -- --
-- hc-pkg recache [--user | --global | --package-db] --recache :: HcPkgInfo -> Verbosity -> PackageDB -> IO () -- | Call hc-pkg to expose a package. -- --
-- hc-pkg expose [pkgid] [--user | --global | --package-db] --expose :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO () -- | Call hc-pkg to hide a package. -- --
-- hc-pkg hide [pkgid] [--user | --global | --package-db] --hide :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO () -- | Call hc-pkg to get all the details of all the packages in the -- given package database. dump :: HcPkgInfo -> Verbosity -> PackageDB -> IO [InstalledPackageInfo] -- | Call hc-pkg to retrieve a specific package -- --
-- hc-pkg describe [pkgid] [--user | --global | --package-db] --describe :: HcPkgInfo -> Verbosity -> PackageDBStack -> PackageId -> IO [InstalledPackageInfo] -- | Call hc-pkg to get the source package Id of all the packages -- in the given package database. -- -- This is much less information than with dump, but also rather -- quicker. Note in particular that it does not include the -- UnitId, just the source PackageId which is not -- necessarily unique in any package db. list :: HcPkgInfo -> Verbosity -> PackageDB -> IO [PackageId] initInvocation :: HcPkgInfo -> Verbosity -> FilePath -> ProgramInvocation registerInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> ProgramInvocation unregisterInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation recacheInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation exposeInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation hideInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation dumpInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation describeInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> PackageId -> ProgramInvocation listInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation module Distribution.Simple.Program.GHC -- | A structured set of GHC options/flags -- -- Note that options containing lists fall into two categories: -- --
-- ghc -c --GhcModeCompile :: GhcMode -- |
-- ghc --GhcModeLink :: GhcMode -- |
-- ghc --make --GhcModeMake :: GhcMode -- | ghci / ghc --interactive GhcModeInteractive :: GhcMode -- | ghc --abi-hash | GhcModeDepAnalysis -- ^ ghc -M | -- GhcModeEvaluate -- ^ ghc -e GhcModeAbiHash :: GhcMode data GhcOptimisation -- |
-- -O0 --GhcNoOptimisation :: GhcOptimisation -- |
-- -O --GhcNormalOptimisation :: GhcOptimisation -- |
-- -O2 --GhcMaximumOptimisation :: GhcOptimisation -- | e.g. -Odph GhcSpecialOptimisation :: String -> GhcOptimisation data GhcDynLinkMode -- |
-- -static --GhcStaticOnly :: GhcDynLinkMode -- |
-- -dynamic --GhcDynamicOnly :: GhcDynLinkMode -- |
-- -static -dynamic-too --GhcStaticAndDynamic :: GhcDynLinkMode data GhcProfAuto -- |
-- -fprof-auto --GhcProfAutoAll :: GhcProfAuto -- |
-- -fprof-auto-top --GhcProfAutoToplevel :: GhcProfAuto -- |
-- -fprof-auto-exported --GhcProfAutoExported :: GhcProfAuto -- | @-fprof-late GhcProfLate :: GhcProfAuto ghcInvocation :: ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> ProgramInvocation renderGhcOptions :: Compiler -> Platform -> GhcOptions -> [String] runGHC :: Verbosity -> ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> IO () -- | GHC >= 7.6 uses the '-package-db' flag. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/5977. packageDbArgsDb :: PackageDBStack -> [String] normaliseGhcArgs :: Maybe Version -> PackageDescription -> [String] -> [String] instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcMode instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcMode instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcOptimisation instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcOptimisation instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcDynLinkMode instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcDynLinkMode instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcProfAuto instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcProfAuto instance GHC.Generics.Generic Distribution.Simple.Program.GHC.GhcOptions instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcOptions instance GHC.Base.Monoid Distribution.Simple.Program.GHC.GhcOptions instance GHC.Base.Semigroup Distribution.Simple.Program.GHC.GhcOptions -- | The module defines all the known built-in Programs. -- -- Where possible we try to find their version numbers. module Distribution.Simple.Program.Builtin -- | The default list of programs. These programs are typically used -- internally to Cabal. builtinPrograms :: [Program] ghcProgram :: Program ghcPkgProgram :: Program runghcProgram :: Program ghcjsProgram :: Program ghcjsPkgProgram :: Program hmakeProgram :: Program jhcProgram :: Program haskellSuiteProgram :: Program haskellSuitePkgProgram :: Program uhcProgram :: Program gccProgram :: Program arProgram :: Program stripProgram :: Program happyProgram :: Program alexProgram :: Program hsc2hsProgram :: Program c2hsProgram :: Program cpphsProgram :: Program hscolourProgram :: Program doctestProgram :: Program haddockProgram :: Program greencardProgram :: Program ldProgram :: Program tarProgram :: Program cppProgram :: Program pkgConfigProgram :: Program hpcProgram :: Program -- | This provides a ProgramDb type which holds configured and -- not-yet configured programs. It is the parameter to lots of actions -- elsewhere in Cabal that need to look up and run programs. If we had a -- Cabal monad, the ProgramDb would probably be a reader or state -- component of it. -- -- One nice thing about using it is that any program that is registered -- with Cabal will get some "configure" and ".cabal" helpers like -- --with-foo-args --foo-path= and extra-foo-args. -- -- There's also a hook for adding programs in a Setup.lhs script. See -- hookedPrograms in UserHooks. This gives a hook user the ability -- to get the above flags and such so that they don't have to write all -- the PATH logic inside Setup.lhs. module Distribution.Simple.Program.Db -- | 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 emptyProgramDb :: ProgramDb defaultProgramDb :: ProgramDb -- | The Read/Show and Binary instances do not -- preserve all the unconfigured Programs because Program -- is not in Read/Show because it contains functions. So to -- fully restore a deserialised ProgramDb use this function to add -- back all the known Programs. -- --
-- ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir] --type ProgramSearchPath = [ProgramSearchPathEntry] data ProgramSearchPathEntry -- | A specific dir ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry -- | The system default ProgramSearchPathDefault :: ProgramSearchPathEntry -- | 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
findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath]))
defaultProgramSearchPath :: ProgramSearchPath
-- | Look for a program and try to find it's version number. It can accept
-- either an absolute path or the name of a program binary, in which case
-- we will look for the program on the path.
findProgramVersion :: String -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version)
-- | 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]
-- | The full path of a configured program.
programPath :: 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
-- | Runs the given configured program.
runProgram :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO ()
-- | Runs the given configured program and gets the output.
getProgramOutput :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO String
-- | Suppress any extra arguments added by the user.
suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram
-- | Represents a specific invocation of a specific program.
--
-- This is used as an intermediate type between deciding how to call a
-- program and actually doing it. This provides the opportunity to the
-- caller to adjust how the program will be called. These invocations can
-- either be run directly or turned into shell or batch scripts.
data ProgramInvocation
ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> [FilePath] -> Maybe FilePath -> Maybe IOData -> IOEncoding -> IOEncoding -> ProgramInvocation
[progInvokePath] :: ProgramInvocation -> FilePath
[progInvokeArgs] :: ProgramInvocation -> [String]
[progInvokeEnv] :: ProgramInvocation -> [(String, Maybe String)]
[progInvokePathEnv] :: ProgramInvocation -> [FilePath]
[progInvokeCwd] :: ProgramInvocation -> Maybe FilePath
[progInvokeInput] :: ProgramInvocation -> Maybe IOData
-- | TODO: remove this, make user decide when constructing
-- progInvokeInput.
[progInvokeInputEncoding] :: ProgramInvocation -> IOEncoding
[progInvokeOutputEncoding] :: ProgramInvocation -> IOEncoding
emptyProgramInvocation :: ProgramInvocation
simpleProgramInvocation :: FilePath -> [String] -> ProgramInvocation
programInvocation :: ConfiguredProgram -> [String] -> ProgramInvocation
runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
getProgramInvocationOutput :: Verbosity -> ProgramInvocation -> IO String
getProgramInvocationLBS :: Verbosity -> ProgramInvocation -> IO ByteString
-- | The default list of programs. These programs are typically used
-- internally to Cabal.
builtinPrograms :: [Program]
-- | 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
defaultProgramDb :: ProgramDb
emptyProgramDb :: ProgramDb
-- | The Read/Show and Binary instances do not
-- preserve all the unconfigured Programs because Program
-- is not in Read/Show because it contains functions. So to
-- fully restore a deserialised ProgramDb use this function to add
-- back all the known Programs.
--
-- -- splitArgs "--foo=\"C:/Program Files/Bar/" --baz" -- = ["--foo=C:/Program Files/Bar", "--baz"] ---- --
-- splitArgs "\"-DMSGSTR=\\\"foo bar\\\"\" --baz" -- = ["-DMSGSTR=\"foo bar\"","--baz"] --splitArgs :: String -> [String] defaultDistPref :: FilePath optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags -- | All flags are monoids, they come in two flavours: -- --
-- --ghc-option=foo --ghc-option=bar ---- -- gives us all the values ["foo", "bar"] -- --
-- --enable-foo --disable-foo ---- -- gives us Just False So this Flag type is for the latter singular kind -- of flag. Its monoid instance gives us the behaviour where it starts -- out as NoFlag and later flags override earlier ones. data Flag a Flag :: a -> Flag a NoFlag :: Flag a toFlag :: a -> Flag a fromFlag :: WithCallStack (Flag a -> a) fromFlagOrDefault :: a -> Flag a -> a flagToMaybe :: Flag a -> Maybe a flagToList :: Flag a -> [a] maybeToFlag :: Maybe a -> Flag a -- | Types that represent boolean flags. class BooleanFlag a asBool :: BooleanFlag a => a -> Bool boolOpt :: SFlags -> SFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a boolOpt' :: OptFlags -> OptFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a trueArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a falseArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a optionVerbosity :: (flags -> Flag Verbosity) -> (Flag Verbosity -> flags -> flags) -> OptionField flags optionNumJobs :: (flags -> Flag (Maybe Int)) -> (Flag (Maybe Int) -> flags -> flags) -> OptionField flags instance GHC.Generics.Generic Distribution.Simple.Setup.GlobalFlags instance GHC.Show.Show Distribution.Simple.Setup.ConfigFlags instance GHC.Read.Read Distribution.Simple.Setup.ConfigFlags instance GHC.Generics.Generic Distribution.Simple.Setup.ConfigFlags instance GHC.Generics.Generic Distribution.Simple.Setup.CopyFlags instance GHC.Show.Show Distribution.Simple.Setup.CopyFlags instance GHC.Generics.Generic Distribution.Simple.Setup.InstallFlags instance GHC.Show.Show Distribution.Simple.Setup.InstallFlags instance GHC.Generics.Generic Distribution.Simple.Setup.SDistFlags instance GHC.Show.Show Distribution.Simple.Setup.SDistFlags instance GHC.Generics.Generic Distribution.Simple.Setup.RegisterFlags instance GHC.Show.Show Distribution.Simple.Setup.RegisterFlags instance GHC.Generics.Generic Distribution.Simple.Setup.HscolourFlags instance GHC.Show.Show Distribution.Simple.Setup.HscolourFlags instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockTarget instance GHC.Show.Show Distribution.Simple.Setup.HaddockTarget instance GHC.Classes.Eq Distribution.Simple.Setup.HaddockTarget instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockFlags instance GHC.Show.Show Distribution.Simple.Setup.HaddockFlags instance GHC.Show.Show Distribution.Simple.Setup.Visibility instance GHC.Classes.Eq Distribution.Simple.Setup.Visibility instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockProjectFlags instance GHC.Show.Show Distribution.Simple.Setup.HaddockProjectFlags instance GHC.Generics.Generic Distribution.Simple.Setup.CleanFlags instance GHC.Show.Show Distribution.Simple.Setup.CleanFlags instance GHC.Generics.Generic Distribution.Simple.Setup.BuildFlags instance GHC.Show.Show Distribution.Simple.Setup.BuildFlags instance GHC.Read.Read Distribution.Simple.Setup.BuildFlags instance GHC.Generics.Generic Distribution.Simple.Setup.ReplOptions instance GHC.Show.Show Distribution.Simple.Setup.ReplOptions instance GHC.Generics.Generic Distribution.Simple.Setup.ReplFlags instance GHC.Show.Show Distribution.Simple.Setup.ReplFlags instance GHC.Show.Show Distribution.Simple.Setup.TestShowDetails instance GHC.Generics.Generic Distribution.Simple.Setup.TestShowDetails instance GHC.Enum.Bounded Distribution.Simple.Setup.TestShowDetails instance GHC.Enum.Enum Distribution.Simple.Setup.TestShowDetails instance GHC.Classes.Ord Distribution.Simple.Setup.TestShowDetails instance GHC.Classes.Eq Distribution.Simple.Setup.TestShowDetails instance GHC.Generics.Generic Distribution.Simple.Setup.TestFlags instance GHC.Show.Show Distribution.Simple.Setup.TestFlags instance GHC.Generics.Generic Distribution.Simple.Setup.BenchmarkFlags instance GHC.Show.Show Distribution.Simple.Setup.BenchmarkFlags instance GHC.Base.Monoid Distribution.Simple.Setup.BenchmarkFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.BenchmarkFlags instance GHC.Base.Monoid Distribution.Simple.Setup.TestFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.TestFlags instance Data.Binary.Class.Binary Distribution.Simple.Setup.TestShowDetails instance Distribution.Utils.Structured.Structured Distribution.Simple.Setup.TestShowDetails instance Distribution.Pretty.Pretty Distribution.Simple.Setup.TestShowDetails instance Distribution.Parsec.Parsec Distribution.Simple.Setup.TestShowDetails instance GHC.Base.Monoid Distribution.Simple.Setup.TestShowDetails instance GHC.Base.Semigroup Distribution.Simple.Setup.TestShowDetails instance GHC.Base.Monoid Distribution.Simple.Setup.ReplFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.ReplFlags instance Data.Binary.Class.Binary Distribution.Simple.Setup.ReplOptions instance Distribution.Utils.Structured.Structured Distribution.Simple.Setup.ReplOptions instance GHC.Base.Monoid Distribution.Simple.Setup.ReplOptions instance GHC.Base.Semigroup Distribution.Simple.Setup.ReplOptions instance GHC.Base.Monoid Distribution.Simple.Setup.BuildFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.BuildFlags instance GHC.Base.Monoid Distribution.Simple.Setup.CleanFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.CleanFlags instance GHC.Base.Monoid Distribution.Simple.Setup.HaddockProjectFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.HaddockProjectFlags instance GHC.Base.Monoid Distribution.Simple.Setup.HaddockFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.HaddockFlags instance Data.Binary.Class.Binary Distribution.Simple.Setup.HaddockTarget instance Distribution.Utils.Structured.Structured Distribution.Simple.Setup.HaddockTarget instance Distribution.Pretty.Pretty Distribution.Simple.Setup.HaddockTarget instance Distribution.Parsec.Parsec Distribution.Simple.Setup.HaddockTarget instance GHC.Base.Monoid Distribution.Simple.Setup.HscolourFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.HscolourFlags instance GHC.Base.Monoid Distribution.Simple.Setup.RegisterFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.RegisterFlags instance GHC.Base.Monoid Distribution.Simple.Setup.SDistFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.SDistFlags instance GHC.Base.Monoid Distribution.Simple.Setup.InstallFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.InstallFlags instance GHC.Base.Monoid Distribution.Simple.Setup.CopyFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.CopyFlags instance Data.Binary.Class.Binary Distribution.Simple.Setup.ConfigFlags instance Distribution.Utils.Structured.Structured Distribution.Simple.Setup.ConfigFlags instance GHC.Classes.Eq Distribution.Simple.Setup.ConfigFlags instance GHC.Base.Monoid Distribution.Simple.Setup.ConfigFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.ConfigFlags instance GHC.Base.Monoid Distribution.Simple.Setup.GlobalFlags instance GHC.Base.Semigroup Distribution.Simple.Setup.GlobalFlags module Distribution.Types.LocalBuildInfo -- | Data cached after configuration step. See also ConfigFlags. data LocalBuildInfo LocalBuildInfo :: ConfigFlags -> FlagAssignment -> ComponentRequestedSpec -> [String] -> InstallDirTemplates -> Compiler -> Platform -> FilePath -> Maybe FilePath -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -> InstalledPackageIndex -> Maybe FilePath -> PackageDescription -> ProgramDb -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PathTemplate -> PathTemplate -> Bool -> LocalBuildInfo -- | Options passed to the configuration step. Needed to re-run -- configuration when .cabal is out of date [configFlags] :: LocalBuildInfo -> ConfigFlags -- | The final set of flags which were picked for this package [flagAssignment] :: LocalBuildInfo -> FlagAssignment -- | What components were enabled during configuration, and why. [componentEnabledSpec] :: LocalBuildInfo -> ComponentRequestedSpec -- | Extra args on the command line for the configuration step. Needed to -- re-run configuration when .cabal is out of date [extraConfigArgs] :: LocalBuildInfo -> [String] -- | The installation directories for the various different kinds of files -- TODO: inplaceDirTemplates :: InstallDirs FilePath [installDirTemplates] :: LocalBuildInfo -> InstallDirTemplates -- | The compiler we're building with [compiler] :: LocalBuildInfo -> Compiler -- | The platform we're building for [hostPlatform] :: LocalBuildInfo -> Platform -- | Where to build the package. [buildDir] :: LocalBuildInfo -> FilePath -- | Path to the cabal file, if given during configuration. [cabalFilePath] :: LocalBuildInfo -> Maybe FilePath -- | All the components to build, ordered by topological sort, and with -- their INTERNAL dependencies over the intrapackage dependency graph. -- TODO: this is assumed to be short; otherwise we want some sort of -- ordered map. [componentGraph] :: LocalBuildInfo -> Graph ComponentLocalBuildInfo -- | A map from component name to all matching components. These coincide -- with componentGraph [componentNameMap] :: LocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -- | All the info about the installed packages that the current package -- depends on (directly or indirectly). The copy saved on disk does NOT -- include internal dependencies (because we just don't have enough -- information at this point to have an InstalledPackageInfo for -- an internal dep), but we will often update it with the internal -- dependencies; see for example build. (This admonition doesn't -- apply for per-component builds.) [installedPkgs] :: LocalBuildInfo -> InstalledPackageIndex -- | the filename containing the .cabal file, if available [pkgDescrFile] :: LocalBuildInfo -> Maybe FilePath -- | WARNING WARNING WARNING Be VERY careful about using this function; we -- haven't deprecated it but using it could introduce subtle bugs related -- to HookedBuildInfo. -- -- In principle, this is supposed to contain the resolved package -- description, that does not contain any conditionals. However, it MAY -- NOT contain the description with a HookedBuildInfo applied to -- it; see HookedBuildInfo for the whole sordid saga. As much as -- possible, Cabal library should avoid using this parameter. [localPkgDescr] :: LocalBuildInfo -> PackageDescription -- | Location and args for all programs [withPrograms] :: LocalBuildInfo -> ProgramDb -- | What package database to use, global/user [withPackageDB] :: LocalBuildInfo -> PackageDBStack -- | Whether to build normal libs. [withVanillaLib] :: LocalBuildInfo -> Bool -- | Whether to build profiling versions of libs. [withProfLib] :: LocalBuildInfo -> Bool -- | Whether to build shared versions of libs. [withSharedLib] :: LocalBuildInfo -> Bool -- | Whether to build static versions of libs (with all other libs rolled -- in) [withStaticLib] :: LocalBuildInfo -> Bool -- | Whether to link executables dynamically [withDynExe] :: LocalBuildInfo -> Bool -- | Whether to link executables fully statically [withFullyStaticExe] :: LocalBuildInfo -> Bool -- | Whether to build executables for profiling. [withProfExe] :: LocalBuildInfo -> Bool -- | Level of automatic profile detail. [withProfLibDetail] :: LocalBuildInfo -> ProfDetailLevel -- | Level of automatic profile detail. [withProfExeDetail] :: LocalBuildInfo -> ProfDetailLevel -- | Whether to build with optimization (if available). [withOptimization] :: LocalBuildInfo -> OptimisationLevel -- | Whether to emit debug info (if available). [withDebugInfo] :: LocalBuildInfo -> DebugInfoLevel -- | Whether to build libs suitable for use with GHCi. [withGHCiLib] :: LocalBuildInfo -> Bool -- | Use -split-sections with GHC, if available [splitSections] :: LocalBuildInfo -> Bool -- | Use -split-objs with GHC, if available [splitObjs] :: LocalBuildInfo -> Bool -- | Whether to strip executables during install [stripExes] :: LocalBuildInfo -> Bool -- | Whether to strip libraries during install [stripLibs] :: LocalBuildInfo -> Bool -- | Whether to enable executable program coverage [exeCoverage] :: LocalBuildInfo -> Bool -- | Whether to enable library program coverage [libCoverage] :: LocalBuildInfo -> Bool -- | Prefix to be prepended to installed executables [progPrefix] :: LocalBuildInfo -> PathTemplate -- | Suffix to be appended to installed executables [progSuffix] :: LocalBuildInfo -> PathTemplate [relocatable] :: LocalBuildInfo -> Bool -- | Extract the ComponentId from the public library component of a -- LocalBuildInfo if it exists, or make a fake component ID based -- on the package ID. localComponentId :: LocalBuildInfo -> ComponentId -- | Extract the UnitId from the library component of a -- LocalBuildInfo if it exists, or make a fake unit ID based on -- the package ID. localUnitId :: LocalBuildInfo -> UnitId -- | Extract the compatibility package key from the public library -- component of a LocalBuildInfo if it exists, or make a fake -- package key based on the package ID. localCompatPackageKey :: LocalBuildInfo -> String -- | Extract the PackageIdentifier of a LocalBuildInfo. This -- is a "safe" use of localPkgDescr localPackage :: LocalBuildInfo -> PackageId -- | Return all ComponentLocalBuildInfos associated with -- ComponentName. In the presence of Backpack there may be more -- than one! componentNameCLBIs :: LocalBuildInfo -> ComponentName -> [ComponentLocalBuildInfo] -- | Return all TargetInfos associated with ComponentName. In -- the presence of Backpack there may be more than one! Has a prime -- because it takes a PackageDescription argument which may -- disagree with localPkgDescr in LocalBuildInfo. componentNameTargets' :: PackageDescription -> LocalBuildInfo -> ComponentName -> [TargetInfo] unitIdTarget' :: PackageDescription -> LocalBuildInfo -> UnitId -> Maybe TargetInfo -- | Return the list of default TargetInfos associated with a -- configured package, in the order they need to be built. Has a prime -- because it takes a PackageDescription argument which may -- disagree with localPkgDescr in LocalBuildInfo. allTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [TargetInfo] -- | Execute f for every TargetInfo in the package, -- respecting the build dependency order. (TODO: We should use Shake!) -- Has a prime because it takes a PackageDescription argument -- which may disagree with localPkgDescr in LocalBuildInfo. withAllTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> (TargetInfo -> IO ()) -> IO () -- | Return the list of all targets needed to build the uids, in -- the order they need to be built. Has a prime because it takes a -- PackageDescription argument which may disagree with -- localPkgDescr in LocalBuildInfo. neededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> [TargetInfo] -- | Execute f for every TargetInfo needed to build -- uids, respecting the build dependency order. Has a prime -- because it takes a PackageDescription argument which may -- disagree with localPkgDescr in LocalBuildInfo. withNeededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO () -- | Is coverage enabled for test suites? In practice, this requires -- library and executable profiling to be enabled. testCoverage :: LocalBuildInfo -> Bool -- | Warning: By using this function, you may be introducing a bug where -- you retrieve a Component which does not have -- HookedBuildInfo applied to it. See the documentation for -- HookedBuildInfo for an explanation of the issue. If you have a -- PackageDescription handy (NOT from the LocalBuildInfo), -- try using the primed version of the function, which takes it as an -- extra argument. componentNameTargets :: LocalBuildInfo -> ComponentName -> [TargetInfo] -- | Warning: By using this function, you may be introducing a bug where -- you retrieve a Component which does not have -- HookedBuildInfo applied to it. See the documentation for -- HookedBuildInfo for an explanation of the issue. If you have a -- PackageDescription handy (NOT from the LocalBuildInfo), -- try using the primed version of the function, which takes it as an -- extra argument. unitIdTarget :: LocalBuildInfo -> UnitId -> Maybe TargetInfo -- | Warning: By using this function, you may be introducing a bug where -- you retrieve a Component which does not have -- HookedBuildInfo applied to it. See the documentation for -- HookedBuildInfo for an explanation of the issue. If you have a -- PackageDescription handy (NOT from the LocalBuildInfo), -- try using the primed version of the function, which takes it as an -- extra argument. allTargetsInBuildOrder :: LocalBuildInfo -> [TargetInfo] -- | Warning: By using this function, you may be introducing a bug where -- you retrieve a Component which does not have -- HookedBuildInfo applied to it. See the documentation for -- HookedBuildInfo for an explanation of the issue. If you have a -- PackageDescription handy (NOT from the LocalBuildInfo), -- try using the primed version of the function, which takes it as an -- extra argument. withAllTargetsInBuildOrder :: LocalBuildInfo -> (TargetInfo -> IO ()) -> IO () -- | Warning: By using this function, you may be introducing a bug where -- you retrieve a Component which does not have -- HookedBuildInfo applied to it. See the documentation for -- HookedBuildInfo for an explanation of the issue. If you have a -- PackageDescription handy (NOT from the LocalBuildInfo), -- try using the primed version of the function, which takes it as an -- extra argument. neededTargetsInBuildOrder :: LocalBuildInfo -> [UnitId] -> [TargetInfo] -- | Warning: By using this function, you may be introducing a bug where -- you retrieve a Component which does not have -- HookedBuildInfo applied to it. See the documentation for -- HookedBuildInfo for an explanation of the issue. If you have a -- PackageDescription handy (NOT from the LocalBuildInfo), -- try using the primed version of the function, which takes it as an -- extra argument. withNeededTargetsInBuildOrder :: LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO () instance GHC.Show.Show Distribution.Types.LocalBuildInfo.LocalBuildInfo instance GHC.Read.Read Distribution.Types.LocalBuildInfo.LocalBuildInfo instance GHC.Generics.Generic Distribution.Types.LocalBuildInfo.LocalBuildInfo instance Data.Binary.Class.Binary Distribution.Types.LocalBuildInfo.LocalBuildInfo instance Distribution.Utils.Structured.Structured Distribution.Types.LocalBuildInfo.LocalBuildInfo -- | Once a package has been configured we have resolved conditionals and -- dependencies, configured the compiler and other needed external -- programs. The LocalBuildInfo is used to hold all this -- information. It holds the install dirs, the compiler, the exact -- package dependencies, the configured programs, the package database to -- use and a bunch of miscellaneous configure flags. It gets saved and -- reloaded from a file (dist/setup-config). It gets passed in -- to very many subsequent build actions. module Distribution.Simple.LocalBuildInfo -- | Data cached after configuration step. See also ConfigFlags. data LocalBuildInfo LocalBuildInfo :: ConfigFlags -> FlagAssignment -> ComponentRequestedSpec -> [String] -> InstallDirTemplates -> Compiler -> Platform -> FilePath -> Maybe FilePath -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -> InstalledPackageIndex -> Maybe FilePath -> PackageDescription -> ProgramDb -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PathTemplate -> PathTemplate -> Bool -> LocalBuildInfo -- | Options passed to the configuration step. Needed to re-run -- configuration when .cabal is out of date [configFlags] :: LocalBuildInfo -> ConfigFlags -- | The final set of flags which were picked for this package [flagAssignment] :: LocalBuildInfo -> FlagAssignment -- | What components were enabled during configuration, and why. [componentEnabledSpec] :: LocalBuildInfo -> ComponentRequestedSpec -- | Extra args on the command line for the configuration step. Needed to -- re-run configuration when .cabal is out of date [extraConfigArgs] :: LocalBuildInfo -> [String] -- | The installation directories for the various different kinds of files -- TODO: inplaceDirTemplates :: InstallDirs FilePath [installDirTemplates] :: LocalBuildInfo -> InstallDirTemplates -- | The compiler we're building with [compiler] :: LocalBuildInfo -> Compiler -- | The platform we're building for [hostPlatform] :: LocalBuildInfo -> Platform -- | Where to build the package. [buildDir] :: LocalBuildInfo -> FilePath -- | Path to the cabal file, if given during configuration. [cabalFilePath] :: LocalBuildInfo -> Maybe FilePath -- | All the components to build, ordered by topological sort, and with -- their INTERNAL dependencies over the intrapackage dependency graph. -- TODO: this is assumed to be short; otherwise we want some sort of -- ordered map. [componentGraph] :: LocalBuildInfo -> Graph ComponentLocalBuildInfo -- | A map from component name to all matching components. These coincide -- with componentGraph [componentNameMap] :: LocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -- | All the info about the installed packages that the current package -- depends on (directly or indirectly). The copy saved on disk does NOT -- include internal dependencies (because we just don't have enough -- information at this point to have an InstalledPackageInfo for -- an internal dep), but we will often update it with the internal -- dependencies; see for example build. (This admonition doesn't -- apply for per-component builds.) [installedPkgs] :: LocalBuildInfo -> InstalledPackageIndex -- | the filename containing the .cabal file, if available [pkgDescrFile] :: LocalBuildInfo -> Maybe FilePath -- | WARNING WARNING WARNING Be VERY careful about using this function; we -- haven't deprecated it but using it could introduce subtle bugs related -- to HookedBuildInfo. -- -- In principle, this is supposed to contain the resolved package -- description, that does not contain any conditionals. However, it MAY -- NOT contain the description with a HookedBuildInfo applied to -- it; see HookedBuildInfo for the whole sordid saga. As much as -- possible, Cabal library should avoid using this parameter. [localPkgDescr] :: LocalBuildInfo -> PackageDescription -- | Location and args for all programs [withPrograms] :: LocalBuildInfo -> ProgramDb -- | What package database to use, global/user [withPackageDB] :: LocalBuildInfo -> PackageDBStack -- | Whether to build normal libs. [withVanillaLib] :: LocalBuildInfo -> Bool -- | Whether to build profiling versions of libs. [withProfLib] :: LocalBuildInfo -> Bool -- | Whether to build shared versions of libs. [withSharedLib] :: LocalBuildInfo -> Bool -- | Whether to build static versions of libs (with all other libs rolled -- in) [withStaticLib] :: LocalBuildInfo -> Bool -- | Whether to link executables dynamically [withDynExe] :: LocalBuildInfo -> Bool -- | Whether to link executables fully statically [withFullyStaticExe] :: LocalBuildInfo -> Bool -- | Whether to build executables for profiling. [withProfExe] :: LocalBuildInfo -> Bool -- | Level of automatic profile detail. [withProfLibDetail] :: LocalBuildInfo -> ProfDetailLevel -- | Level of automatic profile detail. [withProfExeDetail] :: LocalBuildInfo -> ProfDetailLevel -- | Whether to build with optimization (if available). [withOptimization] :: LocalBuildInfo -> OptimisationLevel -- | Whether to emit debug info (if available). [withDebugInfo] :: LocalBuildInfo -> DebugInfoLevel -- | Whether to build libs suitable for use with GHCi. [withGHCiLib] :: LocalBuildInfo -> Bool -- | Use -split-sections with GHC, if available [splitSections] :: LocalBuildInfo -> Bool -- | Use -split-objs with GHC, if available [splitObjs] :: LocalBuildInfo -> Bool -- | Whether to strip executables during install [stripExes] :: LocalBuildInfo -> Bool -- | Whether to strip libraries during install [stripLibs] :: LocalBuildInfo -> Bool -- | Whether to enable executable program coverage [exeCoverage] :: LocalBuildInfo -> Bool -- | Whether to enable library program coverage [libCoverage] :: LocalBuildInfo -> Bool -- | Prefix to be prepended to installed executables [progPrefix] :: LocalBuildInfo -> PathTemplate -- | Suffix to be appended to installed executables [progSuffix] :: LocalBuildInfo -> PathTemplate [relocatable] :: LocalBuildInfo -> Bool -- | Extract the ComponentId from the public library component of a -- LocalBuildInfo if it exists, or make a fake component ID based -- on the package ID. localComponentId :: LocalBuildInfo -> ComponentId -- | Extract the UnitId from the library component of a -- LocalBuildInfo if it exists, or make a fake unit ID based on -- the package ID. localUnitId :: LocalBuildInfo -> UnitId -- | Extract the compatibility package key from the public library -- component of a LocalBuildInfo if it exists, or make a fake -- package key based on the package ID. localCompatPackageKey :: LocalBuildInfo -> String 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 data LibraryName LMainLibName :: LibraryName LSubLibName :: UnqualComponentName -> LibraryName defaultLibName :: LibraryName showComponentName :: ComponentName -> String -- | This gets the underlying unqualified component name. In fact, it is -- guaranteed to uniquely identify a component, returning -- Nothing if the ComponentName was for the public -- library. componentNameString :: ComponentName -> Maybe UnqualComponentName -- | 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] componentBuildDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> FilePath foldComponent :: (Library -> a) -> (ForeignLib -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a componentName :: Component -> ComponentName componentBuildInfo :: Component -> BuildInfo -- | Is a component buildable (i.e., not marked with buildable: -- False)? See also this note in -- Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components. componentBuildable :: Component -> Bool -- | All the components in the package. pkgComponents :: PackageDescription -> [Component] -- | A list of all components in the package that are buildable, i.e., were -- not marked with buildable: False. This does NOT indicate if -- we are actually going to build the component, see -- enabledComponents instead. pkgBuildableComponents :: PackageDescription -> [Component] lookupComponent :: PackageDescription -> ComponentName -> Maybe Component getComponent :: PackageDescription -> ComponentName -> Component allComponentsInBuildOrder :: LocalBuildInfo -> [ComponentLocalBuildInfo] -- | Determine the directories containing the dynamic libraries of the -- transitive dependencies of the component we are building. -- -- When wanted, and possible, returns paths relative to the installDirs -- prefix depLibraryPaths :: Bool -> Bool -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO [FilePath] -- | Get all module names that needed to be built by GHC; i.e., all of -- these ModuleNames have interface files associated with them -- that need to be installed. allLibModules :: Library -> ComponentLocalBuildInfo -> [ModuleName] -- | Perform the action on each buildable Library or -- Executable (Component) in the PackageDescription, subject to -- the build order specified by the compBuildOrder field of the -- given LocalBuildInfo withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () -- | Perform the action on each enabled library in the package -- description with the ComponentLocalBuildInfo. withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO () -- | Perform the action on each enabled Executable in the package -- description. Extended version of withExe that also gives -- corresponding build info. withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO () -- | Perform the action on each enabled Benchmark in the package -- description. withBenchLBI :: PackageDescription -> LocalBuildInfo -> (Benchmark -> ComponentLocalBuildInfo -> IO ()) -> IO () withTestLBI :: PackageDescription -> LocalBuildInfo -> (TestSuite -> ComponentLocalBuildInfo -> IO ()) -> IO () enabledTestLBIs :: PackageDescription -> LocalBuildInfo -> [(TestSuite, ComponentLocalBuildInfo)] enabledBenchLBIs :: PackageDescription -> LocalBuildInfo -> [(Benchmark, ComponentLocalBuildInfo)] data PathTemplateVariable -- | The $prefix path variable PrefixVar :: PathTemplateVariable -- | The $bindir path variable BindirVar :: PathTemplateVariable -- | The $libdir path variable LibdirVar :: PathTemplateVariable -- | The $libsubdir path variable LibsubdirVar :: PathTemplateVariable -- | The $dynlibdir path variable DynlibdirVar :: PathTemplateVariable -- | The $datadir path variable DatadirVar :: PathTemplateVariable -- | The $datasubdir path variable DatasubdirVar :: PathTemplateVariable -- | The $docdir path variable DocdirVar :: PathTemplateVariable -- | The $htmldir path variable HtmldirVar :: PathTemplateVariable -- | The $pkg package name path variable PkgNameVar :: PathTemplateVariable -- | The $version package version path variable PkgVerVar :: PathTemplateVariable -- | The $pkgid package Id path variable, eg foo-1.0 PkgIdVar :: PathTemplateVariable -- | The $libname path variable LibNameVar :: PathTemplateVariable -- | The compiler name and version, eg ghc-6.6.1 CompilerVar :: PathTemplateVariable -- | The operating system name, eg windows or linux OSVar :: PathTemplateVariable -- | The CPU architecture name, eg i386 or x86_64 ArchVar :: PathTemplateVariable -- | The compiler's ABI identifier, AbiVar :: PathTemplateVariable -- | The optional ABI tag for the compiler AbiTagVar :: PathTemplateVariable -- | The executable name; used in shell wrappers ExecutableNameVar :: PathTemplateVariable -- | The name of the test suite being run TestSuiteNameVar :: PathTemplateVariable -- | The result of the test suite being run, eg pass, -- fail, or error. TestSuiteResultVar :: PathTemplateVariable -- | The name of the benchmark being run BenchmarkNameVar :: PathTemplateVariable type PathTemplateEnv = [(PathTemplateVariable, PathTemplate)] -- | An abstract path, possibly containing variables that need to be -- substituted for to get a real FilePath. data PathTemplate -- | The location prefix for the copy command. data CopyDest NoCopyDest :: CopyDest CopyTo :: FilePath -> CopyDest -- | when using the ${pkgroot} as prefix. The CopyToDb will adjust the -- paths to be relative to the provided package database when copying / -- installing. CopyToDb :: FilePath -> CopyDest -- | The installation directories in terms of PathTemplates that -- contain variables. -- -- The defaults for most of the directories are relative to each other, -- in particular they are all relative to a single prefix. This makes it -- convenient for the user to override the default installation directory -- by only having to specify --prefix=... rather than overriding each -- individually. This is done by allowing $-style variables in the dirs. -- These are expanded by textual substitution (see -- substPathTemplate). -- -- A few of these installation directories are split into two components, -- the dir and subdir. The full installation path is formed by combining -- the two together with /. The reason for this is compatibility -- with other Unix build systems which also support --libdir and -- --datadir. We would like users to be able to configure -- --libdir=/usr/lib64 for example but because by default we -- want to support installing multiple versions of packages and building -- the same package for multiple compilers we append the libsubdir to -- get: /usr/lib64/$libname/$compiler. -- -- An additional complication is the need to support relocatable packages -- on systems which support such things, like Windows. type InstallDirTemplates = InstallDirs PathTemplate -- | The directories where we will install files for packages. -- -- We have several different directories for different types of files -- since many systems have conventions whereby different types of files -- in a package are installed in different directories. This is -- particularly the case on Unix style systems. data InstallDirs dir InstallDirs :: dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> InstallDirs dir [prefix] :: InstallDirs dir -> dir [bindir] :: InstallDirs dir -> dir [libdir] :: InstallDirs dir -> dir [libsubdir] :: InstallDirs dir -> dir [dynlibdir] :: InstallDirs dir -> dir -- | foreign libraries [flibdir] :: InstallDirs dir -> dir [libexecdir] :: InstallDirs dir -> dir [libexecsubdir] :: InstallDirs dir -> dir [includedir] :: InstallDirs dir -> dir [datadir] :: InstallDirs dir -> dir [datasubdir] :: InstallDirs dir -> dir [docdir] :: InstallDirs dir -> dir [mandir] :: InstallDirs dir -> dir [htmldir] :: InstallDirs dir -> dir [haddockdir] :: InstallDirs dir -> dir [sysconfdir] :: InstallDirs dir -> dir combineInstallDirs :: (a -> b -> c) -> InstallDirs a -> InstallDirs b -> InstallDirs c defaultInstallDirs :: CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates defaultInstallDirs' :: Bool -> CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates -- | Substitute the install dir templates into each other. -- -- To prevent cyclic substitutions, only some variables are allowed in -- particular dir templates. If out of scope vars are present, they are -- not substituted for. Checking for any remaining unsubstituted vars can -- be done as a subsequent operation. -- -- The reason it is done this way is so that in -- prefixRelativeInstallDirs we can replace prefix with the -- PrefixVar and get resulting PathTemplates that still -- have the PrefixVar in them. Doing this makes it each to check -- which paths are relative to the $prefix. substituteInstallDirTemplates :: PathTemplateEnv -> InstallDirTemplates -> InstallDirTemplates -- | Convert a FilePath to a PathTemplate including any -- template vars. toPathTemplate :: FilePath -> PathTemplate -- | Convert back to a path, any remaining vars are included fromPathTemplate :: PathTemplate -> FilePath combinePathTemplate :: PathTemplate -> PathTemplate -> PathTemplate -- | The initial environment has all the static stuff but no paths initialPathTemplateEnv :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> PathTemplateEnv packageTemplateEnv :: PackageIdentifier -> UnitId -> PathTemplateEnv compilerTemplateEnv :: CompilerInfo -> PathTemplateEnv platformTemplateEnv :: Platform -> PathTemplateEnv abiTemplateEnv :: CompilerInfo -> Platform -> PathTemplateEnv installDirsTemplateEnv :: InstallDirs PathTemplate -> PathTemplateEnv -- | Backwards compatibility function which computes the InstallDirs -- assuming that $libname points to the public library (or some -- fake package identifier if there is no public library.) IF AT ALL -- POSSIBLE, please use absoluteComponentInstallDirs instead. absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath -- | Backwards compatibility function which computes the InstallDirs -- assuming that $libname points to the public library (or some -- fake package identifier if there is no public library.) IF AT ALL -- POSSIBLE, please use prefixRelativeComponentInstallDirs -- instead. prefixRelativeInstallDirs :: PackageId -> LocalBuildInfo -> InstallDirs (Maybe FilePath) absoluteInstallCommandDirs :: PackageDescription -> LocalBuildInfo -> UnitId -> CopyDest -> InstallDirs FilePath -- | See absoluteInstallDirs. absoluteComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> UnitId -> CopyDest -> InstallDirs FilePath -- | See prefixRelativeInstallDirs prefixRelativeComponentInstallDirs :: PackageId -> LocalBuildInfo -> UnitId -> InstallDirs (Maybe FilePath) substPathTemplate :: PackageId -> LocalBuildInfo -> UnitId -> PathTemplate -> FilePath -- | This module provides functions for locating various HPC-related paths -- and a function for adding the necessary options to a -- PackageDescription to build test suites with HPC enabled. module Distribution.Simple.Hpc data Way Vanilla :: Way Prof :: Way Dyn :: Way -- | Attempt to guess the way the test suites in this package were compiled -- and linked with the library so the correct module interfaces are -- found. guessWay :: LocalBuildInfo -> Way htmlDir :: FilePath -> Way -> FilePath -> FilePath mixDir :: FilePath -> Way -> FilePath -> FilePath tixDir :: FilePath -> Way -> FilePath -> FilePath -- | Path to the .tix file containing a test suite's sum statistics. tixFilePath :: FilePath -> Way -> FilePath -> FilePath -- | Generate the HTML markup for all of a package's test suites. markupPackage :: Verbosity -> LocalBuildInfo -> FilePath -> PackageDescription -> [TestSuite] -> IO () -- | Generate the HTML markup for a test suite. markupTest :: Verbosity -> LocalBuildInfo -> FilePath -> String -> TestSuite -> Library -> IO () instance GHC.Show.Show Distribution.Simple.Hpc.Way instance GHC.Read.Read Distribution.Simple.Hpc.Way instance GHC.Classes.Eq Distribution.Simple.Hpc.Way instance GHC.Enum.Enum Distribution.Simple.Hpc.Way instance GHC.Enum.Bounded Distribution.Simple.Hpc.Way -- | Generating the PackageInfo_pkgname module. -- -- This is a module that Cabal generates for the benefit of packages. It -- enables them to find their package informations. module Distribution.Simple.Build.PackageInfoModule generatePackageInfoModule :: PackageDescription -> LocalBuildInfo -> String -- | Generate cabal_macros.h - CPP macros for package version testing -- -- When using CPP you get -- --
-- VERSION_<package> -- MIN_VERSION_<package>(A,B,C) ---- -- for each package in build-depends, which is true if -- the version of package in use is >= A.B.C, using -- the normal ordering on version numbers. -- -- TODO Figure out what to do about backpack and internal libraries. It -- is very suspicious that this stuff works with munged package -- identifiers module Distribution.Simple.Build.Macros -- | The contents of the cabal_macros.h for the given configured -- package. generateCabalMacrosHeader :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> String -- | Helper function that generates just the VERSION_pkg and -- MIN_VERSION_pkg macros for a list of package ids (usually -- used with the specific deps of a configured package). generatePackageVersionMacros :: Version -> [PackageId] -> String -- | See -- https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst module Distribution.Backpack.ComponentsGraph -- | A graph of source-level components by their source-level dependencies type ComponentsGraph = Graph (Node ComponentName Component) -- | A list of components associated with the source level dependencies -- between them. type ComponentsWithDeps = [(Component, [ComponentName])] -- | Create a Graph of Component, or report a cycle if there -- is a problem. mkComponentsGraph :: ComponentRequestedSpec -> PackageDescription -> Either [ComponentName] ComponentsGraph -- | Given the package description and a PackageDescription (used to -- determine if a package name is internal or not), sort the components -- in dependency order (fewest dependencies first). This is NOT -- necessarily the build order (although it is in the absence of -- Backpack.) componentsGraphToList :: ComponentsGraph -> ComponentsWithDeps -- | Pretty-print ComponentsWithDeps. dispComponentsWithDeps :: ComponentsWithDeps -> Doc -- | Error message when there is a cycle; takes the SCC of components. componentCycleMsg :: PackageIdentifier -> [ComponentName] -> Doc module Distribution.Simple.Test.Log -- | Logs all test results for a package, broken down first by test suite -- and then by test case. data PackageLog PackageLog :: PackageId -> CompilerId -> Platform -> [TestSuiteLog] -> PackageLog [package] :: PackageLog -> PackageId [compiler] :: PackageLog -> CompilerId [platform] :: PackageLog -> Platform [testSuites] :: PackageLog -> [TestSuiteLog] data TestLogs TestLog :: String -> Options -> Result -> TestLogs [testName] :: TestLogs -> String [testOptionsReturned] :: TestLogs -> Options [testResult] :: TestLogs -> Result GroupLogs :: String -> [TestLogs] -> TestLogs -- | Logs test suite results, itemized by test case. data TestSuiteLog TestSuiteLog :: UnqualComponentName -> TestLogs -> FilePath -> TestSuiteLog [testSuiteName] :: TestSuiteLog -> UnqualComponentName [testLogs] :: TestSuiteLog -> TestLogs [logFile] :: TestSuiteLog -> FilePath -- | Count the number of pass, fail, and error test results in a -- TestLogs tree. countTestResults :: TestLogs -> (Int, Int, Int) -- | A PackageLog with package and platform information specified. localPackageLog :: PackageDescription -> LocalBuildInfo -> PackageLog -- | Print a summary to the console after all test suites have been run -- indicating the number of successful test suites and cases. Returns -- True if all test suites passed and False otherwise. summarizePackage :: Verbosity -> PackageLog -> IO Bool -- | Print a summary of the test suite's results on the console, -- suppressing output for certain verbosity or test filter levels. summarizeSuiteFinish :: TestSuiteLog -> String summarizeSuiteStart :: String -> String -- | Print a summary of a single test case's result to the console, -- suppressing output for certain verbosity or test filter levels. summarizeTest :: Verbosity -> TestShowDetails -> TestLogs -> IO () -- | From a TestSuiteLog, determine if the test suite encountered -- errors. suiteError :: TestLogs -> Bool -- | From a TestSuiteLog, determine if the test suite failed. suiteFailed :: TestLogs -> Bool -- | From a TestSuiteLog, determine if the test suite passed. suitePassed :: TestLogs -> Bool testSuiteLogPath :: PathTemplate -> PackageDescription -> LocalBuildInfo -> String -> TestLogs -> FilePath instance GHC.Classes.Eq Distribution.Simple.Test.Log.TestLogs instance GHC.Show.Show Distribution.Simple.Test.Log.TestLogs instance GHC.Read.Read Distribution.Simple.Test.Log.TestLogs instance GHC.Classes.Eq Distribution.Simple.Test.Log.TestSuiteLog instance GHC.Show.Show Distribution.Simple.Test.Log.TestSuiteLog instance GHC.Read.Read Distribution.Simple.Test.Log.TestSuiteLog instance GHC.Classes.Eq Distribution.Simple.Test.Log.PackageLog instance GHC.Show.Show Distribution.Simple.Test.Log.PackageLog instance GHC.Read.Read Distribution.Simple.Test.Log.PackageLog -- | This module provides an library interface to the ld linker -- program. module Distribution.Simple.Program.Ld -- | Call ld -r to link a bunch of object files together. combineObjectFiles :: Verbosity -> LocalBuildInfo -> ConfiguredProgram -> FilePath -> [FilePath] -> IO () -- | This module provides an library interface to the ar program. module Distribution.Simple.Program.Ar -- | Call ar to create a library archive from a bunch of object -- files. createArLibArchive :: Verbosity -> LocalBuildInfo -> FilePath -> [FilePath] -> IO () -- | Like the unix xargs program. Useful for when we've got very long -- command lines that might overflow an OS limit on command line length -- and so you need to invoke a command multiple times to get all the args -- in. -- -- It takes four template invocations corresponding to the simple, -- initial, middle and last invocations. If the number of args given is -- small enough that we can get away with just a single invocation then -- the simple one is used: -- --
-- $ simple args ---- -- If the number of args given means that we need to use multiple -- invocations then the templates for the initial, middle and last -- invocations are used: -- --
-- $ initial args_0 -- $ middle args_1 -- $ middle args_2 -- ... -- $ final args_n --multiStageProgramInvocation :: ProgramInvocation -> (ProgramInvocation, ProgramInvocation, ProgramInvocation) -> [String] -> [ProgramInvocation] -- | See -- https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst module Distribution.Backpack.ConfiguredComponent -- | A configured component, we know exactly what its ComponentId -- is, and the ComponentIds of the things it depends on. data ConfiguredComponent ConfiguredComponent :: AnnotatedId ComponentId -> Component -> Bool -> [AnnotatedId ComponentId] -> [ComponentInclude ComponentId IncludeRenaming] -> ConfiguredComponent -- | Unique identifier of component, plus extra useful info. [cc_ann_id] :: ConfiguredComponent -> AnnotatedId ComponentId -- | The fragment of syntax from the Cabal file describing this component. [cc_component] :: ConfiguredComponent -> Component -- | Is this the public library component of the package? (If we invoke -- Setup with an instantiation, this is the component the instantiation -- applies to.) Note that in one-component configure mode, this is always -- True, because any component is the "public" one.) [cc_public] :: ConfiguredComponent -> Bool -- | Dependencies on executables from build-tools and -- build-tool-depends. [cc_exe_deps] :: ConfiguredComponent -> [AnnotatedId ComponentId] -- | The mixins of this package, including both explicit (from the -- mixins field) and implicit (from build-depends). Not -- mix-in linked yet; component configuration only looks at -- ComponentIds. [cc_includes] :: ConfiguredComponent -> [ComponentInclude ComponentId IncludeRenaming] -- | The ComponentName of a component; this uniquely identifies a -- fragment of syntax within a specified Cabal file describing the -- component. cc_name :: ConfiguredComponent -> ComponentName -- | Uniquely identifies a configured component. cc_cid :: ConfiguredComponent -> ComponentId -- | The package this component came from. cc_pkgid :: ConfiguredComponent -> PackageId toConfiguredComponent :: PackageDescription -> ComponentId -> ConfiguredComponentMap -> ConfiguredComponentMap -> Component -> LogProgress ConfiguredComponent toConfiguredComponents :: Bool -> FlagAssignment -> Bool -> Flag String -> Flag ComponentId -> PackageDescription -> ConfiguredComponentMap -> [Component] -> LogProgress [ConfiguredComponent] -- | Pretty-print a ConfiguredComponent. dispConfiguredComponent :: ConfiguredComponent -> Doc type ConfiguredComponentMap = Map PackageName (Map ComponentName (AnnotatedId ComponentId)) extendConfiguredComponentMap :: ConfiguredComponent -> ConfiguredComponentMap -> ConfiguredComponentMap newPackageDepsBehaviour :: PackageDescription -> Bool -- | See -- https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst module Distribution.Backpack.LinkedComponent -- | A linked component is a component that has been mix-in linked, at -- which point we have determined how all the dependencies of the -- component are explicitly instantiated (in the form of an OpenUnitId). -- ConfiguredComponent is mix-in linked into -- LinkedComponent, which is then instantiated into -- ReadyComponent. data LinkedComponent LinkedComponent :: AnnotatedId ComponentId -> Component -> [AnnotatedId OpenUnitId] -> Bool -> [ComponentInclude OpenUnitId ModuleRenaming] -> [ComponentInclude OpenUnitId ModuleRenaming] -> ModuleShape -> LinkedComponent -- | Uniquely identifies linked component [lc_ann_id] :: LinkedComponent -> AnnotatedId ComponentId -- | Corresponds to cc_component. [lc_component] :: LinkedComponent -> Component -- | build-tools and build-tool-depends dependencies. -- Corresponds to cc_exe_deps. [lc_exe_deps] :: LinkedComponent -> [AnnotatedId OpenUnitId] -- | Is this the public library of a package? Corresponds to -- cc_public. [lc_public] :: LinkedComponent -> Bool -- | Corresponds to cc_includes, but (1) this does not contain -- includes of signature packages (packages with no exports), and (2) the -- ModuleRenaming for requirements (stored in -- IncludeRenaming) has been removed, as it is reflected in -- OpenUnitId.) [lc_includes] :: LinkedComponent -> [ComponentInclude OpenUnitId ModuleRenaming] -- | Like lc_includes, but this specifies includes on signature -- packages which have no exports. [lc_sig_includes] :: LinkedComponent -> [ComponentInclude OpenUnitId ModuleRenaming] -- | The module shape computed by mix-in linking. This is newly computed -- from ConfiguredComponent [lc_shape] :: LinkedComponent -> ModuleShape -- | The instantiation of lc_uid; this always has the invariant that -- it is a mapping from a module name A to A -- (the hole A). lc_insts :: LinkedComponent -> [(ModuleName, OpenModule)] -- | The OpenUnitId of this component in the "default" -- instantiation. See also lc_insts. LinkedComponents -- cannot be instantiated (e.g., there is no ModSubst instance -- for them). lc_uid :: LinkedComponent -> OpenUnitId -- | Uniquely identifies a LinkedComponent. Corresponds to -- cc_cid. lc_cid :: LinkedComponent -> ComponentId -- | Corresponds to cc_pkgid. lc_pkgid :: LinkedComponent -> PackageId toLinkedComponent :: Verbosity -> FullDb -> PackageId -> LinkedComponentMap -> ConfiguredComponent -> LogProgress LinkedComponent toLinkedComponents :: Verbosity -> FullDb -> PackageId -> LinkedComponentMap -> [ConfiguredComponent] -> LogProgress [LinkedComponent] dispLinkedComponent :: LinkedComponent -> Doc type LinkedComponentMap = Map ComponentId (OpenUnitId, ModuleShape) extendLinkedComponentMap :: LinkedComponent -> LinkedComponentMap -> LinkedComponentMap instance Distribution.Package.Package Distribution.Backpack.LinkedComponent.LinkedComponent -- | Handling for user-specified build targets module Distribution.Simple.BuildTarget -- | Take a list of String build targets, and parse and validate -- them into actual TargetInfos to be -- builtregisteredwhatever. readTargetInfos :: Verbosity -> PackageDescription -> LocalBuildInfo -> [String] -> IO [TargetInfo] -- | Read a list of user-supplied build target strings and resolve them to -- BuildTargets according to a PackageDescription. If there -- are problems with any of the targets e.g. they don't exist or are -- misformatted, throw an IOException. readBuildTargets :: Verbosity -> PackageDescription -> [String] -> IO [BuildTarget] -- | A fully resolved build target. data BuildTarget -- | A specific component BuildTargetComponent :: ComponentName -> BuildTarget -- | A specific module within a specific component. BuildTargetModule :: ComponentName -> ModuleName -> BuildTarget -- | A specific file within a specific component. BuildTargetFile :: ComponentName -> FilePath -> BuildTarget -- | Unambiguously render a BuildTarget, so that it can be parsed in -- all situations. showBuildTarget :: PackageId -> BuildTarget -> String data QualLevel QL1 :: QualLevel QL2 :: QualLevel QL3 :: QualLevel buildTargetComponentName :: BuildTarget -> ComponentName -- | Various ways that a user may specify a build target. data UserBuildTarget readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget]) showUserBuildTarget :: UserBuildTarget -> String data UserBuildTargetProblem UserBuildTargetUnrecognised :: String -> UserBuildTargetProblem reportUserBuildTargetProblems :: Verbosity -> [UserBuildTargetProblem] -> IO () -- | Given a bunch of user-specified targets, try to resolve what it is -- they refer to. resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget]) data BuildTargetProblem -- |
-- -- a comment --GhcEnvFileComment :: String -> GhcEnvironmentFileEntry -- |
-- package-id foo-1.0-4fe301a... --GhcEnvFilePackageId :: UnitId -> GhcEnvironmentFileEntry -- | global-package-db, user-package-db or package-db -- blahpackage.conf.d GhcEnvFilePackageDb :: PackageDB -> GhcEnvironmentFileEntry -- |
-- clear-package-db --GhcEnvFileClearPackageDbStack :: GhcEnvironmentFileEntry -- | Make entries for a GHC environment file based on a -- PackageDBStack and a bunch of package (unit) ids. -- -- If you need to do anything more complicated then either use this as a -- basis and add more entries, or just make all the entries directly. simpleGhcEnvironmentFile :: PackageDBStack -> [UnitId] -> [GhcEnvironmentFileEntry] -- | Render a bunch of GHC environment file entries renderGhcEnvironmentFile :: [GhcEnvironmentFileEntry] -> String -- | Write a .ghc.environment-$arch-$os-$ver file in the given -- directory. -- -- The Platform and GHC Version are needed as part of the -- file name. -- -- Returns the name of the file written. writeGhcEnvironmentFile :: FilePath -> Platform -> Version -> [GhcEnvironmentFileEntry] -> IO FilePath -- | GHC's rendering of its platform and compiler version string as used in -- certain file locations (such as user package db location). For example -- x86_64-linux-7.10.4 ghcPlatformAndVersionString :: Platform -> Version -> String readGhcEnvironmentFile :: FilePath -> IO [GhcEnvironmentFileEntry] parseGhcEnvironmentFile :: Parser [GhcEnvironmentFileEntry] newtype ParseErrorExc ParseErrorExc :: ParseError -> ParseErrorExc getImplInfo :: Compiler -> GhcImplInfo -- | Information about features and quirks of a GHC-based implementation. -- -- Compiler flavors based on GHC behave similarly enough that some of the -- support code for them is shared. Every implementation has its own -- peculiarities, that may or may not be a direct result of the -- underlying GHC version. This record keeps track of these differences. -- -- All shared code (i.e. everything not in the Distribution.Simple.FLAVOR -- module) should use implementation info rather than version numbers to -- test for supported features. data GhcImplInfo GhcImplInfo :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> GhcImplInfo -- |
-- -- a comment --GhcEnvFileComment :: String -> GhcEnvironmentFileEntry -- |
-- package-id foo-1.0-4fe301a... --GhcEnvFilePackageId :: UnitId -> GhcEnvironmentFileEntry -- | global-package-db, user-package-db or package-db -- blahpackage.conf.d GhcEnvFilePackageDb :: PackageDB -> GhcEnvironmentFileEntry -- |
-- clear-package-db --GhcEnvFileClearPackageDbStack :: GhcEnvironmentFileEntry -- | Make entries for a GHC environment file based on a -- PackageDBStack and a bunch of package (unit) ids. -- -- If you need to do anything more complicated then either use this as a -- basis and add more entries, or just make all the entries directly. simpleGhcEnvironmentFile :: PackageDBStack -> [UnitId] -> [GhcEnvironmentFileEntry] -- | Render a bunch of GHC environment file entries renderGhcEnvironmentFile :: [GhcEnvironmentFileEntry] -> String -- | Write a .ghc.environment-$arch-$os-$ver file in the given -- directory. -- -- The Platform and GHC Version are needed as part of the -- file name. -- -- Returns the name of the file written. writeGhcEnvironmentFile :: FilePath -> Platform -> Version -> [GhcEnvironmentFileEntry] -> IO FilePath -- | GHC's rendering of its platform and compiler version string as used in -- certain file locations (such as user package db location). For example -- x86_64-linux-7.10.4 ghcPlatformAndVersionString :: Platform -> Version -> String readGhcEnvironmentFile :: FilePath -> IO [GhcEnvironmentFileEntry] parseGhcEnvironmentFile :: Parser [GhcEnvironmentFileEntry] newtype ParseErrorExc ParseErrorExc :: ParseError -> ParseErrorExc getImplInfo :: Compiler -> GhcImplInfo -- | Information about features and quirks of a GHC-based implementation. -- -- Compiler flavors based on GHC behave similarly enough that some of the -- support code for them is shared. Every implementation has its own -- peculiarities, that may or may not be a direct result of the -- underlying GHC version. This record keeps track of these differences. -- -- All shared code (i.e. everything not in the Distribution.Simple.FLAVOR -- module) should use implementation info rather than version numbers to -- test for supported features. data GhcImplInfo GhcImplInfo :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> GhcImplInfo -- |
-- { "cabal-lib-version": "1.23.0.0",
-- "compiler": {
-- "flavour": GHC,
-- "compiler-id": "ghc-7.10.2",
-- "path": "usrbin/ghc",
-- },
-- "components": [
-- { "type": "lib",
-- "name": "lib:Cabal",
-- "compiler-args":
-- ["-O", "-XHaskell98", "-Wall",
-- "-package-id", "parallel-3.2.0.6-b79c38c5c25fff77f3ea7271851879eb"]
-- "modules": [Project.ModA, Project.ModB, Paths_project],
-- "src-files": [],
-- "src-dirs": ["src"]
-- }
-- ]
-- }
--
--
-- The output format needs to be validated against
-- 'docjson-schemasbuild-info.schema.json'. If the format changes,
-- update the schema as well!
--
-- The cabal-lib-version property provides the version of the
-- Cabal library which generated the output. The compiler
-- property gives some basic information about the compiler Cabal would
-- use to compile the package.
--
-- The components property gives a list of the Cabal
-- Components defined by the package. Each has,
--
--
-- ppTestHandler :: PreProcessor
-- ppTestHandler =
-- PreProcessor {
-- platformIndependent = True,
-- runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
-- do info verbosity (inFile++" has been preprocessed to "++outFile)
-- stuff <- readFile inFile
-- writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
-- return ExitSuccess
--
--
-- We split the input and output file names into a base directory and the
-- rest of the file name. The input base dir is the path in the list of
-- search dirs that this file was found in. The output base dir is the
-- build dir where all the generated source files are put.
--
-- The reason for splitting it up this way is that some pre-processors
-- don't simply generate one output .hs file from one input file but have
-- dependencies on other generated files (notably c2hs, where building
-- one .hs file may require reading other .chi files, and then compiling
-- the .hs file may require reading a generated .h file). In these cases
-- the generated files need to embed relative path names to each other
-- (eg the generated .hs file mentions the .h file in the FFI imports).
-- This path must be relative to the base directory where the generated
-- files are located, it cannot be relative to the top level of the build
-- tree because the compilers do not look for .h files relative to there,
-- ie we do not use "-I .", instead we use "-I dist/build" (or whatever
-- dist dir has been set by the user)
--
-- Most pre-processors do not care of course, so mkSimplePreProcessor and
-- runSimplePreProcessor functions handle the simple case.
data PreProcessor
PreProcessor :: Bool -> (Verbosity -> [FilePath] -> [ModuleName] -> IO [ModuleName]) -> ((FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()) -> PreProcessor
[platformIndependent] :: PreProcessor -> Bool
-- | This function can reorder all modules, not just those that the
-- require the preprocessor in question. As such, this function should be
-- well-behaved and not reorder modules it doesn't have dominion over!
[ppOrdering] :: PreProcessor -> Verbosity -> [FilePath] -> [ModuleName] -> IO [ModuleName]
[runPreProcessor] :: PreProcessor -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()
mkSimplePreProcessor :: (FilePath -> FilePath -> Verbosity -> IO ()) -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO ()
ppCpp :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppCpp' :: [String] -> BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppGreenCard :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppC2hs :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppHappy :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppAlex :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppUnlit :: PreProcessor
platformDefines :: LocalBuildInfo -> [String]
-- | Just present the modules in the order given; this is the default and
-- it is appropriate for preprocessors which do not have any sort of
-- dependencies between modules.
unsorted :: Verbosity -> [FilePath] -> [ModuleName] -> IO [ModuleName]
-- | This defines the API that Setup.hs scripts can use to
-- customise the way the build works. This module just defines the
-- UserHooks type. The predefined sets of hooks that implement the
-- Simple, Make and Configure build systems
-- are defined in Distribution.Simple. The UserHooks is a
-- big record of functions. There are 3 for each action, a pre, post and
-- the action itself. There are few other miscellaneous hooks, ones to
-- extend the set of programs and preprocessors and one to override the
-- function used to read the .cabal file.
--
-- This hooks type is widely agreed to not be the right solution. Partly
-- this is because changes to it usually break custom Setup.hs
-- files and yet many internal code changes do require changes to the
-- hooks. For example we cannot pass any extra parameters to most of the
-- functions that implement the various phases because it would involve
-- changing the types of the corresponding hook. At some point it will
-- have to be replaced.
module Distribution.Simple.UserHooks
-- | Hooks allow authors to add specific functionality before and after a
-- command is run, and also to specify additional preprocessors.
--
-- -- ccflags <- getDbProgramOutput verbosity prog progdb ["--cflags"] -- ldflags <- getDbProgramOutput verbosity prog progdb ["--libs"] -- ldflags_static <- getDbProgramOutput verbosity prog progdb ["--libs", "--static"] -- return (ccldOptionsBuildInfo (words ccflags) (words ldflags) (words ldflags_static)) --ccLdOptionsBuildInfo :: [String] -> [String] -> [String] -> BuildInfo checkForeignDeps :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO () -- | The user interface specifies the package dbs to use with a combination -- of --global, --user and -- --package-db=global|user|clear|$file. This function combines -- the global/user flag and interprets the package-db flag into a single -- package db stack. interpretPackageDbFlags :: Bool -> [Maybe PackageDB] -> PackageDBStack -- | The errors that can be thrown when reading the setup-config -- file. data ConfigStateFileError -- | No header found. ConfigStateFileNoHeader :: ConfigStateFileError -- | Incorrect header. ConfigStateFileBadHeader :: ConfigStateFileError -- | Cannot parse file contents. ConfigStateFileNoParse :: ConfigStateFileError -- | No file! ConfigStateFileMissing :: ConfigStateFileError -- | Mismatched version. ConfigStateFileBadVersion :: PackageIdentifier -> PackageIdentifier -> Either ConfigStateFileError LocalBuildInfo -> ConfigStateFileError -- | Read the localBuildInfoFile, returning either an error or the -- local build info. tryGetConfigStateFile :: FilePath -> IO (Either ConfigStateFileError LocalBuildInfo) platformDefines :: LocalBuildInfo -> [String] instance GHC.Show.Show Distribution.Simple.Configure.ConfigStateFileError instance GHC.Exception.Type.Exception Distribution.Simple.Configure.ConfigStateFileError -- | This handles the sdist command. The module exports an -- sdist action but also some of the phases that make it up so -- that other tools can use just the bits they need. In particular the -- preparation of the tree of files to go into the source tarball is -- separated from actually building the source tarball. -- -- The createArchive action uses the external tar program -- and assumes that it accepts the -z flag. Neither of these -- assumptions are valid on Windows. The sdist action now also -- does some distribution QA checks. module Distribution.Simple.SrcDist -- | Create a source distribution. sdist :: PackageDescription -> SDistFlags -> (FilePath -> FilePath) -> [PPSuffixHandler] -> IO () -- | Note: must be called with the CWD set to the directory containing the -- '.cabal' file. printPackageProblems :: Verbosity -> PackageDescription -> IO () -- | Prepare a directory tree of source files. prepareTree :: Verbosity -> PackageDescription -> FilePath -> [PPSuffixHandler] -> IO () -- | Create an archive from a tree of source files, and clean up the tree. createArchive :: Verbosity -> PackageDescription -> FilePath -> FilePath -> IO FilePath -- | Prepare a directory tree of source files for a snapshot version. It is -- expected that the appropriate snapshot version has already been set in -- the package description, eg using snapshotPackage or -- snapshotVersion. prepareSnapshotTree :: Verbosity -> PackageDescription -> FilePath -> [PPSuffixHandler] -> IO () -- | Modifies a PackageDescription by appending a snapshot number -- corresponding to the given date. snapshotPackage :: UTCTime -> PackageDescription -> PackageDescription -- | Modifies a Version by appending a snapshot number corresponding -- to the given date. snapshotVersion :: UTCTime -> Version -> Version -- | Given a date produce a corresponding integer representation. For -- example given a date 18032008 produce the number -- 20080318. dateToSnapshotNumber :: UTCTime -> Int -- | List all source files of a package. -- -- Since Cabal-3.4 returns a single list. There shouldn't be any -- executable files, they are hardly portable. listPackageSources :: Verbosity -> FilePath -> PackageDescription -> [PPSuffixHandler] -> IO [FilePath] -- | A variant of listPackageSources with configurable die. -- -- Note: may still die directly. For example on missing -- include file. -- -- Since @3.4.0.0 listPackageSourcesWithDie :: Verbosity -> (Verbosity -> String -> IO [FilePath]) -> FilePath -> PackageDescription -> [PPSuffixHandler] -> IO [FilePath] -- | This is the entry point to actually building the modules in a package. -- It doesn't actually do much itself, most of the work is delegated to -- compiler-specific actions. It does do some non-compiler specific bits -- like running pre-processors. module Distribution.Simple.Build -- | Build the libraries and executables in this package. build :: PackageDescription -> LocalBuildInfo -> BuildFlags -> [PPSuffixHandler] -> IO () repl :: PackageDescription -> LocalBuildInfo -> ReplFlags -> [PPSuffixHandler] -> [String] -> IO () -- | Start an interpreter without loading any package files. startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO () -- | Runs componentInitialBuildSteps on every configured component. initialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> Verbosity -> IO () -- | Initialize a new package db file for libraries defined internally to -- the package. createInternalPackageDB :: Verbosity -> LocalBuildInfo -> FilePath -> IO PackageDB -- | Creates the autogenerated files for a particular configured component. componentInitialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> Verbosity -> IO () -- | Generate and write out the Paths_pkg.hs, -- PackageInfo_pkg.hs, and cabal_macros.h files writeAutogenFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO () -- | This module deals with the haddock and hscolour -- commands. It uses information about installed packages (from -- ghc-pkg) to find the locations of documentation for dependent -- packages, so it can create links. -- -- The hscolour support allows generating HTML versions of the -- original source, with coloured syntax highlighting. module Distribution.Simple.Haddock haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HaddockFlags -> IO () -- | Execute Haddock configured with HaddocksFlags. It is -- used to build index and contents for documentation of multiple -- packages. createHaddockIndex :: Verbosity -> ProgramDb -> Compiler -> Platform -> HaddockProjectFlags -> IO () hscolour :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HscolourFlags -> IO () -- | Given a list of InstalledPackageInfos, return a list of -- interfaces and HTML paths, and an optional warning for packages with -- missing documentation. haddockPackagePaths :: [InstalledPackageInfo] -> Maybe (InstalledPackageInfo -> FilePath) -> IO ([(FilePath, Maybe FilePath, Maybe FilePath, Visibility)], Maybe String) -- | Governs whether modules from a given interface should be visible or -- hidden in the Haddock generated content page. We don't expose this -- functionality to the user, but simply use Visible for only -- local packages. Visibility of modules is available since -- haddock-2.26.1. data Visibility Visible :: Visibility Hidden :: Visibility instance GHC.Classes.Ord Distribution.Simple.Haddock.Directory instance GHC.Classes.Eq Distribution.Simple.Haddock.Directory instance GHC.Show.Show Distribution.Simple.Haddock.Directory instance GHC.Read.Read Distribution.Simple.Haddock.Directory instance GHC.Classes.Eq Distribution.Simple.Haddock.Output instance GHC.Generics.Generic Distribution.Simple.Haddock.HaddockArgs instance GHC.Base.Monoid Distribution.Simple.Haddock.HaddockArgs instance GHC.Base.Semigroup Distribution.Simple.Haddock.HaddockArgs instance GHC.Base.Monoid Distribution.Simple.Haddock.Directory instance GHC.Base.Semigroup Distribution.Simple.Haddock.Directory -- | This is the command line front end to the Simple build system. When -- given the parsed command-line args and package information, is able to -- perform basic commands like configure, build, install, register, etc. -- -- This module exports the main functions that Setup.hs scripts use. It -- re-exports the UserHooks type, the standard entry points like -- defaultMain and defaultMainWithHooks and the predefined -- sets of UserHooks that custom Setup.hs scripts can -- extend to add their own behaviour. -- -- This module isn't called "Simple" because it's simple. Far from it. -- It's called "Simple" because it does complicated things to simple -- software. -- -- The original idea was that there could be different build systems that -- all presented the same compatible command line interfaces. There is -- still a Distribution.Make system but in practice no packages -- use it. module Distribution.Simple -- | A simple implementation of main for a Cabal setup script. It -- reads the package description file using IO, and performs the action -- specified on the command line. defaultMain :: IO () -- | Like defaultMain, but accepts the package description as input -- rather than using IO to read it. defaultMainNoRead :: GenericPackageDescription -> IO () -- | A version of defaultMain that is passed the command line -- arguments, rather than getting them from the environment. defaultMainArgs :: [String] -> IO () -- | Hooks allow authors to add specific functionality before and after a -- command is run, and also to specify additional preprocessors. -- --