stack-1.1.2: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Types.Config

Contents

Description

The Config type.

Synopsis

Main configuration types and classes

HasPlatform & HasStackRoot

class HasStackRoot env where #

Class for environment values which have access to the stack root

Methods

getStackRoot :: env -> Path Abs Dir #

getStackRoot :: HasConfig env => env -> Path Abs Dir #

Instances

HasStackRoot EnvConfig # 

Methods

getStackRoot :: EnvConfig -> Path Abs Dir #

HasStackRoot BuildConfig # 

Methods

getStackRoot :: BuildConfig -> Path Abs Dir #

HasStackRoot Config # 

Methods

getStackRoot :: Config -> Path Abs Dir #

HasStackRoot MiniConfig # 

Methods

getStackRoot :: MiniConfig -> Path Abs Dir #

HasStackRoot config => HasStackRoot (Env config) # 

Methods

getStackRoot :: Env config -> Path Abs Dir #

data PlatformVariant #

A variant of the platform, used to differentiate Docker builds from host

Config & HasConfig

data Config #

The top-level Stackage configuration.

Constructors

Config 

Fields

class (HasStackRoot env, HasPlatform env) => HasConfig env where #

Class for environment values that can provide a Config.

Methods

getConfig :: env -> Config #

getConfig :: HasBuildConfig env => env -> Config #

askConfig :: (MonadReader env m, HasConfig env) => m Config #

Helper function to ask the environment and apply getConfig

askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text #

Get the URL to request the information on the latest snapshots

explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool #

Provide an explicit list of package dependencies when running a custom Setup.hs

getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride #

Get the minimal environment override, useful for just calling external processes like git or ghc

BuildConfig & HasBuildConfig

data BuildConfig #

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.

Constructors

BuildConfig 

Fields

bcRoot :: BuildConfig -> Path Abs Dir #

Directory containing the project's stack.yaml file

bcWorkDir :: (MonadReader env m, HasConfig env) => BuildConfig -> m (Path Abs Dir) #

"bcRoot/.stack-work"

class HasConfig env => HasBuildConfig env where #

Class for environment values that can provide a BuildConfig.

Minimal complete definition

getBuildConfig

Methods

getBuildConfig :: env -> BuildConfig #

GHCVariant & HasGHCVariant

data GHCVariant #

Specialized bariant of GHC (e.g. libgmp4 or integer-simple)

Constructors

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 #

Render a GHC variant to a String.

ghcVariantSuffix :: GHCVariant -> String #

Render a GHC variant to a String suffix.

parseGHCVariant :: MonadThrow m => String -> m GHCVariant #

Parse GHC variant from a String.

class HasGHCVariant env where #

Class for environment values which have a GHCVariant

snapshotsDir :: (MonadReader env m, HasConfig env, HasGHCVariant env, MonadThrow m) => m (Path Abs Dir) #

Directory containing snapshots

EnvConfig & HasEnvConfig

class (HasBuildConfig r, HasGHCVariant r) => HasEnvConfig r where #

Minimal complete definition

getEnvConfig

Methods

getEnvConfig :: r -> EnvConfig #

Instances

getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File) #

Get the path for the given compiler ignoring any local binaries.

https://github.com/commercialhaskell/stack/issues/1052

Details

ApplyGhcOptions

data ApplyGhcOptions #

Which packages to ghc-options on the command line apply to?

Constructors

AGOTargets

all local targets

AGOLocals

all local packages, even non-targets

AGOEverything

every package

Instances

Bounded ApplyGhcOptions # 
Enum ApplyGhcOptions # 
Eq ApplyGhcOptions # 
Ord ApplyGhcOptions # 
Read ApplyGhcOptions # 
Show ApplyGhcOptions # 
FromJSON ApplyGhcOptions # 

Methods

parseJSON :: Value -> Parser ApplyGhcOptions

ConfigException

WhichSolverCmd

ConfigMonoid

data ConfigMonoid #

Constructors

ConfigMonoid 

Fields

Instances

Show ConfigMonoid # 
Generic ConfigMonoid # 

Associated Types

type Rep ConfigMonoid :: * -> * #

