Cabal-3.12.1.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Types.LocalBuildInfo

Contents

- The types
- Convenience accessors
- Build targets of the `LocalBuildInfo`.
- Functions you SHOULD NOT USE (yet), but are defined here to

Synopsis

- data LocalBuildInfo where
  - NewLocalBuildInfo {
    - localBuildDescr :: LocalBuildDescr
    - localBuildConfig :: LocalBuildConfig
    }
  - pattern LocalBuildInfo :: ConfigFlags -> FlagAssignment -> ComponentRequestedSpec -> [String] -> InstallDirTemplates -> Compiler -> Platform -> Maybe FilePath -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -> Map (PackageName, ComponentName) ComponentId -> InstalledPackageIndex -> PackageDescription -> ProgramDb -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> [UnitId] -> Bool -> LocalBuildInfo
- localComponentId :: LocalBuildInfo -> ComponentId
- localUnitId :: LocalBuildInfo -> UnitId
- localCompatPackageKey :: LocalBuildInfo -> String
- localPackage :: LocalBuildInfo -> PackageId
- buildDir :: LocalBuildInfo -> FilePath
- buildDirPBD :: PackageBuildDescr -> FilePath
- configFlagsBuildDir :: ConfigFlags -> FilePath
- cabalFilePath :: LocalBuildInfo -> Maybe FilePath
- progPrefix :: LocalBuildInfo -> PathTemplate
- progSuffix :: LocalBuildInfo -> PathTemplate
- componentNameCLBIs :: LocalBuildInfo -> ComponentName -> [ComponentLocalBuildInfo]
- componentNameTargets' :: PackageDescription -> LocalBuildInfo -> ComponentName -> [TargetInfo]
- unitIdTarget' :: PackageDescription -> LocalBuildInfo -> UnitId -> Maybe TargetInfo
- allTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [TargetInfo]
- withAllTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> (TargetInfo -> IO ()) -> IO ()
- neededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> [TargetInfo]
- withNeededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO ()
- testCoverage :: LocalBuildInfo -> Bool
- componentNameTargets :: LocalBuildInfo -> ComponentName -> [TargetInfo]
- unitIdTarget :: LocalBuildInfo -> UnitId -> Maybe TargetInfo
- allTargetsInBuildOrder :: LocalBuildInfo -> [TargetInfo]
- withAllTargetsInBuildOrder :: LocalBuildInfo -> (TargetInfo -> IO ()) -> IO ()
- neededTargetsInBuildOrder :: LocalBuildInfo -> [UnitId] -> [TargetInfo]
- withNeededTargetsInBuildOrder :: LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO ()

# The types

data LocalBuildInfo Source #

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

Constructors

NewLocalBuildInfo |

Fields

- localBuildDescr :: LocalBuildDescr

  Information about a package determined by Cabal after the configuration step.

- localBuildConfig :: LocalBuildConfig

  Information about a package configuration that can be modified by the user at configuration time.

Bundled Patterns

pattern LocalBuildInfo :: ConfigFlags -> FlagAssignment -> ComponentRequestedSpec -> [String] -> InstallDirTemplates -> Compiler -> Platform -> Maybe FilePath -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -> Map (PackageName, ComponentName) ComponentId -> InstalledPackageIndex -> PackageDescription -> ProgramDb -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> [UnitId] -> Bool -> LocalBuildInfo

This pattern synonym is for backwards compatibility, to adapt to `LocalBuildInfo` being split into `LocalBuildDescr` and `LocalBuildConfig`.

#### Instances

Instances details

Structured LocalBuildInfo Source # |
Instance details Defined in Distribution.Types.LocalBuildInfo Methods structure :: Proxy LocalBuildInfo -> Structure Source # structureHash' :: Tagged LocalBuildInfo MD5
Binary LocalBuildInfo Source # |
Instance details Defined in Distribution.Types.LocalBuildInfo Methods put :: LocalBuildInfo -> Put # get :: Get LocalBuildInfo # putList :: [LocalBuildInfo] -> Put #
Generic LocalBuildInfo Source # |

