stack-1.0.0: 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 Source

Class for environment values which have access to the stack root

Minimal complete definition

Nothing

Methods

getStackRoot :: env -> Path Abs Dir Source

data PlatformVariant Source

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

Config & HasConfig

data Config Source

The top-level Stackage configuration.

Constructors

Config 

Fields

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

Class for environment values that can provide a Config.

Minimal complete definition

Nothing

Methods

getConfig :: env -> Config Source

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.

Constructors

BuildConfig 

Fields

bcRoot :: BuildConfig -> Path Abs Dir Source

Directory containing the project's stack.yaml file

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.

GHCVariant & HasGHCVariant

data GHCVariant Source

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

Minimal complete definition

Nothing

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

Directory containing snapshots

EnvConfig & HasEnvConfig

Details

ApplyGhcOptions

data ApplyGhcOptions Source

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 Source 
Enum ApplyGhcOptions Source 
Eq ApplyGhcOptions Source 
Ord ApplyGhcOptions Source 
Read ApplyGhcOptions Source 
Show ApplyGhcOptions Source 
FromJSON ApplyGhcOptions Source 

ConfigException

ConfigMonoid

data ConfigMonoid Source

Constructors

ConfigMonoid 

Fields

EnvSettings

data EnvSettings Source

Controls which version of the environment is used

Constructors

EnvSettings 

Fields

GlobalOpts & GlobalOptsMonoid

data GlobalOpts Source

Parsed global command-line options.

Constructors

GlobalOpts 

Fields

data GlobalOptsMonoid Source

Parsed global command-line options monoid.

Constructors

GlobalOptsMonoid 

Fields

defaultLogLevel :: LogLevel Source

Default logging level should be something useful but not crazy.

LoadConfig

data LoadConfig m Source

Value returned by loadConfig.

Constructors

LoadConfig 

Fields

PackageEntry & PackageLocation

data PackageEntry Source

Constructors

PackageEntry 

Fields

peExtraDep :: PackageEntry -> Bool Source

Once peValidWanted is removed, this should just become the field name in PackageEntry.

data PackageLocation Source

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 Source

Information on a single package index

Constructors

PackageIndex 

Fields

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

Project & ProjectAndConfigMonoid

data Project Source

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

data ProjectAndConfigMonoid Source

Instances

(~) * warnings [JSONWarning] => FromJSON (ProjectAndConfigMonoid, warnings) Source 

Methods

parseJSON :: Value -> Parser (ProjectAndConfigMonoid, warnings)

PvpBounds

Resolver & AbstractResolver

data Resolver Source

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

Constructors

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

data SCM Source

A software control system.

Constructors

Git 

Instances

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

Setup

data SetupInfo Source

Instances

Show SetupInfo Source 
Monoid SetupInfo Source

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

Docker entrypoint

data DockerEntrypoint Source

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

Constructors

DockerEntrypoint 

Fields