Cabal-2.0.1.0: A framework for packaging Haskell software

Copyright | Isaac Jones 2003-2004
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Simple.LocalBuildInfo

Contents

- Buildable package components
- Installation directories

Description

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.

Synopsis

- data LocalBuildInfo = LocalBuildInfo {
  - configFlags :: ConfigFlags
  - flagAssignment :: FlagAssignment
  - componentEnabledSpec :: ComponentRequestedSpec
  - extraConfigArgs :: [String]
  - installDirTemplates :: InstallDirTemplates
  - compiler :: Compiler
  - hostPlatform :: Platform
  - buildDir :: FilePath
  - componentGraph :: Graph ComponentLocalBuildInfo
  - componentNameMap :: Map ComponentName [ComponentLocalBuildInfo]
  - installedPkgs :: InstalledPackageIndex
  - pkgDescrFile :: Maybe FilePath
  - localPkgDescr :: PackageDescription
  - withPrograms :: ProgramDb
  - withPackageDB :: PackageDBStack
  - withVanillaLib :: Bool
  - withProfLib :: Bool
  - withSharedLib :: Bool
  - withDynExe :: Bool
  - withProfExe :: Bool
  - withProfLibDetail :: ProfDetailLevel
  - withProfExeDetail :: ProfDetailLevel
  - withOptimization :: OptimisationLevel
  - withDebugInfo :: DebugInfoLevel
  - withGHCiLib :: Bool
  - splitObjs :: Bool
  - stripExes :: Bool
  - stripLibs :: Bool
  - exeCoverage :: Bool
  - libCoverage :: Bool
  - progPrefix :: PathTemplate
  - progSuffix :: PathTemplate
  - relocatable :: Bool
  }
- externalPackageDeps :: LocalBuildInfo -> [(UnitId, MungedPackageId)]
- localComponentId :: LocalBuildInfo -> ComponentId
- localUnitId :: LocalBuildInfo -> UnitId
- localCompatPackageKey :: LocalBuildInfo -> String
- data Component
  - = CLib Library
  - | CFLib ForeignLib
  - | CExe Executable
  - | CTest TestSuite
  - | CBench Benchmark
- data ComponentName
  - = CLibName
  - | CSubLibName UnqualComponentName
  - | CFLibName UnqualComponentName
  - | CExeName UnqualComponentName
  - | CTestName UnqualComponentName
  - | CBenchName UnqualComponentName
- defaultLibName :: ComponentName
- showComponentName :: ComponentName -> String
- componentNameString :: ComponentName -> Maybe UnqualComponentName
- data ComponentLocalBuildInfo
  - = LibComponentLocalBuildInfo {
    - componentLocalName :: ComponentName
    - componentComponentId :: ComponentId
    - componentUnitId :: UnitId
    - componentIsIndefinite_ :: Bool
    - componentInstantiatedWith :: [(ModuleName, OpenModule)]
    - componentPackageDeps :: [(UnitId, MungedPackageId)]
    - componentIncludes :: [(OpenUnitId, ModuleRenaming)]
    - componentExeDeps :: [UnitId]
    - componentInternalDeps :: [UnitId]
    - componentCompatPackageKey :: String
    - componentCompatPackageName :: MungedPackageName
    - componentExposedModules :: [ExposedModule]
    - componentIsPublic :: Bool
    }
  - | FLibComponentLocalBuildInfo {
    - componentLocalName :: ComponentName
    - componentComponentId :: ComponentId
    - componentUnitId :: UnitId
    - componentPackageDeps :: [(UnitId, MungedPackageId)]
    - componentIncludes :: [(OpenUnitId, ModuleRenaming)]
    - componentExeDeps :: [UnitId]
    - componentInternalDeps :: [UnitId]
    }
  - | ExeComponentLocalBuildInfo {
    - componentLocalName :: ComponentName
    - componentComponentId :: ComponentId
    - componentUnitId :: UnitId
    - componentPackageDeps :: [(UnitId, MungedPackageId)]
    - componentIncludes :: [(OpenUnitId, ModuleRenaming)]
    - componentExeDeps :: [UnitId]
    - componentInternalDeps :: [UnitId]
    }
  - | TestComponentLocalBuildInfo {
    - componentLocalName :: ComponentName
    - componentComponentId :: ComponentId
    - componentUnitId :: UnitId
    - componentPackageDeps :: [(UnitId, MungedPackageId)]
    - componentIncludes :: [(OpenUnitId, ModuleRenaming)]
    - componentExeDeps :: [UnitId]
    - componentInternalDeps :: [UnitId]
    }
  - | BenchComponentLocalBuildInfo {
    - componentLocalName :: ComponentName
    - componentComponentId :: ComponentId
    - componentUnitId :: UnitId
    - componentPackageDeps :: [(UnitId, MungedPackageId)]
    - componentIncludes :: [(OpenUnitId, ModuleRenaming)]
    - componentExeDeps :: [UnitId]
    - componentInternalDeps :: [UnitId]
    }
- componentBuildDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> FilePath
- foldComponent :: (Library -> a) -> (ForeignLib -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a
- componentName :: Component -> ComponentName
- componentBuildInfo :: Component -> BuildInfo
- componentBuildable :: Component -> Bool
- pkgComponents :: PackageDescription -> [Component]
- pkgBuildableComponents :: PackageDescription -> [Component]
- lookupComponent :: PackageDescription -> ComponentName -> Maybe Component
- getComponent :: PackageDescription -> ComponentName -> Component
- getComponentLocalBuildInfo :: LocalBuildInfo -> ComponentName -> ComponentLocalBuildInfo
- allComponentsInBuildOrder :: LocalBuildInfo -> [ComponentLocalBuildInfo]
- componentsInBuildOrder :: LocalBuildInfo -> [ComponentName] -> [ComponentLocalBuildInfo]
- depLibraryPaths :: Bool -> Bool -> LocalBuildInfo -> ComponentLocalBuildInfo -> NoCallStackIO [FilePath]
- allLibModules :: Library -> ComponentLocalBuildInfo -> [ModuleName]
- withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- withComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> [ComponentName] -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- withComponentsLBI :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- withBenchLBI :: PackageDescription -> LocalBuildInfo -> (Benchmark -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- withTestLBI :: PackageDescription -> LocalBuildInfo -> (TestSuite -> ComponentLocalBuildInfo -> IO ()) -> IO ()
- enabledTestLBIs :: PackageDescription -> LocalBuildInfo -> [(TestSuite, ComponentLocalBuildInfo)]
- enabledBenchLBIs :: PackageDescription -> LocalBuildInfo -> [(Benchmark, ComponentLocalBuildInfo)]
- module Distribution.Simple.InstallDirs
- absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath
- prefixRelativeInstallDirs :: PackageId -> LocalBuildInfo -> InstallDirs (Maybe FilePath)
- absoluteComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> UnitId -> CopyDest -> InstallDirs FilePath
- prefixRelativeComponentInstallDirs :: PackageId -> LocalBuildInfo -> UnitId -> InstallDirs (Maybe FilePath)
- substPathTemplate :: PackageId -> LocalBuildInfo -> UnitId -> PathTemplate -> FilePath

# Documentation

data LocalBuildInfo #

Data cached after configuration step. See also `ConfigFlags`.

Constructors

LocalBuildInfo |

Fields

- configFlags :: ConfigFlags

  Options passed to the configuration step. Needed to re-run configuration when .cabal is out of date

- flagAssignment :: FlagAssignment

  The final set of flags which were picked for this package

- componentEnabledSpec :: ComponentRequestedSpec

  What components were enabled during configuration, and why.

- extraConfigArgs :: [String]

  Extra args on the command line for the configuration step. Needed to re-run configuration when .cabal is out of date

- installDirTemplates :: InstallDirTemplates

  The installation directories for the various different kinds of files TODO: inplaceDirTemplates :: InstallDirs FilePath

- compiler :: Compiler

  The compiler we're building with

- hostPlatform :: Platform

  The platform we're building for

- buildDir :: FilePath

  Where to build the package.

- componentGraph :: Graph ComponentLocalBuildInfo

  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.

- componentNameMap :: Map ComponentName [ComponentLocalBuildInfo]

  A map from component name to all matching components. These coincide with `componentGraph`

- installedPkgs :: InstalledPackageIndex

  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.)

- pkgDescrFile :: Maybe FilePath

  the filename containing the .cabal file, if available

- localPkgDescr :: PackageDescription

  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 wtih a `HookedBuildInfo` applied to it; see `HookedBuildInfo` for the whole sordid saga. As much as possible, Cabal library should avoid using this parameter.

- withPrograms :: ProgramDb

  Location and args for all programs

- withPackageDB :: PackageDBStack

  What package database to use, global/user

- withVanillaLib :: Bool

  Whether to build normal libs.

- withProfLib :: Bool

  Whether to build profiling versions of libs.

- withSharedLib :: Bool

  Whether to build shared versions of libs.

- withDynExe :: Bool

  Whether to link executables dynamically

- withProfExe :: Bool

  Whether to build executables for profiling.

- withProfLibDetail :: ProfDetailLevel

  Level of automatic profile detail.

- withProfExeDetail :: ProfDetailLevel

  Level of automatic profile detail.

- withOptimization :: OptimisationLevel

  Whether to build with optimization (if available).

- withDebugInfo :: DebugInfoLevel

  Whether to emit debug info (if available).

- withGHCiLib :: Bool

  Whether to build libs suitable for use with GHCi.

- splitObjs :: Bool

  Use -split-objs with GHC, if available

- stripExes :: Bool

  Whether to strip executables during install

- stripLibs :: Bool

  Whether to strip libraries during install

- exeCoverage :: Bool

  Whether to enable executable program coverage

- libCoverage :: Bool

  Whether to enable library program coverage

- progPrefix :: PathTemplate

  Prefix to be prepended to installed executables

- progSuffix :: PathTemplate

  Suffix to be appended to installed executables

- relocatable :: Bool

Instances

Read LocalBuildInfo # |
Methods readsPrec :: Int -> ReadS LocalBuildInfo Source # readList :: ReadS [LocalBuildInfo] Source # readPrec :: ReadPrec LocalBuildInfo Source # readListPrec :: ReadPrec [LocalBuildInfo] Source #
Show LocalBuildInfo # |
Methods showsPrec :: Int -> LocalBuildInfo -> ShowS Source # show :: LocalBuildInfo -> String Source # showList :: [LocalBuildInfo] -> ShowS Source #
Generic LocalBuildInfo # |
Associated Types type Rep LocalBuildInfo :: * -> * Source # Methods from :: LocalBuildInfo -> Rep LocalBuildInfo x Source # to :: Rep LocalBuildInfo x -> LocalBuildInfo Source #
Binary LocalBuildInfo # |
Methods put :: LocalBuildInfo -> Put Source # get :: Get LocalBuildInfo Source # putList :: [LocalBuildInfo] -> Put Source #
type Rep LocalBuildInfo # |

type Rep LocalBuildInfo = D1 * (MetaData "LocalBuildInfo" "Distribution.Types.LocalBuildInfo" "Cabal-2.0.1.0" False) (C1 * (MetaCons "LocalBuildInfo" PrefixI True) ((:*:) * ((:*:) * ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "configFlags") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ConfigFlags)) (S1 * (MetaSel (Just Symbol "flagAssignment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * FlagAssignment))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentEnabledSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentRequestedSpec)) (S1 * (MetaSel (Just Symbol "extraConfigArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [String])))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "installDirTemplates") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * InstallDirTemplates)) (S1 * (MetaSel (Just Symbol "compiler") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Compiler))) ((:*:) * (S1 * (MetaSel (Just Symbol "hostPlatform") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Platform)) (S1 * (MetaSel (Just Symbol "buildDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * FilePath))))) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentGraph") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Graph ComponentLocalBuildInfo))) (S1 * (MetaSel (Just Symbol "componentNameMap") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Map ComponentName [ComponentLocalBuildInfo])))) ((:*:) * (S1 * (MetaSel (Just Symbol "installedPkgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * InstalledPackageIndex)) (S1 * (MetaSel (Just Symbol "pkgDescrFile") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe FilePath))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "localPkgDescr") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * PackageDescription)) (S1 * (MetaSel (Just Symbol "withPrograms") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ProgramDb))) ((:*:) * (S1 * (MetaSel (Just Symbol "withPackageDB") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * PackageDBStack)) (S1 * (MetaSel (Just Symbol "withVanillaLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)))))) ((:*:) * ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "withProfLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "withSharedLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool))) ((:*:) * (S1 * (MetaSel (Just Symbol "withDynExe") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "withProfExe") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "withProfLibDetail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ProfDetailLevel)) (S1 * (MetaSel (Just Symbol "withProfExeDetail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ProfDetailLevel))) ((:*:) * (S1 * (MetaSel (Just Symbol "withOptimization") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * OptimisationLevel)) (S1 * (MetaSel (Just Symbol "withDebugInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * DebugInfoLevel))))) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "withGHCiLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "splitObjs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool))) ((:*:) * (S1 * (MetaSel (Just Symbol "stripExes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "stripLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "exeCoverage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "libCoverage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool))) ((:*:) * (S1 * (MetaSel (Just Symbol "progPrefix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * PathTemplate)) ((:*:) * (S1 * (MetaSel (Just Symbol "progSuffix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * PathTemplate)) (S1 * (MetaSel (Just Symbol "relocatable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)))))))))

