Cabal-1.24.2.0: A framework for packaging Haskell software

CopyrightIsaac Jones 2003-2004
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Distribution.Simple.LocalBuildInfo

Contents

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

Documentation

data LocalBuildInfo #

Data cached after configuration step. See also ConfigFlags.

Constructors

LocalBuildInfo 

Fields

Instances

Read LocalBuildInfo # 
Show LocalBuildInfo # 
Generic LocalBuildInfo # 

Associated Types

type Rep LocalBuildInfo :: * -> * #

Binary LocalBuildInfo # 
type Rep LocalBuildInfo # 
type Rep LocalBuildInfo = D1 (MetaData "LocalBuildInfo" "Distribution.Simple.LocalBuildInfo" "Cabal-1.24.2.0-De1ahvNF2IcJJcG0kSNo3w" 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 "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 "componentsConfigs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(ComponentName, ComponentLocalBuildInfo, [ComponentName])])) ((:*:) (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 ProgramConfiguration))) ((:*:) (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 "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, PackageId)] #

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 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 ComponentId from the library component of a LocalBuildInfo if it exists, or make a fake compatibility package key based on the package ID.

Buildable package components

data ComponentName #

Instances

Eq ComponentName # 
Ord ComponentName # 
Read ComponentName # 
Show ComponentName # 
Generic ComponentName # 

Associated Types

type Rep ComponentName :: * -> * #

Binary ComponentName # 
type Rep ComponentName # 

data ComponentLocalBuildInfo #

Constructors

LibComponentLocalBuildInfo 

Fields

ExeComponentLocalBuildInfo 

Fields

TestComponentLocalBuildInfo 

Fields

BenchComponentLocalBuildInfo 

Fields

Instances

Read ComponentLocalBuildInfo # 
Show ComponentLocalBuildInfo # 
Generic ComponentLocalBuildInfo # 
Binary ComponentLocalBuildInfo # 
type Rep ComponentLocalBuildInfo # 
type Rep ComponentLocalBuildInfo = D1 (MetaData "ComponentLocalBuildInfo" "Distribution.Simple.LocalBuildInfo" "Cabal-1.24.2.0-De1ahvNF2IcJJcG0kSNo3w" False) ((:+:) ((:+:) (C1 (MetaCons "LibComponentLocalBuildInfo" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, PackageId)])) (S1 (MetaSel (Just Symbol "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnitId))) ((:*:) (S1 (MetaSel (Just Symbol "componentCompatPackageKey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) ((:*:) (S1 (MetaSel (Just Symbol "componentExposedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ExposedModule])) (S1 (MetaSel (Just Symbol "componentPackageRenaming") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map PackageName ModuleRenaming))))))) (C1 (MetaCons "ExeComponentLocalBuildInfo" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, PackageId)])) (S1 (MetaSel (Just Symbol "componentPackageRenaming") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map PackageName ModuleRenaming)))))) ((:+:) (C1 (MetaCons "TestComponentLocalBuildInfo" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, PackageId)])) (S1 (MetaSel (Just Symbol "componentPackageRenaming") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map PackageName ModuleRenaming))))) (C1 (MetaCons "BenchComponentLocalBuildInfo" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, PackageId)])) (S1 (MetaSel (Just Symbol "componentPackageRenaming") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map PackageName ModuleRenaming)))))))

foldComponent :: (Library -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a #

pkgComponents :: PackageDescription -> [Component] #

All the components in the package (libs, exes, or test suites).

pkgEnabledComponents :: PackageDescription -> [Component] #

All the components in the package that are buildable and enabled. Thus this excludes non-buildable components and test suites or benchmarks that have been disabled.

checkComponentsCyclic :: Ord key => [(node, key, [key])] -> Maybe [(node, key, [key])] #

depLibraryPaths #

Arguments

:: Bool

Building for inplace?

-> Bool

Generate prefix-relative library paths

-> LocalBuildInfo 
-> ComponentLocalBuildInfo

Component that is being built

-> IO [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

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

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

Deprecated: Use withAllComponentsInBuildOrder

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

If the package description has a library section, call the given function with the library build info as argument. Extended version of withLib that also gives corresponding build info.

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

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

Installation directories