stack-1.6.1.1: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Build.Execute

Contents

Description

Perform a build

Synopsis

Documentation

printPlan :: HasRunner 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 
=> EnvOverride 
-> 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

:: HasEnvConfig env 
=> EnvOverride 
-> BuildOpts 
-> BuildOptsCLI 
-> BaseConfigOpts 
-> [LocalPackage] 
-> [DumpPackage () () ()]

global packages

-> [DumpPackage () () ()]

snapshot packages

-> [DumpPackage () () ()]

local packages

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

Execute a function that takes an ExecuteEnv.

withSingleContext Source #

Arguments

:: HasEnvConfig env 
=> (RIO env () -> IO ()) 
-> ActionContext 
-> ExecuteEnv 
-> Task 
-> Maybe (Map PackageIdentifier GhcPkgId)

All dependencies' package ids to provide to Setup.hs. If Nothing, just provide global and snapshot package databases.

-> Maybe String 
-> (Package -> Path Abs File -> Path Abs Dir -> (ExcludeTHLoading -> [String] -> RIO env ()) -> (Text -> RIO env ()) -> Bool -> Maybe (Path Abs File, Handle) -> 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.