externalPackageDeps :: LocalBuildInfo -> [(UnitId, MungedPackageId)] #

Deprecated: You almost certainly don't want this function, which agglomerates the dependencies of ALL enabled components. If you're using this to write out information on your dependencies, read off the dependencies directly from the actual component in question. To be removed in Cabal 2.2

External package dependencies for the package as a whole. This is the union of the individual `componentPackageDeps`, less any internal deps.

localComponentId :: LocalBuildInfo -> ComponentId #

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.

localUnitId :: LocalBuildInfo -> UnitId #

Extract the `UnitId` from the library component of a `LocalBuildInfo` if it exists, or make a fake unit ID based on the package ID.

localCompatPackageKey :: LocalBuildInfo -> String #

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.

# Buildable package components

data Component #

Constructors

CLib Library |
CFLib ForeignLib |
CExe Executable |
CTest TestSuite |
CBench Benchmark |

Instances

Eq Component # |
Methods (==) :: Component -> Component -> Bool # (/=) :: Component -> Component -> Bool #
Read Component # |
Methods readsPrec :: Int -> ReadS Component Source # readList :: ReadS [Component] Source # readPrec :: ReadPrec Component Source # readListPrec :: ReadPrec [Component] Source #
Show Component # |
Methods showsPrec :: Int -> Component -> ShowS Source # show :: Component -> String Source # showList :: [Component] -> ShowS Source #
Semigroup Component # |
Methods (<>) :: Component -> Component -> Component Source # sconcat :: NonEmpty Component -> Component Source # stimes :: Integral b => b -> Component -> Component Source #

