stack-1.3.2: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Runners

Description

Utilities for running stack commands.

Synopsis

- withGlobalConfigAndLock :: GlobalOpts -> StackT Config IO () -> IO ()
- withConfigAndLock :: GlobalOpts -> StackT Config IO () -> IO ()
- withMiniConfigAndLock :: GlobalOpts -> StackT MiniConfig IO () -> IO ()
- withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> StackT EnvConfig IO ()) -> IO ()
- withBuildConfig :: GlobalOpts -> StackT EnvConfig IO () -> IO ()
- withBuildConfigExt :: GlobalOpts -> Maybe (StackT Config IO ()) -> (Maybe FileLock -> StackT EnvConfig IO ()) -> Maybe (StackT Config IO ()) -> IO ()
- loadConfigWithOpts :: GlobalOpts -> IO (LoadConfig (StackT () IO))
- loadCompilerVersion :: GlobalOpts -> LoadConfig (StackT () IO) -> IO CompilerVersion
- withUserFileLock :: (MonadBaseControl IO m, MonadIO m) => GlobalOpts -> Path Abs Dir -> (Maybe FileLock -> m a) -> m a
- munlockFile :: MonadIO m => Maybe FileLock -> m ()

# Documentation

withGlobalConfigAndLock :: GlobalOpts -> StackT Config IO () -> IO () #

Loads global config, ignoring any configuration which would be loaded due to $PWD.

withConfigAndLock :: GlobalOpts -> StackT Config IO () -> IO () #

withMiniConfigAndLock :: GlobalOpts -> StackT MiniConfig IO () -> IO () #

withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> StackT EnvConfig IO ()) -> IO () #

withBuildConfig :: GlobalOpts -> StackT EnvConfig IO () -> IO () #

withBuildConfigExt #

Arguments

:: GlobalOpts |
-> Maybe (StackT Config IO ()) | Action to perform before the build. This will be run on the host OS even if Docker is enabled for builds. The build config is not available in this action, since that would require build tools to be installed on the host OS.
-> (Maybe FileLock -> StackT EnvConfig IO ()) | Action that uses the build config. If Docker is enabled for builds, this will be run in a Docker container.
-> Maybe (StackT Config IO ()) | Action to perform after the build. This will be run on the host OS even if Docker is enabled for builds. The build config is not available in this action, since that would require build tools to be installed on the host OS.
-> IO () |

loadConfigWithOpts :: GlobalOpts -> IO (LoadConfig (StackT () IO)) #

Load the configuration. Convenience function used throughout this module.

loadCompilerVersion :: GlobalOpts -> LoadConfig (StackT () IO) -> IO CompilerVersion #

withUserFileLock :: (MonadBaseControl IO m, MonadIO m) => GlobalOpts -> Path Abs Dir -> (Maybe FileLock -> m a) -> m a #

Enforce mutual exclusion of every action running via this function, on this path, on this users account.

A lock file is created inside the given directory. Currently, stack uses locks per-snapshot. In the future, stack may refine this to an even more fine-grain locking approach.

munlockFile :: MonadIO m => Maybe FileLock -> m () #

Unlock a lock file, if the value is Just