stack-1.0.4.3: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Types.Build

Description

Build-specific types.

Synopsis

Documentation

data InstallLocation Source

A location to install a package into, either snapshot or local

Constructors

Snap 
Local 

modTime :: UTCTime -> ModTime Source

One-way conversion to serialized time.

class PackageInstallInfo a where Source

Datatype which tells how which version of a package to install and where to install it into

data Task Source

A task to perform when building

Constructors

Task 

Fields

taskProvides :: !PackageIdentifier

the package/version to be built

taskType :: !TaskType

the task type, telling us how to build this

taskConfigOpts :: !TaskConfigOpts
 
taskPresent :: !(Map PackageIdentifier GhcPkgId)

GhcPkgIds of already-installed dependencies

taskAllInOne :: !Bool

indicates that the package can be built in one step

Instances

data LocalPackage Source

Information on a locally available package of source code

Constructors

LocalPackage 

Fields

lpPackage :: !Package

The Package info itself, after resolution with package flags, with tests and benchmarks disabled

lpComponents :: !(Set NamedComponent)

Components to build, not including the library component.

lpUnbuildable :: !(Set NamedComponent)

Components explicitly requested for build, that are marked "buildable: false".

lpWanted :: !Bool

Whether this package is wanted as a target.

lpTestDeps :: !(Map PackageName VersionRange)

Used for determining if we can use --enable-tests in a normal build.

lpBenchDeps :: !(Map PackageName VersionRange)

Used for determining if we can use --enable-benchmarks in a normal build.

lpTestBench :: !(Maybe Package)

This stores the Package with tests and benchmarks enabled, if either is asked for by the user.

lpDir :: !(Path Abs Dir)

Directory of the package.

lpCabalFile :: !(Path Abs File)

The .cabal file

lpDirtyFiles :: !(Maybe (Set FilePath))

Nothing == not dirty, Just == dirty. Note that the Set may be empty if we forced the build to treat packages as dirty. Also, the Set may not include all modified files.

lpNewBuildCache :: !(Map FilePath FileCacheInfo)

current state of the files

lpFiles :: !(Set (Path Abs File))

all files used by this package

data BaseConfigOpts Source

Basic information used to calculate what the configure options are

data Plan Source

A complete plan of what needs to be built and how to do it

Constructors

Plan 

Fields

planTasks :: !(Map PackageName Task)
 
planFinals :: !(Map PackageName Task)

Final actions to be taken (test, benchmark, etc)

planUnregisterLocal :: !(Map GhcPkgId (PackageIdentifier, Maybe Text))

Text is reason we're unregistering, for display only

planInstallExes :: !(Map Text InstallLocation)

Executables that should be installed after successful building

Instances

data TestOpts Source

Options for the FinalAction DoTests

Constructors

TestOpts 

Fields

toRerunTests :: !Bool

Whether successful tests will be run gain

toAdditionalArgs :: ![String]

Arguments passed to the test program

toCoverage :: !Bool

Generate a code coverage report

toDisableRun :: !Bool

Disable running of tests

data BenchmarkOpts Source

Options for the FinalAction DoBenchmarks

Constructors

BenchmarkOpts 

Fields

beoAdditionalArgs :: !(Maybe String)

Arguments passed to the benchmark program

beoDisableRun :: !Bool

Disable running of benchmarks

data BuildOpts Source

Configuration for building.

Constructors

BuildOpts 

Fields

boptsTargets :: ![Text]
 
boptsLibProfile :: !Bool
 
boptsExeProfile :: !Bool
 
boptsHaddock :: !Bool

Build haddocks?

boptsHaddockDeps :: !(Maybe Bool)

Build haddocks for dependencies?

boptsDryrun :: !Bool
 
boptsGhcOptions :: ![Text]
 
boptsFlags :: !(Map (Maybe PackageName) (Map FlagName Bool))
 
boptsInstallExes :: !Bool

Install executables to user path after building?

boptsPreFetch :: !Bool

Fetch all packages immediately

boptsBuildSubset :: !BuildSubset
 
boptsFileWatch :: !FileWatchOpts

Watch files for changes and automatically rebuild

boptsKeepGoing :: !(Maybe Bool)

Keep building/running after failure

boptsForceDirty :: !Bool

Force treating all local packages as having dirty files

boptsTests :: !Bool

Turn on tests for local targets

boptsTestOpts :: !TestOpts

Additional test arguments

boptsBenchmarks :: !Bool

Turn on benchmarks for local targets

boptsBenchmarkOpts :: !BenchmarkOpts

Additional test arguments

boptsExec :: ![(String, [String])]

Commands (with arguments) to run after a successful build

boptsOnlyConfigure :: !Bool

Only perform the configure step when building

boptsReconfigure :: !Bool

Perform the configure step even if already configured

boptsCabalVerbose :: !Bool

Ask Cabal to be verbose in its builds

Instances

data BuildSubset Source

Which subset of packages to build

Constructors

BSAll 
BSOnlySnapshot

Only install packages in the snapshot database, skipping packages intended for the local database.

BSOnlyDependencies 

data TaskType Source

The type of a task, either building local code or something from the package index (upstream)

Instances

data TaskConfigOpts Source

Given the IDs of any missing packages, produce the configure options

Constructors

TaskConfigOpts 

Fields

tcoMissing :: !(Set PackageIdentifier)

Dependencies for which we don't yet have an GhcPkgId

tcoOpts :: !(Map PackageIdentifier GhcPkgId -> ConfigureOpts)

Produce the list of options given the missing GhcPkgIds

data ConfigCache Source

Stored on disk to know whether the flags have changed or any files have changed.

Constructors

ConfigCache 

Fields

configCacheOpts :: !ConfigureOpts

All options used for this package.

configCacheDeps :: !(Set GhcPkgId)

The GhcPkgIds of all of the dependencies. Since Cabal doesn't take the complete GhcPkgId (only a PackageIdentifier) in the configure options, just using the previous value is insufficient to know if dependencies have changed.

configCacheComponents :: !(Set ByteString)

The components to be built. It's a bit of a hack to include this in here, as it's not a configure option (just a build option), but this is a convenient way to force compilation when the components change.

configCacheHaddock :: !Bool

Are haddocks to be built?

configureOpts Source

Arguments

:: EnvConfig 
-> BaseConfigOpts 
-> Map PackageIdentifier GhcPkgId

dependencies

-> Bool

wanted?

-> Bool

local non-extra-dep?

-> InstallLocation 
-> Package 
-> ConfigureOpts 

Render a BaseConfigOpts to an actual list of options

data BadDependency Source

Reason why a dependency was not used

wantedLocalPackages :: [LocalPackage] -> Set PackageName Source

Get set of wanted package names from locals.

data ConfigureOpts Source

Configure options to be sent to Setup.hs configure

Constructors

ConfigureOpts 

Fields

coDirs :: ![String]

Options related to various paths. We separate these out since they do not have an impact on the contents of the compiled binary for checking if we can use an existing precompiled cache.

coNoDirs :: ![String]
 

data PrecompiledCache Source

Information on a compiled package: the library conf file (if relevant), and all of the executable paths.

Constructors

PrecompiledCache 

Fields

pcLibrary :: !(Maybe FilePath)

.conf file inside the package database

pcExes :: ![FilePath]

Full paths to executables