| Copyright | Isaac Jones 2003-2004 |
|---|---|
| License | BSD3 |
| Maintainer | cabal-devel@haskell.org |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Distribution.Simple.LocalBuildInfo
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
- data ComponentName
- 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 { }
- | ExeComponentLocalBuildInfo { }
- | TestComponentLocalBuildInfo { }
- | BenchComponentLocalBuildInfo { }
- = LibComponentLocalBuildInfo {
- 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 Source #
Data cached after configuration step. See also
ConfigFlags.
Constructors
| LocalBuildInfo | |
Fields
| |
Instances
externalPackageDeps :: LocalBuildInfo -> [(UnitId, MungedPackageId)] Source #
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 Source #
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 Source #
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 Source #
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
Constructors
| CLib Library | |
| CFLib ForeignLib | |
| CExe Executable | |
| CTest TestSuite | |
| CBench Benchmark |
data ComponentName Source #
Constructors
| CLibName | |
| CSubLibName UnqualComponentName | |
| CFLibName UnqualComponentName | |
| CExeName UnqualComponentName | |
| CTestName UnqualComponentName | |
| CBenchName UnqualComponentName |
Instances
componentNameString :: ComponentName -> Maybe UnqualComponentName Source #
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 Source #
The first five fields are common across all algebraic variants.
Constructors
| LibComponentLocalBuildInfo | |
Fields
| |
| FLibComponentLocalBuildInfo | |
Fields
| |
| ExeComponentLocalBuildInfo | |
Fields
| |
| TestComponentLocalBuildInfo | |
Fields
| |
| BenchComponentLocalBuildInfo | |
Fields
| |
Instances
foldComponent :: (Library -> a) -> (ForeignLib -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a Source #
componentBuildable :: Component -> Bool Source #
Is a component buildable (i.e., not marked with buildable: False)?
See also this note in
Distribution.Types.ComponentRequestedSpec.
Since: 2.0.0.0
pkgComponents :: PackageDescription -> [Component] Source #
All the components in the package.
pkgBuildableComponents :: PackageDescription -> [Component] Source #
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.0
getComponentLocalBuildInfo :: LocalBuildInfo -> ComponentName -> ComponentLocalBuildInfo Source #
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 ComponentLocalBuildInfos. This will be removed in Cabal 2.2.
componentsInBuildOrder :: LocalBuildInfo -> [ComponentName] -> [ComponentLocalBuildInfo] Source #
Deprecated: You've got TargetInfo right? Use neededTargetsInBuildOrder on the UnitIds you can nodeKey out.
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] Source #
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.
withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () Source #
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 () Source #
Deprecated: You have got a TargetInfo right? Use withNeededTargetsInBuildOrder on the UnitIds you can nodeKey out.
withComponentsLBI :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () Source #
Deprecated: Use withAllComponentsInBuildOrder
withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO () Source #
Perform the action on each enabled library in the package
description with the ComponentLocalBuildInfo.
withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO () Source #
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 () Source #
Perform the action on each enabled Benchmark in the package
description.
withTestLBI :: PackageDescription -> LocalBuildInfo -> (TestSuite -> ComponentLocalBuildInfo -> IO ()) -> IO () Source #
enabledTestLBIs :: PackageDescription -> LocalBuildInfo -> [(TestSuite, ComponentLocalBuildInfo)] Source #
enabledBenchLBIs :: PackageDescription -> LocalBuildInfo -> [(Benchmark, ComponentLocalBuildInfo)] Source #
Installation directories
absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath Source #
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) Source #
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 Source #
See absoluteInstallDirs.
prefixRelativeComponentInstallDirs :: PackageId -> LocalBuildInfo -> UnitId -> InstallDirs (Maybe FilePath) Source #
substPathTemplate :: PackageId -> LocalBuildInfo -> UnitId -> PathTemplate -> FilePath Source #