Monoid ConfigMonoid # 
FromJSON (WithJSONWarnings ConfigMonoid) # 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings ConfigMonoid)

type Rep ConfigMonoid # 
type Rep ConfigMonoid = D1 (MetaData "ConfigMonoid" "Stack.Types.Config" "stack-1.1.2-49dhs7u8deFCRPHWDHyZQB" False) (C1 (MetaCons "ConfigMonoid" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidStackRoot") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First (Path Abs Dir)))) (S1 (MetaSel (Just Symbol "configMonoidWorkDir") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First FilePath)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidBuildOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 BuildOptsMonoid)) (S1 (MetaSel (Just Symbol "configMonoidDockerOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 DockerOptsMonoid)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidNixOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 NixOptsMonoid)) (S1 (MetaSel (Just Symbol "configMonoidConnectionCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Int)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidHideTHLoading") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidLatestSnapshotUrl") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Text))) (S1 (MetaSel (Just Symbol "configMonoidUrls") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 UrlsMonoid)))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidPackageIndices") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First [PackageIndex]))) (S1 (MetaSel (Just Symbol "configMonoidSystemGHC") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidInstallGHC") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidSkipGHCCheck") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidSkipMsys") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidCompilerCheck") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First VersionCheck))) (S1 (MetaSel (Just Symbol "configMonoidRequireStackVersion") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 IntersectingVersionRange))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidOS") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First String))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidArch") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First String))) (S1 (MetaSel (Just Symbol "configMonoidGHCVariant") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First GHCVariant)))))))) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidJobs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Int))) (S1 (MetaSel (Just Symbol "configMonoidExtraIncludeDirs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Set Text)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidExtraLibDirs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Set Text))) (S1 (MetaSel (Just Symbol "configMonoidConcurrentTests") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidLocalBinPath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First FilePath))) (S1 (MetaSel (Just Symbol "configMonoidImageOpts") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ImageOptsMonoid))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidTemplateParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map Text Text))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidScmInit") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First SCM))) (S1 (MetaSel (Just Symbol "configMonoidGhcOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 GhcOptions)))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidExtraPath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Path Abs Dir])) (S1 (MetaSel (Just Symbol "configMonoidSetupInfoLocations") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [SetupInfoLocation]))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidPvpBounds") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First PvpBounds))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidModifyCodePage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidExplicitSetupDeps") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map (Maybe PackageName) Bool)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidRebuildGhcOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidApplyGhcOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First ApplyGhcOptions)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidAllowNewer") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidDefaultTemplate") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First TemplateName))) (S1 (MetaSel (Just Symbol "configMonoidAllowDifferentUser") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))))))))))

EnvSettings

data EnvSettings #

Controls which version of the environment is used

Constructors

EnvSettings 

Fields

GlobalOpts & GlobalOptsMonoid

data GlobalOpts #

Parsed global command-line options.

Constructors

GlobalOpts 

Fields

data GlobalOptsMonoid #

Parsed global command-line options monoid.

Constructors

GlobalOptsMonoid 

Fields

Instances

Show GlobalOptsMonoid # 
Generic GlobalOptsMonoid # 
Monoid GlobalOptsMonoid # 
type Rep GlobalOptsMonoid # 
type Rep GlobalOptsMonoid = D1 (MetaData "GlobalOptsMonoid" "Stack.Types.Config" "stack-1.1.2-49dhs7u8deFCRPHWDHyZQB" False) (C1 (MetaCons "GlobalOptsMonoid" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidReExecVersion") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First String))) (S1 (MetaSel (Just Symbol "globalMonoidDockerEntrypoint") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First DockerEntrypoint)))) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidLogLevel") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First LogLevel))) (S1 (MetaSel (Just Symbol "globalMonoidConfigMonoid") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ConfigMonoid)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidResolver") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First AbstractResolver))) (S1 (MetaSel (Just Symbol "globalMonoidCompiler") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First CompilerVersion)))) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidTerminal") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "globalMonoidStackYaml") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First FilePath)))))))

defaultLogLevel :: LogLevel #

Default logging level should be something useful but not crazy.

LoadConfig

data LoadConfig m #

Value returned by loadConfig.

Constructors

LoadConfig 

Fields

PackageEntry & PackageLocation