data ComponentName #

Constructors

CLibName |
CSubLibName UnqualComponentName |
CFLibName UnqualComponentName |
CExeName UnqualComponentName |
CTestName UnqualComponentName |
CBenchName UnqualComponentName |

Instances

Eq ComponentName # |
Methods (==) :: ComponentName -> ComponentName -> Bool # (/=) :: ComponentName -> ComponentName -> Bool #
Ord ComponentName # |
Methods compare :: ComponentName -> ComponentName -> Ordering # (<) :: ComponentName -> ComponentName -> Bool # (<=) :: ComponentName -> ComponentName -> Bool # (>) :: ComponentName -> ComponentName -> Bool # (>=) :: ComponentName -> ComponentName -> Bool # max :: ComponentName -> ComponentName -> ComponentName # min :: ComponentName -> ComponentName -> ComponentName #
Read ComponentName # |
Methods readsPrec :: Int -> ReadS ComponentName Source # readList :: ReadS [ComponentName] Source # readPrec :: ReadPrec ComponentName Source # readListPrec :: ReadPrec [ComponentName] Source #
Show ComponentName # |
Methods showsPrec :: Int -> ComponentName -> ShowS Source # show :: ComponentName -> String Source # showList :: [ComponentName] -> ShowS Source #
Generic ComponentName # |
Associated Types type Rep ComponentName :: * -> * Source # Methods from :: ComponentName -> Rep ComponentName x Source # to :: Rep ComponentName x -> ComponentName Source #
Binary ComponentName # |
Methods put :: ComponentName -> Put Source # get :: Get ComponentName Source # putList :: [ComponentName] -> Put Source #
Text ComponentName # |
Methods disp :: ComponentName -> Doc # parse :: ReadP r ComponentName #
type Rep ComponentName # |

