build-env-1.2.0.0: Compute, fetch and install Cabal build plans into a local environment
Safe HaskellSafe-Inferred
LanguageHaskell2010

BuildEnv.BuildOne

Description

setupPackage prepares a package for building, returning instructions that compile its Setup script.

buildUnit computes build instructions to configure, build and install the unit using its Setup script. If the unit is a library, the instructions will also register it into a local package database using ghc-pkg.

Synopsis

Building packages

setupPackage Source #

Arguments

:: Verbosity 
-> Compiler 
-> SymbolicPath CWD (Dir Project) 
-> BuildPaths ForBuild

Overall build directory structure.

-> PkgDbDir ForBuild

Package database directory (see getPkgDbDirForBuild).

-> PkgDir ForPrep

Package directory (to find the Setup.hs).

-> PkgDir ForBuild

Package directory (to build the Setup.hs).

-> Map UnitId PlanUnit

All dependencies in the build plan.

-> ConfiguredUnit

The unit to build.

-> IO BuildScript 

Setup a single package.

Returns a build script which compiles the Setup script.

buildUnit Source #

Arguments

:: Verbosity 
-> Compiler 
-> SymbolicPath CWD (Dir Project) 
-> BuildPaths ForBuild

Overall build directory structure.

-> PkgDbDir ForBuild

Package database directory (see getPkgDbDirForBuild).

-> PkgDir ForBuild

This package's directory (see getPkgDir).

-> UnitArgs

Extra arguments for this unit.

-> Map UnitId PlanUnit

All dependencies in the build plan.

-> ConfiguredUnit

The unit to build.

-> BuildScript 

Return build steps to to configure, build and and installing the unit, including registering it in the package database if it is a library.

You can run the build script with executeBuildScript, or you can turn it into a shell script with script.

Note: executing the build script will fail if the unit has already been registered in the package database.

Package directory structure helpers

data PkgDir use Source #

The package name-version string and its directory.

Constructors

PkgDir 

Fields

getPkgDir Source #

Arguments

:: Paths use

Overall directory structure to base the computation off.

-> ConfiguredUnit

Any unit from the package in question.

-> PkgDir use 

Compute the package directory location.

data family PkgDbDir use Source #

The package database directory.

Instances

Instances details
data PkgDbDir 'ForBuild Source # 
Instance details

Defined in BuildEnv.BuildOne

data PkgDbDir 'ForPrep Source # 
Instance details

Defined in BuildEnv.BuildOne

getPkgDbDirForPrep :: Paths ForPrep -> PkgDbDir ForPrep Source #

Compute the paths of the package database directory we are going to use.

getPkgDbDirForBuild :: Paths ForBuild -> IO (PkgDbDir ForBuild) Source #

Compute the paths of the package database directory we are going to use, and create some semaphores to control access to it in order to avoid contention.