Instance details

Defined in Distribution.Types.LocalBuildInfo

Associated Types

type Rep LocalBuildInfo |

Instance details

Defined in Distribution.Types.LocalBuildInfo

type Rep LocalBuildInfo = D1 ('MetaData "LocalBuildInfo" "Distribution.Types.LocalBuildInfo" "Cabal-3.12.1.0-cda0" 'False) (C1 ('MetaCons "NewLocalBuildInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "localBuildDescr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalBuildDescr) :*: S1 ('MetaSel ('Just "localBuildConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalBuildConfig)))

Methods

from :: LocalBuildInfo -> Rep LocalBuildInfo x #

to :: Rep LocalBuildInfo x -> LocalBuildInfo #

Read LocalBuildInfo Source # |
Instance details Defined in Distribution.Types.LocalBuildInfo Methods readsPrec :: Int -> ReadS LocalBuildInfo # readList :: ReadS [LocalBuildInfo] # readPrec :: ReadPrec LocalBuildInfo # readListPrec :: ReadPrec [LocalBuildInfo] #
Show LocalBuildInfo Source # |
Instance details Defined in Distribution.Types.LocalBuildInfo Methods showsPrec :: Int -> LocalBuildInfo -> ShowS # show :: LocalBuildInfo -> String # showList :: [LocalBuildInfo] -> ShowS #
type Rep LocalBuildInfo Source # |

Instance details

Defined in Distribution.Types.LocalBuildInfo

type Rep LocalBuildInfo = D1 ('MetaData "LocalBuildInfo" "Distribution.Types.LocalBuildInfo" "Cabal-3.12.1.0-cda0" 'False) (C1 ('MetaCons "NewLocalBuildInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "localBuildDescr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalBuildDescr) :*: S1 ('MetaSel ('Just "localBuildConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalBuildConfig)))

# Convenience accessors

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.

localPackage :: LocalBuildInfo -> PackageId Source #

Extract the `PackageIdentifier` of a `LocalBuildInfo`. This is a "safe" use of `localPkgDescr`

buildDir :: LocalBuildInfo -> FilePath Source #

buildDirPBD :: PackageBuildDescr -> FilePath Source #

configFlagsBuildDir :: ConfigFlags -> FilePath Source #

cabalFilePath :: LocalBuildInfo -> Maybe FilePath Source #

progPrefix :: LocalBuildInfo -> PathTemplate Source #

progSuffix :: LocalBuildInfo -> PathTemplate Source #

# Build targets of the `LocalBuildInfo`.

componentNameCLBIs :: LocalBuildInfo -> ComponentName -> [ComponentLocalBuildInfo] Source #

Return all `ComponentLocalBuildInfo`s associated with `ComponentName`. In the presence of Backpack there may be more than one!

componentNameTargets' :: PackageDescription -> LocalBuildInfo -> ComponentName -> [TargetInfo] Source #

Return all `TargetInfo`s 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`.

unitIdTarget' :: PackageDescription -> LocalBuildInfo -> UnitId -> Maybe TargetInfo Source #

allTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [TargetInfo] Source #

Return the list of default `TargetInfo`s 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`.

withAllTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> (TargetInfo -> IO ()) -> IO () Source #

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

neededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> [TargetInfo] Source #

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

withNeededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO () Source #

Execute `f` for every `TargetInfo` needed to build `uid`s, respecting the build dependency order. Has a prime because it takes a `PackageDescription` argument which may disagree with `localPkgDescr` in `LocalBuildInfo`.

testCoverage :: LocalBuildInfo -> Bool Source #

Is coverage enabled for test suites? In practice, this requires library and executable profiling to be enabled.

# Functions you SHOULD NOT USE (yet), but are defined here to

componentNameTargets :: LocalBuildInfo -> ComponentName -> [TargetInfo] Source #

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 Source #

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] Source #

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 () Source #

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] Source #

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 () Source #

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.