type Rep ComponentName = D1 * (MetaData "ComponentName" "Distribution.Types.ComponentName" "Cabal-2.0.1.0" False) ((:+:) * ((:+:) * (C1 * (MetaCons "CLibName" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "CSubLibName" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnqualComponentName))) (C1 * (MetaCons "CFLibName" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnqualComponentName))))) ((:+:) * (C1 * (MetaCons "CExeName" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnqualComponentName))) ((:+:) * (C1 * (MetaCons "CTestName" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnqualComponentName))) (C1 * (MetaCons "CBenchName" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnqualComponentName))))))

defaultLibName :: ComponentName #

showComponentName :: ComponentName -> String #

componentNameString :: ComponentName -> Maybe UnqualComponentName #

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.

data ComponentLocalBuildInfo #

The first five fields are common across all algebraic variants.

Constructors

LibComponentLocalBuildInfo |

Fields

- componentLocalName :: ComponentName

  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.

- componentComponentId :: ComponentId

  The computed `ComponentId` of this component.

- componentUnitId :: UnitId

  The computed `UnitId` which uniquely identifies this component. Might be hashed.

- componentIsIndefinite_ :: Bool

  Is this an indefinite component (i.e. has unfilled holes)?

- componentInstantiatedWith :: [(ModuleName, OpenModule)]

  How the component was instantiated

- componentPackageDeps :: [(UnitId, MungedPackageId)]

  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.

- componentIncludes :: [(OpenUnitId, ModuleRenaming)]

  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.

