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

BuildEnv.Config

Description

Configuration options for build-env

Synopsis

Build strategy

data BuildStrategy Source #

Build strategy for buildPlan.

Constructors

Execute RunStrategy

Execute the build plan in-place.

Script

Output a build script that can be run later.

Fields

  • scriptPath :: !FilePath

    Output path at which to write the build script.

  • useVariables :: !Bool

    Should the output shell script use variables, or baked in paths?

    The shell script will use the following variables:

    • GHC, GHCPKG, SOURCES, PREFIX, DESTDIR.

Instances

Instances details
Show BuildStrategy Source # 
Instance details

Defined in BuildEnv.Config

data RunStrategy Source #

How to execute a build plan.

Constructors

TopoSort

Topologically sort the cabal build plan, and build the packages in sequence.

Async

Asynchronously build all the packages, with each package waiting on its dependencies.

Fields

  • AsyncSem

    The kind of semaphore to use to control concurrency.

Instances

Instances details
Show RunStrategy Source # 
Instance details

Defined in BuildEnv.Config

data AsyncSem Source #

What kind of semaphore to use in buildPlan?

NB: this datatype depends on whether the jsem flag was enabled when building the build-env package.

Constructors

NoSem

Don't use any semaphore (not recommended).

NewQSem !Word16

Create a new QSem semaphore with the given number of tokens.

Instances

Instances details
Show AsyncSem Source # 
Instance details

Defined in BuildEnv.Config

semDescription :: AsyncSem -> Text Source #

A description of the kind of semaphore we are using to control concurrency.

Passing arguments

type Args = [String] Source #

A type synonym for command-line arguments.

data UnitArgs Source #

Arguments specific to a unit.

Constructors

UnitArgs 

Fields

Instances

Instances details
Show UnitArgs Source # 
Instance details

Defined in BuildEnv.Config

ghc and cabal-install executables

data Compiler Source #

Paths to the ghc and ghc-pkg executables.

Constructors

Compiler 

Instances

Instances details
Show Compiler Source # 
Instance details

Defined in BuildEnv.Config

data Cabal Source #

Path to the cabal-install executable.

Constructors

Cabal 

Fields

Instances

Instances details
Show Cabal Source # 
Instance details

Defined in BuildEnv.Config

Methods

showsPrec :: Int -> Cabal -> ShowS #

show :: Cabal -> String #

showList :: [Cabal] -> ShowS #

Directory structure

data Paths use Source #

The directory structure relevant to preparing and carrying out a build plan.

Constructors

Paths 

Fields

  • fetchDir :: !FilePath

    Input fetched sources directory.

  • buildPaths :: BuildPaths use

    Output build directory structure.

    NB: this will be bottom in the case that we are outputing a shell script that uses variables.

data family BuildPaths use Source #

The directory structure relevant to executing a build plan.

data PathUsability Source #

The appropriate stage at which to use a filepath.

Constructors

Raw

We have just parsed filepaths. They need to be canonicalised before they can be used.

ForPrep

The filepaths have been canonicalised.

They are now suitable for preparatory build instructions, but not for performing the build.

ForBuild

The paths are suitable for performing the build.

canonicalizePaths :: Compiler -> BuildStrategy -> Paths Raw -> IO (Paths ForPrep, Paths ForBuild) Source #

Canonicalise raw Paths, computing the appropriate directory structure for preparing and executing a build, respectively.

Handling of temporary directories

data TempDirPermanence Source #

How to handle deletion of temporary directories.

Instances

Instances details
Show TempDirPermanence Source # 
Instance details

Defined in BuildEnv.Config

Logging verbosity

newtype Verbosity Source #

Verbosity level for the build-env package.

The default verbosity level is Normal (1).

Constructors

Verbosity Int 

Bundled Patterns

pattern Quiet :: Verbosity 
pattern Normal :: Verbosity 
pattern Verbose :: Verbosity 
pattern Debug :: Verbosity 

Reporting progress

data Counter Source #

A counter to measure progress, as units are compiled.

Constructors

Counter 

Fields

OS specifics

data Style Source #

Whether to use Posix or Windows style:

  • for executables, ./prog vs prog.exe,
  • for the path separator, : vs ;.

Constructors

PosixStyle 
WinStyle 

hostStyle :: Style Source #

The style associated with the OS the program is currently running on.

pATHSeparator :: Style -> String Source #

OS-dependent separator for the PATH environment variable.