stack-2.5.1.1: The Haskell Tool Stack
Safe HaskellNone
LanguageHaskell2010

Stack.Runners

Description

Utilities for running stack commands.

Instead of using Has-style classes below, the type signatures use concrete environments to try and avoid accidentally rerunning configuration parsing. For example, we want withConfig $ withConfig $ ... to fail.

Synopsis

Documentation

withBuildConfig :: RIO BuildConfig a -> RIO Config a Source #

Load the build configuration, adds build-specific values to config loaded by loadConfig. values.

withEnvConfig Source #

Arguments

:: NeedTargets 
-> BuildOptsCLI 
-> RIO EnvConfig a

Action that uses the build config. If Docker is enabled for builds, this will be run in a Docker container.

-> RIO Config a 

Upgrade a Config environment to an EnvConfig environment by performing further parsing of project-specific configuration (like withBuildConfig) and then setting up a build environment toolchain. This is intended to be run inside a call to withConfig.

withDefaultEnvConfig :: RIO EnvConfig a -> RIO Config a Source #

Helper for withEnvConfig which passes in some default arguments:

  • No targets are requested
  • Default command line build options are assumed

withConfig :: ShouldReexec -> RIO Config a -> RIO Runner a Source #

Load the configuration. Convenience function used throughout this module.

withGlobalProject :: RIO Runner a -> RIO Runner a Source #

Ensure that no project settings are used when running withConfig.

withRunnerGlobal :: GlobalOpts -> RIO Runner a -> IO a Source #

Use the GlobalOpts to create a Runner and run the provided action.

data ShouldReexec Source #

If the settings justify it, should we reexec inside Docker or Nix?

Constructors

YesReexec 
NoReexec