Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for running stack commands.
- withGlobalConfigAndLock :: GlobalOpts -> RIO Config () -> IO ()
- withConfigAndLock :: GlobalOpts -> RIO Config () -> IO ()
- withMiniConfigAndLock :: GlobalOpts -> RIO MiniConfig () -> IO ()
- withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> RIO EnvConfig ()) -> IO ()
- withBuildConfigAndLockNoDocker :: GlobalOpts -> (Maybe FileLock -> RIO EnvConfig ()) -> IO ()
- withBuildConfig :: GlobalOpts -> RIO EnvConfig () -> IO ()
- withBuildConfigExt :: Bool -> GlobalOpts -> Maybe (RIO Config ()) -> (Maybe FileLock -> RIO EnvConfig ()) -> Maybe (RIO Config ()) -> IO ()
- loadConfigWithOpts :: GlobalOpts -> (LoadConfig -> IO a) -> IO a
- loadCompilerVersion :: GlobalOpts -> LoadConfig -> IO (CompilerVersion CVWanted)
- withUserFileLock :: MonadUnliftIO m => GlobalOpts -> Path Abs Dir -> (Maybe FileLock -> m a) -> m a
- munlockFile :: MonadIO m => Maybe FileLock -> m ()
Documentation
withGlobalConfigAndLock :: GlobalOpts -> RIO Config () -> IO () Source #
Loads global config, ignoring any configuration which would be loaded due to $PWD.
withConfigAndLock :: GlobalOpts -> RIO Config () -> IO () Source #
withMiniConfigAndLock :: GlobalOpts -> RIO MiniConfig () -> IO () Source #
withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> RIO EnvConfig ()) -> IO () Source #
withBuildConfigAndLockNoDocker :: GlobalOpts -> (Maybe FileLock -> RIO EnvConfig ()) -> IO () Source #
See issue #2010 for why this exists. Currently just used for the specific case of "stack clean --full".
withBuildConfig :: GlobalOpts -> RIO EnvConfig () -> IO () Source #
:: Bool | |
-> GlobalOpts | |
-> Maybe (RIO Config ()) | 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 -> RIO EnvConfig ()) | Action that uses the build config. If Docker is enabled for builds, this will be run in a Docker container. |
-> Maybe (RIO Config ()) | 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 -> (LoadConfig -> IO a) -> IO a Source #
Load the configuration. Convenience function used throughout this module.
loadCompilerVersion :: GlobalOpts -> LoadConfig -> IO (CompilerVersion CVWanted) Source #
withUserFileLock :: MonadUnliftIO m => GlobalOpts -> Path Abs Dir -> (Maybe FileLock -> m a) -> m a Source #
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.