stack-1.3.2: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Setup

Contents

- Stack binary download

Synopsis

- setupEnv :: (StackM env m, HasBuildConfig env, HasGHCVariant env) => Maybe Text -> m EnvConfig
- ensureCompiler :: (StackM env m, HasConfig env, HasGHCVariant env) => SetupOpts -> m (Maybe ExtraDirs, CompilerBuild)
- ensureDockerStackExe :: (StackM env m, HasConfig env) => Platform -> m (Path Abs File)
- getSystemCompiler :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m (Maybe (CompilerVersion, Arch))
- data SetupOpts = SetupOpts {
  - soptsInstallIfMissing :: !Bool
  - soptsUseSystem :: !Bool
  - soptsWantedCompiler :: !CompilerVersion
  - soptsCompilerCheck :: !VersionCheck
  - soptsStackYaml :: !(Maybe (Path Abs File))
  - soptsForceReinstall :: !Bool
  - soptsSanityCheck :: !Bool
  - soptsSkipGhcCheck :: !Bool
  - soptsSkipMsys :: !Bool
  - soptsUpgradeCabal :: !Bool
  - soptsResolveMissingGHC :: !(Maybe Text)
  - soptsSetupInfoYaml :: !FilePath
  - soptsGHCBindistURL :: !(Maybe String)
  }
- defaultSetupInfoYaml :: String
- removeHaskellEnvVars :: Map Text Text -> Map Text Text
- data StackReleaseInfo
- getDownloadVersion :: StackReleaseInfo -> Maybe Version
- stackVersion :: Version
- preferredPlatforms :: (MonadReader env m, HasPlatform env) => m [(Bool, String)]
- downloadStackReleaseInfo :: MonadIO m => Maybe String -> Maybe String -> Maybe String -> m StackReleaseInfo
- downloadStackExe :: (MonadIO m, MonadLogger m, MonadReader env m, HasConfig env) => [(Bool, String)] -> StackReleaseInfo -> Path Abs Dir -> (Path Abs File -> IO ()) -> m ()

# Documentation

setupEnv #

Arguments

:: (StackM env m, HasBuildConfig env, HasGHCVariant env) |
=> Maybe Text | Message to give user when necessary GHC is not available
-> m EnvConfig |

Modify the environment variables (like PATH) appropriately, possibly doing installation too

ensureCompiler :: (StackM env m, HasConfig env, HasGHCVariant env) => SetupOpts -> m (Maybe ExtraDirs, CompilerBuild) #

Ensure compiler (ghc or ghcjs) is installed and provide the PATHs to add if necessary

ensureDockerStackExe :: (StackM env m, HasConfig env) => Platform -> m (Path Abs File) #

Ensure Docker container-compatible `stack` executable is downloaded

getSystemCompiler :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m (Maybe (CompilerVersion, Arch)) #

Get the version of the system compiler, if available

data SetupOpts #

Constructors

SetupOpts |
Fields soptsInstallIfMissing :: !Bool soptsUseSystem :: !Bool Should we use a system compiler installation, if available? soptsWantedCompiler :: !CompilerVersion soptsCompilerCheck :: !VersionCheck soptsStackYaml :: !(Maybe (Path Abs File)) If we got the desired GHC version from that file soptsForceReinstall :: !Bool soptsSanityCheck :: !Bool Run a sanity check on the selected GHC soptsSkipGhcCheck :: !Bool Don't check for a compatible GHC version/architecture soptsSkipMsys :: !Bool Do not use a custom msys installation on Windows soptsUpgradeCabal :: !Bool Upgrade the global Cabal library in the database to the newest version. Only works reliably with a stack-managed installation. soptsResolveMissingGHC :: !(Maybe Text) Message shown to user for how to resolve the missing GHC soptsSetupInfoYaml :: !FilePath Location of the main stack-setup.yaml file soptsGHCBindistURL :: !(Maybe String) Alternate GHC binary distribution (requires custom GHCVariant)

Instances

Show SetupOpts # |
Methods showsPrec :: Int -> SetupOpts -> ShowS # show :: SetupOpts -> String # showList :: [SetupOpts] -> ShowS #

defaultSetupInfoYaml :: String #

Default location of the stack-setup.yaml file

removeHaskellEnvVars :: Map Text Text -> Map Text Text #

# Stack binary download

data StackReleaseInfo #

getDownloadVersion :: StackReleaseInfo -> Maybe Version #

stackVersion :: Version #

preferredPlatforms :: (MonadReader env m, HasPlatform env) => m [(Bool, String)] #

downloadStackReleaseInfo #

Arguments

:: MonadIO m |
=> Maybe String |
-> Maybe String |
-> Maybe String | optional version
-> m StackReleaseInfo |

downloadStackExe #

Arguments

:: (MonadIO m, MonadLogger m, MonadReader env m, HasConfig env) |
=> [(Bool, String)] | acceptable platforms
-> StackReleaseInfo |
-> Path Abs Dir | destination directory
-> (Path Abs File -> IO ()) | test the temp exe before renaming
-> m () |