stack-2.14.0: The Haskell Tool Stack
Safe HaskellSafe-Inferred
LanguageGHC2021

Stack.Build.Execute

Description

Perform a build

Synopsis

Documentation

printPlan :: (HasRunner env, HasTerm env) => Plan -> RIO env () Source #

Print a description of build plan for human consumption.

preFetch :: HasEnvConfig env => Plan -> RIO env () Source #

Fetch the packages necessary for a build, for example in combination with a dry run.

executePlan Source #

Arguments

:: HasEnvConfig env 
=> BuildOptsCLI 
-> BaseConfigOpts 
-> [LocalPackage] 
-> [DumpPackage]

global packages

-> [DumpPackage]

snapshot packages

-> [DumpPackage]

local packages

-> InstalledMap 
-> Map PackageName Target 
-> Plan 
-> RIO env () 

Perform the actual plan

Running Setup.hs

withExecuteEnv Source #

Arguments

:: forall env a. HasEnvConfig env 
=> BuildOpts 
-> BuildOptsCLI 
-> BaseConfigOpts 
-> [LocalPackage] 
-> [DumpPackage]

global packages

-> [DumpPackage]

snapshot packages

-> [DumpPackage]

local packages

-> Maybe Int

largest package name, for nicer interleaved output

-> (ExecuteEnv -> RIO env a) 
-> RIO env a 

Execute a function that takes an ExecuteEnv.

withSingleContext Source #

Arguments

:: forall env a. HasEnvConfig env 
=> ActionContext 
-> ExecuteEnv 
-> Task 
-> Map PackageIdentifier GhcPkgId

All dependencies' package ids to provide to Setup.hs.

-> Maybe String 
-> (Package -> Path Abs File -> Path Abs Dir -> (KeepOutputOpen -> ExcludeTHLoading -> [String] -> RIO env ()) -> (Utf8Builder -> RIO env ()) -> OutputType -> RIO env a) 
-> RIO env a 

This sets up a context for executing build steps which need to run Cabal (via a compiled Setup.hs). In particular it does the following:

  • Ensures the package exists in the file system, downloading if necessary.
  • Opens a log file if the built output shouldn't go to stderr.
  • Ensures that either a simple Setup.hs is built, or the package's custom setup is built.
  • Provides the user a function with which run the Cabal process.

data KeepOutputOpen Source #

special marker for expected failures in curator builds, using those we need to keep log handle open as build continues further even after a failure

Constructors

KeepOpen 
CloseOnException 

Instances

Instances details
Eq KeepOutputOpen Source # 
Instance details

Defined in Stack.Build.Execute