- componentExeDeps :: [UnitId]
- componentInternalDeps :: [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!

- componentCompatPackageKey :: String

  Compatibility "package key" that we pass to older versions of GHC.

- componentCompatPackageName :: MungedPackageName

  Compatibility "package name" that we register this component as.

- componentExposedModules :: [ExposedModule]

  A list of exposed modules (either defined in this component, or reexported from another component.)

- componentIsPublic :: Bool

  Convenience field, specifying whether or not this is the "public library" that has the same name as the package.

FLibComponentLocalBuildInfo |

Fields

- componentLocalName :: ComponentName

  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.

- componentComponentId :: ComponentId

  The computed `ComponentId` of this component.

- componentUnitId :: UnitId

  The computed `UnitId` which uniquely identifies this component. Might be hashed.

- componentPackageDeps :: [(UnitId, MungedPackageId)]

  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.

- componentIncludes :: [(OpenUnitId, ModuleRenaming)]

  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.

- componentExeDeps :: [UnitId]
- componentInternalDeps :: [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!

ExeComponentLocalBuildInfo |

Fields

- componentLocalName :: ComponentName

  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.

- componentComponentId :: ComponentId

  The computed `ComponentId` of this component.

- componentUnitId :: UnitId

  The computed `UnitId` which uniquely identifies this component. Might be hashed.

- componentPackageDeps :: [(UnitId, MungedPackageId)]

  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.

- componentIncludes :: [(OpenUnitId, ModuleRenaming)]

  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.

- componentExeDeps :: [UnitId]
- componentInternalDeps :: [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!

TestComponentLocalBuildInfo |

Fields

- componentLocalName :: ComponentName

  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.

- componentComponentId :: ComponentId

  The computed `ComponentId` of this component.

- componentUnitId :: UnitId

  The computed `UnitId` which uniquely identifies this component. Might be hashed.

- componentPackageDeps :: [(UnitId, MungedPackageId)]

  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.

- componentIncludes :: [(OpenUnitId, ModuleRenaming)]

  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.

- componentExeDeps :: [UnitId]
- componentInternalDeps :: [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!

BenchComponentLocalBuildInfo |

Fields

- componentLocalName :: ComponentName

  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.

- componentComponentId :: ComponentId

  The computed `ComponentId` of this component.

- componentUnitId :: UnitId

  The computed `UnitId` which uniquely identifies this component. Might be hashed.

- componentPackageDeps :: [(UnitId, MungedPackageId)]

  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.

- componentIncludes :: [(OpenUnitId, ModuleRenaming)]

  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.

- componentExeDeps :: [UnitId]
- componentInternalDeps :: [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!

Instances

Read ComponentLocalBuildInfo # |
Methods readsPrec :: Int -> ReadS ComponentLocalBuildInfo Source # readList :: ReadS [ComponentLocalBuildInfo] Source # readPrec :: ReadPrec ComponentLocalBuildInfo Source # readListPrec :: ReadPrec [ComponentLocalBuildInfo] Source #
Show ComponentLocalBuildInfo # |
Methods showsPrec :: Int -> ComponentLocalBuildInfo -> ShowS Source # show :: ComponentLocalBuildInfo -> String Source # showList :: [ComponentLocalBuildInfo] -> ShowS Source #
Generic ComponentLocalBuildInfo # |
Associated Types type Rep ComponentLocalBuildInfo :: * -> * Source # Methods from :: ComponentLocalBuildInfo -> Rep ComponentLocalBuildInfo x Source # to :: Rep ComponentLocalBuildInfo x -> ComponentLocalBuildInfo Source #
Binary ComponentLocalBuildInfo # |
Methods put :: ComponentLocalBuildInfo -> Put Source # get :: Get ComponentLocalBuildInfo Source # putList :: [ComponentLocalBuildInfo] -> Put Source #
IsNode ComponentLocalBuildInfo # |
Associated Types type Key ComponentLocalBuildInfo :: * # Methods nodeKey :: ComponentLocalBuildInfo -> Key ComponentLocalBuildInfo # nodeNeighbors :: ComponentLocalBuildInfo -> [Key ComponentLocalBuildInfo] #
type Rep ComponentLocalBuildInfo # |

type Rep ComponentLocalBuildInfo = D1 * (MetaData "ComponentLocalBuildInfo" "Distribution.Types.ComponentLocalBuildInfo" "Cabal-2.0.1.0" False) ((:+:) * ((:+:) * (C1 * (MetaCons "LibComponentLocalBuildInfo" PrefixI True) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentName)) ((:*:) * (S1 * (MetaSel (Just Symbol "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentId)) (S1 * (MetaSel (Just Symbol "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnitId)))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentIsIndefinite_") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) ((:*:) * (S1 * (MetaSel (Just Symbol "componentInstantiatedWith") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(ModuleName, OpenModule)])) (S1 * (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(UnitId, MungedPackageId)]))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(OpenUnitId, ModuleRenaming)])) ((:*:) * (S1 * (MetaSel (Just Symbol "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])) (S1 * (MetaSel (Just Symbol "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentCompatPackageKey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)) (S1 * (MetaSel (Just Symbol "componentCompatPackageName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * MungedPackageName))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentExposedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [ExposedModule])) (S1 * (MetaSel (Just Symbol "componentIsPublic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool))))))) (C1 * (MetaCons "FLibComponentLocalBuildInfo" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentName)) ((:*:) * (S1 * (MetaSel (Just Symbol "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentId)) (S1 * (MetaSel (Just Symbol "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnitId)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(UnitId, MungedPackageId)])) (S1 * (MetaSel (Just Symbol "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(OpenUnitId, ModuleRenaming)]))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])) (S1 * (MetaSel (Just Symbol "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId]))))))) ((:+:) * (C1 * (MetaCons "ExeComponentLocalBuildInfo" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentName)) ((:*:) * (S1 * (MetaSel (Just Symbol "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentId)) (S1 * (MetaSel (Just Symbol "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnitId)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(UnitId, MungedPackageId)])) (S1 * (MetaSel (Just Symbol "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(OpenUnitId, ModuleRenaming)]))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])) (S1 * (MetaSel (Just Symbol "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])))))) ((:+:) * (C1 * (MetaCons "TestComponentLocalBuildInfo" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentName)) ((:*:) * (S1 * (MetaSel (Just Symbol "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentId)) (S1 * (MetaSel (Just Symbol "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnitId)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(UnitId, MungedPackageId)])) (S1 * (MetaSel (Just Symbol "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(OpenUnitId, ModuleRenaming)]))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])) (S1 * (MetaSel (Just Symbol "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])))))) (C1 * (MetaCons "BenchComponentLocalBuildInfo" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentName)) ((:*:) * (S1 * (MetaSel (Just Symbol "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ComponentId)) (S1 * (MetaSel (Just Symbol "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnitId)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(UnitId, MungedPackageId)])) (S1 * (MetaSel (Just Symbol "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(OpenUnitId, ModuleRenaming)]))) ((:*:) * (S1 * (MetaSel (Just Symbol "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])) (S1 * (MetaSel (Just Symbol "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [UnitId])))))))))

