stack-0.1.5.0: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Types.Config

Description

The Config type.

Synopsis

Documentation

data Config Source

The top-level Stackage configuration.

Constructors

Config 

Fields

data PackageIndex Source

Information on a single package index

Constructors

PackageIndex 

Fields

data EnvSettings Source

Controls which version of the environment is used

Constructors

EnvSettings 

Fields

data ExecOpts Source

Constructors

ExecOpts 

Fields

data GlobalOpts Source

Parsed global command-line options.

Constructors

GlobalOpts 

Fields

data AbstractResolver Source

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

defaultLogLevel :: LogLevel Source

Default logging level should be something useful but not crazy.

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 :: BuildConfig -> Path Abs Dir Source

Directory containing the project's stack.yaml file

data LoadConfig m Source

Value returned by loadConfig.

Constructors

LoadConfig 

Fields

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.

PLHttpTarball Text 
PLGit Text Text

URL and commit

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

resolverName :: Resolver -> Text Source

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

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

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

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

class HasPlatform env where Source

Class for environment values which have a Platform

Minimal complete definition

Nothing

Methods

getPlatform :: env -> Platform Source

class HasGHCVariant env where Source

Class for environment values which have a GHCVariant

Minimal complete definition

Nothing

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

class HasConfig env => HasBuildConfig env where Source

Class for environment values that can provide a BuildConfig.

data ConfigMonoid Source

Constructors

ConfigMonoid 

Fields

parseConfigMonoidJSON :: Object -> WarningParser ConfigMonoid Source

Parse a partial configuration. Used both to parse both a standalone config file and a project file, so that a sub-parser is not required, which would interfere with warnings for missing fields.

newtype VersionRangeJSON Source

Newtype for non-orphan FromJSON instance.

Instances

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

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

Root for a specific package index

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

Location of the 00-index.cache file

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

Location of the 00-index.tar file

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

Location of the 00-index.tar.gz file

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

Location of a package tarball

configProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir) Source

Per-project work dir

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

File containing the installed cache, see Stack.PackageDump

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

Relative directory for the platform identifier

platformVariantRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) Source

Relative directory for the platform identifier

configShakeFilesDir :: (MonadReader env m, HasBuildConfig env) => m (Path Abs Dir) Source

Path to .shake files.

configLocalUnpackDir :: (MonadReader env m, HasBuildConfig env) => m (Path Abs Dir) Source

Where to unpack packages for local build

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

Directory containing snapshots

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

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

Package database for installing local packages into

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

Directory for holding flag cache information

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

Where to store mini build plan caches

bindirSuffix :: Path Rel Dir Source

Suffix applied to an installation root to get the bin dir

docDirSuffix :: Path Rel Dir Source

Suffix applied to an installation root to get the doc dir

hpcDirSuffix :: Path Rel Dir Source

Suffix applied to an installation root to get the hpc dir

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

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

data ProjectAndConfigMonoid Source

Instances

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

Methods

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

packageEntryCurrDir :: PackageEntry Source

A PackageEntry for the current directory, used as a default

data SCM Source

A software control system.

Constructors

Git 

Instances

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.

parseDownloadInfoFromObject :: Object -> WarningParser DownloadInfo Source

Parse JSON in existing object for DownloadInfo