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

Stack.Build.ExecuteEnv

Description

Provides all the necessary types and functions for running cabal Setup.hs commands. Only used in the Execute and ExecutePackage modules

Synopsis

Documentation

data ExecuteEnv Source #

Constructors

ExecuteEnv 

Fields

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 
-> TaskType 
-> 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.Types.Build

data OutputType Source #

How we deal with output from GHC, either dumping to a log file or the console (with some prefix).