type Key ComponentLocalBuildInfo # |
type Key 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 #

componentBuildable :: Component -> Bool #

Is a component buildable (i.e., not marked with `buildable: False`)? See also this note in Distribution.Types.ComponentRequestedSpec.

Since: 2.0.0.2

pkgComponents :: PackageDescription -> [Component] #

All the components in the package.

pkgBuildableComponents :: 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.

Since: 2.0.0.2

lookupComponent :: PackageDescription -> ComponentName -> Maybe Component #

getComponent :: PackageDescription -> ComponentName -> Component #

getComponentLocalBuildInfo :: LocalBuildInfo -> ComponentName -> ComponentLocalBuildInfo #

Deprecated: This function is not well-defined, because a `ComponentName` does not uniquely identify a `ComponentLocalBuildInfo`. If you have a `TargetInfo`, you should use `targetCLBI` to get the `ComponentLocalBuildInfo`. Otherwise, use `componentNameTargets` to get all possible `ComponentLocalBuildInfo`s. This will be removed in Cabal 2.2.

allComponentsInBuildOrder :: LocalBuildInfo -> [ComponentLocalBuildInfo] #

componentsInBuildOrder :: LocalBuildInfo -> [ComponentName] -> [ComponentLocalBuildInfo] #

Deprecated: You've got `TargetInfo` right? Use `neededTargetsInBuildOrder` on the `UnitId`s you can `nodeKey` out.

depLibraryPaths #

Arguments

:: Bool | Building for inplace?
-> Bool | Generate prefix-relative library paths
-> LocalBuildInfo |
-> ComponentLocalBuildInfo | Component that is being built
-> NoCallStackIO [FilePath] |

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`

allLibModules :: Library -> ComponentLocalBuildInfo -> [ModuleName] #

Get all module names that needed to be built by GHC; i.e., all of these `ModuleName`s have interface files associated with them that need to be installed.

withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () #

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`

withComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> [ComponentName] -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Deprecated: You have got a `TargetInfo` right? Use `withNeededTargetsInBuildOrder` on the `UnitId`s you can `nodeKey` out.

withComponentsLBI :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Deprecated: Use withAllComponentsInBuildOrder

withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each enabled `library` in the package description with the `ComponentLocalBuildInfo`.

withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each enabled `Executable` in the package description. Extended version of `withExe` that also gives corresponding build info.

withBenchLBI :: PackageDescription -> LocalBuildInfo -> (Benchmark -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each enabled `Benchmark` in the package description.

withTestLBI :: PackageDescription -> LocalBuildInfo -> (TestSuite -> ComponentLocalBuildInfo -> IO ()) -> IO () #

enabledTestLBIs :: PackageDescription -> LocalBuildInfo -> [(TestSuite, ComponentLocalBuildInfo)] #

enabledBenchLBIs :: PackageDescription -> LocalBuildInfo -> [(Benchmark, ComponentLocalBuildInfo)] #

# Installation directories

module Distribution.Simple.InstallDirs

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 `absoluteComponentInstallDirs` instead.

prefixRelativeInstallDirs :: PackageId -> LocalBuildInfo -> InstallDirs (Maybe 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.

absoluteComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> UnitId -> CopyDest -> InstallDirs FilePath #

See `absoluteInstallDirs`.

prefixRelativeComponentInstallDirs :: PackageId -> LocalBuildInfo -> UnitId -> InstallDirs (Maybe FilePath) #

See `prefixRelativeInstallDirs`

substPathTemplate :: PackageId -> LocalBuildInfo -> UnitId -> PathTemplate -> FilePath #