Safe Haskell | None |
---|---|
Language | GHC2021 |
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
- data ExecuteEnv = ExecuteEnv {
- installLock :: !(MVar ())
- buildOpts :: !BuildOpts
- buildOptsCLI :: !BuildOptsCLI
- baseConfigOpts :: !BaseConfigOpts
- ghcPkgIds :: !(TVar (Map PackageIdentifier Installed))
- tempDir :: !(Path Abs Dir)
- setupHs :: !(Path Abs File)
- setupShimHs :: !(Path Abs File)
- setupExe :: !(Maybe (Path Abs File))
- cabalPkgVer :: !Version
- totalWanted :: !Int
- locals :: ![LocalPackage]
- globalDB :: !(Path Abs Dir)
- globalDumpPkgs :: !(Map GhcPkgId DumpPackage)
- snapshotDumpPkgs :: !(TVar (Map GhcPkgId DumpPackage))
- localDumpPkgs :: !(TVar (Map GhcPkgId DumpPackage))
- logFiles :: !(TChan (Path Abs Dir, Path Abs File))
- customBuilt :: !(IORef (Set PackageName))
- largestPackageName :: !(Maybe Int)
- pathEnvVar :: !Text
- withExecuteEnv :: HasEnvConfig env => BuildOpts -> BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage] -> [DumpPackage] -> [DumpPackage] -> Maybe Int -> (ExecuteEnv -> RIO env a) -> RIO env a
- withSingleContext :: HasEnvConfig env => ActionContext -> ExecuteEnv -> TaskType -> Map PackageIdentifier GhcPkgId -> Maybe String -> (Package -> Path Abs File -> Path Abs Dir -> (KeepOutputOpen -> ExcludeTHLoading -> [String] -> RIO env ()) -> (Utf8Builder -> RIO env ()) -> OutputType -> RIO env a) -> RIO env a
- data ExcludeTHLoading
- data KeepOutputOpen
- data OutputType
Documentation
data ExecuteEnv Source #
Constructors
ExecuteEnv | |
Fields
|
Arguments
:: HasEnvConfig env | |
=> BuildOpts | |
-> BuildOptsCLI | |
-> BaseConfigOpts | |
-> [LocalPackage] | |
-> [DumpPackage] | global packages |
-> [DumpPackage] | snapshot packages |
-> [DumpPackage] | project packages and local extra-deps |
-> Maybe Int | largest package name, for nicer interleaved output |
-> (ExecuteEnv -> RIO env a) | |
-> RIO env a |
Execute a function that takes an ExecuteEnv
.
Arguments
:: 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 ExcludeTHLoading Source #
Constructors
ExcludeTHLoading | |
KeepTHLoading |
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
Eq KeepOutputOpen Source # | |
Defined in Stack.Types.Build Methods (==) :: KeepOutputOpen -> KeepOutputOpen -> Bool # (/=) :: KeepOutputOpen -> KeepOutputOpen -> Bool # |