Distribution.Client.ProjectBuilding.UnpackedPackage

cabal-install-3.12.1.0: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Client.ProjectBuilding.UnpackedPackage

Contents

- Auxiliary definitions
- Utilities

Description

This module exposes functions to build and register unpacked packages.

Mainly, unpacked packages are either: * Built and registered in-place * Built and installed

The two cases differ significantly for there to be a distinction. For instance, we only care about file monitoring and re-building when dealing with "inplace" registered packages, whereas for installed packages we don't.

Synopsis

- buildInplaceUnpackedPackage :: Verbosity -> DistDirLayout -> Maybe SemaphoreName -> BuildTimeSettings -> Lock -> Lock -> ElaboratedSharedConfig -> ElaboratedInstallPlan -> ElaboratedReadyPackage -> BuildStatusRebuild -> FilePath -> FilePath -> IO BuildResult
- buildAndInstallUnpackedPackage :: Verbosity -> DistDirLayout -> StoreDirLayout -> Maybe SemaphoreName -> BuildTimeSettings -> Lock -> Lock -> ElaboratedSharedConfig -> ElaboratedInstallPlan -> ElaboratedReadyPackage -> FilePath -> FilePath -> IO BuildResult
- buildAndRegisterUnpackedPackage :: Verbosity -> DistDirLayout -> Maybe SemaphoreName -> BuildTimeSettings -> Lock -> Lock -> ElaboratedSharedConfig -> ElaboratedInstallPlan -> ElaboratedReadyPackage -> FilePath -> FilePath -> Maybe FilePath -> (PackageBuildingPhase -> IO ()) -> IO ()
- data PackageBuildingPhase
- annotateFailure :: Maybe FilePath -> (SomeException -> BuildFailureReason) -> IO a -> IO a
- annotateFailureNoLog :: (SomeException -> BuildFailureReason) -> IO a -> IO a

# Documentation

buildInplaceUnpackedPackage :: Verbosity -> DistDirLayout -> Maybe SemaphoreName -> BuildTimeSettings -> Lock -> Lock -> ElaboratedSharedConfig -> ElaboratedInstallPlan -> ElaboratedReadyPackage -> BuildStatusRebuild -> FilePath -> FilePath -> IO BuildResult #

buildAndInstallUnpackedPackage #

Arguments

:: Verbosity |
-> DistDirLayout |
-> StoreDirLayout |
-> Maybe SemaphoreName | Whether to pass a semaphore to build process this is different to BuildTimeSettings because the name of the semaphore is created freshly each time.
-> BuildTimeSettings |
-> Lock |
-> Lock |
-> ElaboratedSharedConfig |
-> ElaboratedInstallPlan |
-> ElaboratedReadyPackage |
-> FilePath |
-> FilePath |
-> IO BuildResult |

## Auxiliary definitions

buildAndRegisterUnpackedPackage #

Arguments

:: Verbosity |
-> DistDirLayout |
-> Maybe SemaphoreName | Whether to pass a semaphore to build process this is different to BuildTimeSettings because the name of the semaphore is created freshly each time.
-> BuildTimeSettings |
-> Lock |
-> Lock |
-> ElaboratedSharedConfig |
-> ElaboratedInstallPlan |
-> ElaboratedReadyPackage |
-> FilePath |
-> FilePath |
-> Maybe FilePath | The path to an initialized log file
-> (PackageBuildingPhase -> IO ()) |
-> IO () |

Structures the phases of building and registering a package amongst others (see `PackageBuildingPhase`). Delegates logic specific to a certain building style (notably, inplace vs install) to the delegate function that receives as an argument `PackageBuildingPhase`)

data PackageBuildingPhase #

Each unpacked package is processed in the following phases:

- Configure phase
- Build phase
- Haddock phase
- Install phase (copy + register)
- Register phase
- Test phase
- Bench phase
- Repl phase

Depending on whether we are installing the package or building it inplace, the phases will be carried out differently. For example, when installing, the test, benchmark, and repl phase are ignored.

## Utilities

annotateFailure :: Maybe FilePath -> (SomeException -> BuildFailureReason) -> IO a -> IO a #

annotateFailureNoLog :: (SomeException -> BuildFailureReason) -> IO a -> IO a #