Safe Haskell | None |
---|---|
Language | Haskell2010 |
The Config type.
- class HasPlatform env where
- getPlatform :: env -> Platform
- getPlatformVariant :: env -> PlatformVariant
- class HasStackRoot env where
- getStackRoot :: env -> Path Abs Dir
- data PlatformVariant
- data Config = Config {
- configStackRoot :: !(Path Abs Dir)
- configWorkDir :: !(Path Rel Dir)
- configUserConfigPath :: !(Path Abs File)
- configDocker :: !DockerOpts
- configNix :: !NixOpts
- configEnvOverride :: !(EnvSettings -> IO EnvOverride)
- configLocalProgramsBase :: !(Path Abs Dir)
- configLocalPrograms :: !(Path Abs Dir)
- configConnectionCount :: !Int
- configHideTHLoading :: !Bool
- configPlatform :: !Platform
- configPlatformVariant :: !PlatformVariant
- configGHCVariant0 :: !(Maybe GHCVariant)
- configLatestSnapshotUrl :: !Text
- configPackageIndices :: ![PackageIndex]
- configSystemGHC :: !Bool
- configInstallGHC :: !Bool
- configSkipGHCCheck :: !Bool
- configSkipMsys :: !Bool
- configCompilerCheck :: !VersionCheck
- configLocalBin :: !(Path Abs Dir)
- configRequireStackVersion :: !VersionRange
- configJobs :: !Int
- configExtraIncludeDirs :: !(Set Text)
- configExtraLibDirs :: !(Set Text)
- configConfigMonoid :: !ConfigMonoid
- configConcurrentTests :: !Bool
- configImage :: !ImageOpts
- configTemplateParams :: !(Map Text Text)
- configScmInit :: !(Maybe SCM)
- configGhcOptions :: !(Map (Maybe PackageName) [Text])
- configSetupInfoLocations :: ![SetupInfoLocation]
- configPvpBounds :: !PvpBounds
- configModifyCodePage :: !Bool
- configExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configRebuildGhcOptions :: !Bool
- configApplyGhcOptions :: !ApplyGhcOptions
- configAllowNewer :: !Bool
- configDefaultTemplate :: !(Maybe TemplateName)
- configAllowDifferentUser :: !Bool
- class (HasStackRoot env, HasPlatform env) => HasConfig env where
- askConfig :: (MonadReader env m, HasConfig env) => m Config
- askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text
- explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool
- getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride
- data BuildConfig = BuildConfig {
- bcConfig :: !Config
- bcResolver :: !Resolver
- bcWantedCompiler :: !CompilerVersion
- bcPackageEntries :: ![PackageEntry]
- bcExtraDeps :: !(Map PackageName Version)
- bcExtraPackageDBs :: ![Path Abs Dir]
- bcStackYaml :: !(Path Abs File)
- bcFlags :: !(Map PackageName (Map FlagName Bool))
- bcImplicitGlobal :: !Bool
- bcGHCVariant :: !GHCVariant
- bcPackageCaches :: !(Map PackageIdentifier (PackageIndex, PackageCache))
- bcRoot :: BuildConfig -> Path Abs Dir
- bcWorkDir :: (MonadReader env m, HasConfig env) => BuildConfig -> m (Path Abs Dir)
- class HasConfig env => HasBuildConfig env where
- getBuildConfig :: env -> BuildConfig
- data GHCVariant
- ghcVariantName :: GHCVariant -> String
- ghcVariantSuffix :: GHCVariant -> String
- parseGHCVariant :: MonadThrow m => String -> m GHCVariant
- class HasGHCVariant env where
- getGHCVariant :: env -> GHCVariant
- snapshotsDir :: (MonadReader env m, HasConfig env, HasGHCVariant env, MonadThrow m) => m (Path Abs Dir)
- data EnvConfig = EnvConfig {}
- class (HasBuildConfig r, HasGHCVariant r) => HasEnvConfig r where
- getEnvConfig :: r -> EnvConfig
- getWhichCompiler :: (MonadReader env m, HasEnvConfig env) => m WhichCompiler
- data ApplyGhcOptions
- data ConfigException
- = ParseConfigFileException (Path Abs File) ParseException
- | ParseResolverException Text
- | NoProjectConfigFound (Path Abs Dir) (Maybe Text)
- | UnexpectedArchiveContents [Path Abs Dir] [Path Abs File]
- | UnableToExtractArchive Text (Path Abs File)
- | BadStackVersionException VersionRange
- | NoMatchingSnapshot [SnapName]
- | ResolverMismatch Resolver String
- | ResolverPartial Resolver String
- | NoSuchDirectory FilePath
- | ParseGHCVariantException String
- | BadStackRootEnvVar (Path Abs Dir)
- | Won'tCreateStackRootInDirectoryOwnedByDifferentUser (Path Abs Dir) (Path Abs Dir)
- | UserDoesn'tOwnDirectory (Path Abs Dir)
- data ConfigMonoid = ConfigMonoid {
- configMonoidWorkDir :: !(Maybe FilePath)
- configMonoidDockerOpts :: !DockerOptsMonoid
- configMonoidNixOpts :: !NixOptsMonoid
- configMonoidConnectionCount :: !(Maybe Int)
- configMonoidHideTHLoading :: !(Maybe Bool)
- configMonoidLatestSnapshotUrl :: !(Maybe Text)
- configMonoidPackageIndices :: !(Maybe [PackageIndex])
- configMonoidSystemGHC :: !(Maybe Bool)
- configMonoidInstallGHC :: !(Maybe Bool)
- configMonoidSkipGHCCheck :: !(Maybe Bool)
- configMonoidSkipMsys :: !(Maybe Bool)
- configMonoidCompilerCheck :: !(Maybe VersionCheck)
- configMonoidRequireStackVersion :: !VersionRange
- configMonoidOS :: !(Maybe String)
- configMonoidArch :: !(Maybe String)
- configMonoidGHCVariant :: !(Maybe GHCVariant)
- configMonoidJobs :: !(Maybe Int)
- configMonoidExtraIncludeDirs :: !(Set Text)
- configMonoidExtraLibDirs :: !(Set Text)
- configMonoidConcurrentTests :: !(Maybe Bool)
- configMonoidLocalBinPath :: !(Maybe FilePath)
- configMonoidImageOpts :: !ImageOptsMonoid
- configMonoidTemplateParameters :: !(Map Text Text)
- configMonoidScmInit :: !(Maybe SCM)
- configMonoidGhcOptions :: !(Map (Maybe PackageName) [Text])
- configMonoidExtraPath :: ![Path Abs Dir]
- configMonoidSetupInfoLocations :: ![SetupInfoLocation]
- configMonoidPvpBounds :: !(Maybe PvpBounds)
- configMonoidModifyCodePage :: !(Maybe Bool)
- configMonoidExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configMonoidRebuildGhcOptions :: !(Maybe Bool)
- configMonoidApplyGhcOptions :: !(Maybe ApplyGhcOptions)
- configMonoidAllowNewer :: !(Maybe Bool)
- configMonoidDefaultTemplate :: !(Maybe TemplateName)
- configMonoidAllowDifferentUser :: !(Maybe Bool)
- data EnvSettings = EnvSettings {
- esIncludeLocals :: !Bool
- esIncludeGhcPackagePath :: !Bool
- esStackExe :: !Bool
- esLocaleUtf8 :: !Bool
- minimalEnvSettings :: EnvSettings
- data GlobalOpts = GlobalOpts {}
- data GlobalOptsMonoid = GlobalOptsMonoid {
- globalMonoidReExecVersion :: !(Maybe String)
- globalMonoidDockerEntrypoint :: !(Maybe DockerEntrypoint)
- globalMonoidLogLevel :: !(Maybe LogLevel)
- globalMonoidConfigMonoid :: !ConfigMonoid
- globalMonoidResolver :: !(Maybe AbstractResolver)
- globalMonoidCompiler :: !(Maybe CompilerVersion)
- globalMonoidTerminal :: !(Maybe Bool)
- globalMonoidStackYaml :: !(Maybe FilePath)
- defaultLogLevel :: LogLevel
- data LoadConfig m = LoadConfig {
- lcConfig :: !Config
- lcLoadBuildConfig :: !(Maybe CompilerVersion -> m BuildConfig)
- lcProjectRoot :: !(Maybe (Path Abs Dir))
- data PackageEntry = PackageEntry {
- peExtraDepMaybe :: !(Maybe Bool)
- peValidWanted :: !(Maybe Bool)
- peLocation :: !PackageLocation
- peSubdirs :: ![FilePath]
- peExtraDep :: PackageEntry -> Bool
- data PackageLocation
- data RemotePackageType
- data PackageIndex = PackageIndex {}
- newtype IndexName = IndexName {}
- configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir)
- configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File)
- indexNameText :: IndexName -> Text
- data IndexLocation
- data Project = Project {
- projectUserMsg :: !(Maybe String)
- projectPackages :: ![PackageEntry]
- projectExtraDeps :: !(Map PackageName Version)
- projectFlags :: !(Map PackageName (Map FlagName Bool))
- projectResolver :: !Resolver
- projectCompiler :: !(Maybe CompilerVersion)
- projectExtraPackageDBs :: ![FilePath]
- data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid
- data PvpBounds
- parsePvpBounds :: Text -> Either String PvpBounds
- data Resolver
- parseResolverText :: MonadThrow m => Text -> m Resolver
- resolverName :: Resolver -> Text
- data AbstractResolver
- data SCM = Git
- bindirSuffix :: Path Rel Dir
- configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File)
- configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapName -> m (Path Abs File)
- configProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir)
- docDirSuffix :: Path Rel Dir
- flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir])
- hpcReportDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- packageDatabaseExtra :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m [Path Abs Dir]
- packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)
- platformGhcRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir)
- useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir)
- getWorkDir :: (MonadReader env m, HasConfig env) => m (Path Rel Dir)
- data EvalOpts = EvalOpts {
- evalArg :: !String
- evalExtra :: !ExecOptsExtra
- data ExecOpts = ExecOpts {
- eoCmd :: !SpecialExecCmd
- eoArgs :: ![String]
- eoExtra :: !ExecOptsExtra
- data SpecialExecCmd
- data ExecOptsExtra
- = ExecOptsPlain
- | ExecOptsEmbellished {
- eoEnvSettings :: !EnvSettings
- eoPackages :: ![String]
- data DownloadInfo = DownloadInfo {}
- data VersionedDownloadInfo = VersionedDownloadInfo {}
- data SetupInfo = SetupInfo {}
- data SetupInfoLocation
- data DockerEntrypoint = DockerEntrypoint {
- deUser :: !(Maybe DockerUser)
- data DockerUser = DockerUser {}
Main configuration types and classes
HasPlatform & HasStackRoot
class HasPlatform env where Source
Class for environment values which have a Platform
Nothing
getPlatform :: env -> Platform Source
getPlatformVariant :: env -> PlatformVariant Source
class HasStackRoot env where Source
Class for environment values which have access to the stack root
Nothing
getStackRoot :: env -> Path Abs Dir Source
data PlatformVariant Source
A variant of the platform, used to differentiate Docker builds from host
Config & HasConfig
The top-level Stackage configuration.
Config | |
|
class (HasStackRoot env, HasPlatform env) => HasConfig env where Source
Class for environment values that can provide a Config
.
Nothing
askConfig :: (MonadReader env m, HasConfig env) => m Config Source
Helper function to ask the environment and apply getConfig
askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text Source
Get the URL to request the information on the latest snapshots
explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool Source
Provide an explicit list of package dependencies when running a custom Setup.hs
getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride Source
Get the minimal environment override, useful for just calling external processes like git or ghc
BuildConfig & HasBuildConfig
data BuildConfig Source
A superset of Config
adding information on how to build code. The reason
for this breakdown is because we will need some of the information from
Config
in order to determine the values here.
BuildConfig | |
|
bcWorkDir :: (MonadReader env m, HasConfig env) => BuildConfig -> m (Path Abs Dir) Source
"bcRoot
/.stack-work"
class HasConfig env => HasBuildConfig env where Source
Class for environment values that can provide a BuildConfig
.
getBuildConfig :: env -> BuildConfig Source
HasBuildConfig EnvConfig Source | |
HasBuildConfig BuildConfig Source | |
HasBuildConfig config => HasBuildConfig (Env config) Source |
GHCVariant & HasGHCVariant
data GHCVariant Source
Specialized bariant of GHC (e.g. libgmp4 or integer-simple)
GHCStandard | Standard bindist |
GHCGMP4 | Bindist that supports libgmp4 (centos66) |
GHCArch | Bindist built on Arch Linux (bleeding-edge) |
GHCIntegerSimple | Bindist that uses integer-simple |
GHCCustom String | Other bindists |
ghcVariantName :: GHCVariant -> String Source
Render a GHC variant to a String.
ghcVariantSuffix :: GHCVariant -> String Source
Render a GHC variant to a String suffix.
parseGHCVariant :: MonadThrow m => String -> m GHCVariant Source
Parse GHC variant from a String.
class HasGHCVariant env where Source
Class for environment values which have a GHCVariant
Nothing
getGHCVariant :: env -> GHCVariant Source
snapshotsDir :: (MonadReader env m, HasConfig env, HasGHCVariant env, MonadThrow m) => m (Path Abs Dir) Source
Directory containing snapshots
EnvConfig & HasEnvConfig
Configuration after the environment has been setup.
class (HasBuildConfig r, HasGHCVariant r) => HasEnvConfig r where Source
getEnvConfig :: r -> EnvConfig Source
HasEnvConfig EnvConfig Source | |
HasEnvConfig config => HasEnvConfig (Env config) Source |
getWhichCompiler :: (MonadReader env m, HasEnvConfig env) => m WhichCompiler Source
Details
ApplyGhcOptions
data ApplyGhcOptions Source
Which packages to ghc-options on the command line apply to?
AGOTargets | all local targets |
AGOLocals | all local packages, even non-targets |
AGOEverything | every package |
ConfigException
data ConfigException Source
ConfigMonoid
data ConfigMonoid Source
EnvSettings
data EnvSettings Source
Controls which version of the environment is used
EnvSettings | |
|
GlobalOpts & GlobalOptsMonoid
data GlobalOpts Source
Parsed global command-line options.
GlobalOpts | |
|
data GlobalOptsMonoid Source
Parsed global command-line options monoid.
GlobalOptsMonoid | |
|
defaultLogLevel :: LogLevel Source
Default logging level should be something useful but not crazy.
LoadConfig
data LoadConfig m Source
Value returned by loadConfig
.
LoadConfig | |
|
PackageEntry & PackageLocation
data PackageEntry Source
PackageEntry | |
|
peExtraDep :: PackageEntry -> Bool Source
Once peValidWanted is removed, this should just become the field name in PackageEntry.
data PackageLocation Source
PLFilePath FilePath | Note that we use |
PLRemote Text RemotePackageType | URL and further details |
PackageIndex, IndexName & IndexLocation
data PackageIndex Source
Information on a single package index
PackageIndex | |
|
Unique name for a package index
configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) Source
Location of the 00-index.tar file
configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) Source
Location of the 00-index.cache file
configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) Source
Location of the 00-index.tar.gz file
configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir) Source
Root for a specific package index
configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File) Source
Location of a package tarball
indexNameText :: IndexName -> Text Source
data IndexLocation Source
Location of the package index. This ensures that at least one of Git or HTTP is available.
Project & ProjectAndConfigMonoid
A project is a collection of packages. We can have multiple stack.yaml files, but only one of them may contain project information.
Project | |
|
PvpBounds
How PVP bounds should be added to .cabal files
Resolver & AbstractResolver
How we resolve which dependencies to install given a set of packages.
ResolverSnapshot SnapName | Use an official snapshot from the Stackage project, either an LTS Haskell or Stackage Nightly |
ResolverCompiler !CompilerVersion | Require a specific compiler version, but otherwise provide no build plan. Intended for use cases where end user wishes to specify all upstream dependencies manually, such as using a dependency solver. |
ResolverCustom !Text !Text | A custom resolver based on the given name and URL. This file is assumed to be completely immutable. |
parseResolverText :: MonadThrow m => Text -> m Resolver Source
Try to parse a Resolver
from a Text
. Won't work for complex resolvers (like custom).
resolverName :: Resolver -> Text Source
Convert a Resolver into its Text
representation, as will be used by
directory names
data AbstractResolver Source
Either an actual resolver value, or an abstract description of one (e.g., latest nightly).
SCM
Paths
bindirSuffix :: Path Rel Dir Source
Suffix applied to an installation root to get the bin dir
configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File) Source
File containing the installed cache, see Stack.PackageDump
configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapName -> m (Path Abs File) Source
Where to store mini build plan caches
configProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir) Source
Per-project work dir
docDirSuffix :: Path Rel Dir Source
Suffix applied to an installation root to get the doc dir
flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source
Directory for holding flag cache information
extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir]) Source
Get the extra bin directories (for the PATH). Puts more local first
Bool indicates whether or not to include the locals
hpcReportDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source
Where HPC reports and tix files get stored.
installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source
Installation root for dependencies
installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source
Installation root for locals
packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source
Package database for installing dependencies into
packageDatabaseExtra :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m [Path Abs Dir] Source
Extra package databases
packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source
Package database for installing local packages into
platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir) Source
Relative directory for the platform identifier
platformGhcRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) Source
Relative directory for the platform identifier
useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir) Source
This is an attempt to shorten stack paths on Windows to decrease our chances of hitting 260 symbol path limit. The idea is to calculate SHA1 hash of the path used on other architectures, encode with base 16 and take first 8 symbols of it.
getWorkDir :: (MonadReader env m, HasConfig env) => m (Path Rel Dir) Source
".stack-work"
Command-specific types
Eval
Exec
ExecOpts | |
|
data SpecialExecCmd Source
data ExecOptsExtra Source
Setup
data SetupInfoLocation Source
Remote or inline SetupInfo
Docker entrypoint
data DockerEntrypoint Source
Data passed into Docker container for the Docker entrypoint's use
DockerEntrypoint | |
|