build-env-1.2.0.0: Compute, fetch and install Cabal build plans into a local environment
Safe HaskellSafe-Inferred
LanguageHaskell2010

BuildEnv.Utils

Description

Various utilities:

  • Spawning of processes in particular environments; see callProcessInIO.
  • Semaphores.
Synopsis

Call a process in a given environment

data ProgPath from Source #

The path of a program to run.

Constructors

AbsPath

An absolute path, or an executable in PATH.

RelPath

A relative path, relative to the from abstract location.

Fields

data CallProcess dir Source #

Arguments to callProcess.

Constructors

CP 

Fields

callProcessInIO Source #

Arguments

:: HasCallStack 
=> Maybe Counter

Optional counter. Used when the command fails, to report the progress that has been made so far.

-> CallProcess dir 
-> IO () 

Run a command and wait for it to complete.

Crashes if the process returns with non-zero exit code.

See CallProcess for a description of the options.

Create temporary directories

data TempDirPermanence Source #

How to handle deletion of temporary directories.

Instances

Instances details
Show TempDirPermanence Source # 
Instance details

Defined in BuildEnv.Config

withTempDir Source #

Arguments

:: TempDirPermanence

whether to delete the temporary directory after the action completes

-> String

directory name template

-> (AbsolutePath (Dir Tmp) -> IO a)

action to perform

-> IO a 

Perform an action with a fresh temporary directory.

Abstract semaphores

newtype AbstractSem Source #

Abstract acquire/release mechanism.

Constructors

AbstractSem 

Fields

withNewAbstractSem Source #

Arguments

:: AsyncSem 
-> (AbstractSem -> Args -> IO r)

the abstract semaphore to use, and extra arguments to pass to Setup configure for ghc

-> IO r 

Create a semaphore-based acquire/release mechanism.

noSem :: AbstractSem Source #

No acquire/release mechanism required.

abstractQSem :: QSem -> AbstractSem Source #

Abstract acquire/release mechanism controlled by the given QSem.

Other utilities

splitOn :: Char -> String -> [String] Source #

Utility list splitOn function.