type TreatLikeExtraDep = Bool #

Should a package be treated just like an extra-dep?

True means, it will only be built as a dependency for others, and its test suite/benchmarks will not be run.

Useful modifying an upstream package, see: https://github.com/commercialhaskell/stack/issues/219 https://github.com/commercialhaskell/stack/issues/386

data PackageLocation #

Constructors

PLFilePath FilePath

Note that we use FilePath and not Paths. The goal is: first parse the value raw, and then use canonicalizePath and parseAbsDir.

PLRemote Text RemotePackageType

URL and further details

PackageIndex, IndexName & IndexLocation

data PackageIndex #

Information on a single package index

Constructors

PackageIndex 

Fields

newtype IndexName #

Unique name for a package index

Constructors

IndexName 

configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 00-index.tar file

configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 00-index.cache file

configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 00-index.tar.gz file

configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir) #

Root for a specific package index

configPackageIndexRepo :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Maybe (Path Abs Dir)) #

Git repo directory for a specific package index, returns Nothing if not a Git repo

configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File) #

Location of a package tarball

Project & ProjectAndConfigMonoid

data Project #

A project is a collection of packages. We can have multiple stack.yaml files, but only one of them may contain project information.

Constructors

Project 

Fields

Instances

Show Project # 
ToJSON Project # 

Methods

toJSON :: Project -> Value

toEncoding :: Project -> Encoding

PvpBounds

Resolver & AbstractResolver

type Resolver = ResolverThat's NotLoaded #

data ResolverThat's l where #

How we resolve which dependencies to install given a set of packages.

Instances

parseResolverText :: MonadThrow m => Text -> m Resolver #

Try to parse a Resolver from a Text. Won't work for complex resolvers (like custom).

resolverDirName :: LoadedResolver -> Text #

Convert a Resolver into its Text representation, as will be used by directory names

resolverName :: ResolverThat's l -> Text #

Convert a Resolver into its Text representation for human presentation.

data AbstractResolver #

Either an actual resolver value, or an abstract description of one (e.g., latest nightly).

SCM

data SCM #

A software control system.

Constructors

Git 

Instances

Show SCM # 

Methods

showsPrec :: Int -> SCM -> ShowS #

show :: SCM -> String #

showList :: [SCM] -> ShowS #

FromJSON SCM # 

Methods

parseJSON :: Value -> Parser SCM

ToJSON SCM # 

Methods

toJSON :: SCM -> Value

toEncoding :: SCM -> Encoding

CustomSnapshot

GhcOptions

PackageFlags

Paths

bindirSuffix :: Path Rel Dir #

Suffix applied to an installation root to get the bin dir

configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File) #

File containing the installed cache, see Stack.PackageDump

configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapName -> m (Path Abs File) #

Where to store mini build plan caches

getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir) #

Per-project work dir

docDirSuffix :: Path Rel Dir #

Suffix applied to an installation root to get the doc dir

flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Directory for holding flag cache information

extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir]) #

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) #

Where HPC reports and tix files get stored.

installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Installation root for dependencies

installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Installation root for locals

packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Package database for installing dependencies into

packageDatabaseExtra :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m [Path Abs Dir] #

Extra package databases

packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Package database for installing local packages into

platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir) #

Relative directory for the platform identifier

platformGhcRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) #

Relative directory for the platform identifier

useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir) #

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) #

".stack-work"

Command-specific types

Eval

data EvalOpts #

Constructors

EvalOpts 

Instances

Exec

data ExecOpts #

Constructors

ExecOpts 

Instances

Setup

data DownloadInfo #

Information for a file to download.

data SetupInfo #

Instances

Show SetupInfo # 
Monoid SetupInfo #

For siGHCs and siGHCJSs fields maps are deeply merged. For all fields the values from the last SetupInfo win.

FromJSON (WithJSONWarnings SetupInfo) # 

Methods

parseJSON :: Value -> Parser (WithJSONWarnings SetupInfo)

Docker entrypoint

data DockerEntrypoint #

Data passed into Docker container for the Docker entrypoint's use

Constructors

DockerEntrypoint 

Fields

data DockerUser #

Docker host user info

Constructors

DockerUser 

Fields