Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stack.Types.Config
Contents
Description
The Config type.
- class HasPlatform env where
- data PlatformVariant
- data Config = Config {
- configStackRoot :: !(Path Abs Dir)
- configWorkDir :: !(Path Rel Dir)
- configUserConfigPath :: !(Path Abs File)
- configBuild :: !BuildOpts
- 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)
- configGHCBuild :: !(Maybe CompilerBuild)
- configUrls :: !Urls
- configPackageIndices :: ![PackageIndex]
- configSystemGHC :: !Bool
- configInstallGHC :: !Bool
- configSkipGHCCheck :: !Bool
- configSkipMsys :: !Bool
- configCompilerCheck :: !VersionCheck
- configLocalBin :: !(Path Abs Dir)
- configRequireStackVersion :: !VersionRange
- configJobs :: !Int
- configOverrideGccPath :: !(Maybe (Path Abs File))
- configExtraIncludeDirs :: !(Set (Path Abs Dir))
- configExtraLibDirs :: !(Set (Path Abs Dir))
- configConcurrentTests :: !Bool
- configImage :: !ImageOpts
- configTemplateParams :: !(Map Text Text)
- configScmInit :: !(Maybe SCM)
- configGhcOptions :: !GhcOptions
- configSetupInfoLocations :: ![SetupInfoLocation]
- configPvpBounds :: !PvpBounds
- configModifyCodePage :: !Bool
- configExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configRebuildGhcOptions :: !Bool
- configApplyGhcOptions :: !ApplyGhcOptions
- configAllowNewer :: !Bool
- configDefaultTemplate :: !(Maybe TemplateName)
- configAllowDifferentUser :: !Bool
- configPackageCaches :: !(IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize))))
- configDumpLogs :: !DumpLogs
- configMaybeProject :: !(Maybe (Project, Path Abs File))
- configAllowLocals :: !Bool
- class HasPlatform env => HasConfig env where
- 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 :: !LoadedResolver
- bcWantedMiniBuildPlan :: !MiniBuildPlan
- bcGHCVariant :: !GHCVariant
- bcPackageEntries :: ![PackageEntry]
- bcExtraDeps :: !(Map PackageName Version)
- bcExtraPackageDBs :: ![Path Abs Dir]
- bcStackYaml :: !(Path Abs File)
- bcFlags :: !PackageFlags
- bcImplicitGlobal :: !Bool
- stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File)
- projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir)
- class HasConfig env => HasBuildConfig env where
- data GHCVariant
- ghcVariantName :: GHCVariant -> String
- ghcVariantSuffix :: GHCVariant -> String
- parseGHCVariant :: MonadThrow m => String -> m GHCVariant
- class HasGHCVariant env where
- snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir)
- type StackMiniM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m)
- data EnvConfig = EnvConfig {}
- class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env where
- getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File)
- data ApplyGhcOptions
- data ConfigException
- = ParseConfigFileException (Path Abs File) ParseException
- | ParseCustomSnapshotException Text ParseException
- | ParseResolverException Text
- | NoProjectConfigFound (Path Abs Dir) (Maybe Text)
- | UnexpectedArchiveContents [Path Abs Dir] [Path Abs File]
- | UnableToExtractArchive Text (Path Abs File)
- | BadStackVersionException VersionRange
- | NoMatchingSnapshot WhichSolverCmd (NonEmpty SnapName)
- | ResolverMismatch WhichSolverCmd (ResolverThat's l) String
- | ResolverPartial WhichSolverCmd Resolver String
- | NoSuchDirectory FilePath
- | ParseGHCVariantException String
- | BadStackRoot (Path Abs Dir)
- | Won'tCreateStackRootInDirectoryOwnedByDifferentUser (Path Abs Dir) (Path Abs Dir)
- | UserDoesn'tOwnDirectory (Path Abs Dir)
- | FailedToCloneRepo String
- | ManualGHCVariantSettingsAreIncompatibleWithSystemGHC
- | NixRequiresSystemGhc
- | NoResolverWhenUsingNoLocalConfig
- | InvalidResolverForNoLocalConfig String
- data WhichSolverCmd
- data ConfigMonoid = ConfigMonoid {
- configMonoidStackRoot :: !(First (Path Abs Dir))
- configMonoidWorkDir :: !(First (Path Rel Dir))
- configMonoidBuildOpts :: !BuildOptsMonoid
- configMonoidDockerOpts :: !DockerOptsMonoid
- configMonoidNixOpts :: !NixOptsMonoid
- configMonoidConnectionCount :: !(First Int)
- configMonoidHideTHLoading :: !(First Bool)
- configMonoidLatestSnapshotUrl :: !(First Text)
- configMonoidUrls :: !UrlsMonoid
- configMonoidPackageIndices :: !(First [PackageIndex])
- configMonoidSystemGHC :: !(First Bool)
- configMonoidInstallGHC :: !(First Bool)
- configMonoidSkipGHCCheck :: !(First Bool)
- configMonoidSkipMsys :: !(First Bool)
- configMonoidCompilerCheck :: !(First VersionCheck)
- configMonoidRequireStackVersion :: !IntersectingVersionRange
- configMonoidArch :: !(First String)
- configMonoidGHCVariant :: !(First GHCVariant)
- configMonoidGHCBuild :: !(First CompilerBuild)
- configMonoidJobs :: !(First Int)
- configMonoidExtraIncludeDirs :: !(Set (Path Abs Dir))
- configMonoidExtraLibDirs :: !(Set (Path Abs Dir))
- configMonoidOverrideGccPath :: !(First (Path Abs File))
- configMonoidConcurrentTests :: !(First Bool)
- configMonoidLocalBinPath :: !(First FilePath)
- configMonoidImageOpts :: !ImageOptsMonoid
- configMonoidTemplateParameters :: !(Map Text Text)
- configMonoidScmInit :: !(First SCM)
- configMonoidGhcOptions :: !GhcOptions
- configMonoidExtraPath :: ![Path Abs Dir]
- configMonoidSetupInfoLocations :: ![SetupInfoLocation]
- configMonoidLocalProgramsBase :: !(First (Path Abs Dir))
- configMonoidPvpBounds :: !(First PvpBounds)
- configMonoidModifyCodePage :: !(First Bool)
- configMonoidExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configMonoidRebuildGhcOptions :: !(First Bool)
- configMonoidApplyGhcOptions :: !(First ApplyGhcOptions)
- configMonoidAllowNewer :: !(First Bool)
- configMonoidDefaultTemplate :: !(First TemplateName)
- configMonoidAllowDifferentUser :: !(First Bool)
- configMonoidDumpLogs :: !(First DumpLogs)
- configMonoidInstallGHCName :: Text
- configMonoidSystemGHCName :: Text
- data DumpLogs
- data EnvSettings = EnvSettings {
- esIncludeLocals :: !Bool
- esIncludeGhcPackagePath :: !Bool
- esStackExe :: !Bool
- esLocaleUtf8 :: !Bool
- minimalEnvSettings :: EnvSettings
- data GlobalOpts = GlobalOpts {
- globalReExecVersion :: !(Maybe String)
- globalDockerEntrypoint :: !(Maybe DockerEntrypoint)
- globalLogLevel :: !LogLevel
- globalTimeInLog :: !Bool
- globalConfigMonoid :: !ConfigMonoid
- globalResolver :: !(Maybe AbstractResolver)
- globalCompiler :: !(Maybe CompilerVersion)
- globalTerminal :: !Bool
- globalColorWhen :: !ColorWhen
- globalStackYaml :: !(StackYamlLoc FilePath)
- data GlobalOptsMonoid = GlobalOptsMonoid {
- globalMonoidReExecVersion :: !(First String)
- globalMonoidDockerEntrypoint :: !(First DockerEntrypoint)
- globalMonoidLogLevel :: !(First LogLevel)
- globalMonoidTimeInLog :: !(First Bool)
- globalMonoidConfigMonoid :: !ConfigMonoid
- globalMonoidResolver :: !(First AbstractResolver)
- globalMonoidCompiler :: !(First CompilerVersion)
- globalMonoidTerminal :: !(First Bool)
- globalMonoidColorWhen :: !(First ColorWhen)
- globalMonoidStackYaml :: !(First FilePath)
- data StackYamlLoc filepath
- = SYLDefault
- | SYLOverride !filepath
- | SYLNoConfig
- defaultLogLevel :: LogLevel
- data LoadConfig m = LoadConfig {
- lcConfig :: !Config
- lcLoadBuildConfig :: !(Maybe CompilerVersion -> m BuildConfig)
- lcProjectRoot :: !(Maybe (Path Abs Dir))
- data PackageEntry = PackageEntry {
- peExtraDepMaybe :: !(Maybe TreatLikeExtraDep)
- peLocation :: !PackageLocation
- peSubdirs :: ![FilePath]
- type TreatLikeExtraDep = Bool
- data PackageLocation
- data RemotePackageType
- data PackageIndex = PackageIndex {}
- newtype IndexName = IndexName {}
- indexNameText :: IndexName -> Text
- data IndexLocation
- configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexOld :: (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)
- configPackageIndexCacheOld :: (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)
- configPackageIndexRepo :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Maybe (Path Abs Dir))
- configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File)
- data Project = Project {}
- data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid
- data PvpBounds
- parsePvpBounds :: Text -> Either String PvpBounds
- data ColorWhen
- readColorWhen :: ReadM ColorWhen
- data SCM = Git
- data CustomSnapshot = CustomSnapshot {
- csCompilerVersion :: !(Maybe CompilerVersion)
- csPackages :: !(Set PackageIdentifier)
- csDropPackages :: !(Set PackageName)
- csFlags :: !PackageFlags
- csGhcOptions :: !GhcOptions
- newtype GhcOptions = GhcOptions {
- unGhcOptions :: Map (Maybe PackageName) [Text]
- ghcOptionsFor :: PackageName -> GhcOptions -> [Text]
- newtype PackageFlags = PackageFlags {}
- 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)
- getProjectWorkDir :: (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)
- hoogleRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File)
- packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- packageDatabaseExtra :: (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, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir)
- platformGhcVerOnlyRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir)
- useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir)
- workDirL :: HasConfig env => Lens' env (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]
- eoRtsOptions :: ![String]
- data DownloadInfo = DownloadInfo {}
- data VersionedDownloadInfo = VersionedDownloadInfo {}
- data GHCDownloadInfo = GHCDownloadInfo {}
- data SetupInfo = SetupInfo {}
- data SetupInfoLocation
- newtype DockerEntrypoint = DockerEntrypoint {}
- data DockerUser = DockerUser {}
- wantedCompilerVersionL :: HasBuildConfig s => Lens' s CompilerVersion
- actualCompilerVersionL :: HasEnvConfig s => Lens' s CompilerVersion
- buildOptsL :: HasConfig s => Lens' s BuildOpts
- globalOptsL :: Lens' GlobalOpts ConfigMonoid
- buildOptsInstallExesL :: Lens' BuildOpts Bool
- buildOptsMonoidHaddockL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsMonoidTestsL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsMonoidInstallExesL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsHaddockL :: Lens' BuildOpts Bool
- globalOptsBuildOptsMonoidL :: Lens' GlobalOpts BuildOptsMonoid
- packageIndicesL :: HasConfig s => Lens' s [PackageIndex]
- packageCachesL :: HasConfig env => Lens' env (IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize))))
- stackRootL :: HasConfig s => Lens' s (Path Abs Dir)
- configUrlsL :: HasConfig env => Lens' env Urls
- cabalVersionL :: HasEnvConfig env => Lens' env Version
- whichCompilerL :: Getting r CompilerVersion WhichCompiler
- view :: MonadReader s m => Getting a s a -> m a
- to :: (s -> a) -> SimpleGetter s a
Main configuration types and classes
HasPlatform & HasStackRoot
class HasPlatform env where #
Class for environment values which have a Platform
Methods
platformL :: Lens' env Platform #
platformL :: HasConfig env => Lens' env Platform #
platformVariantL :: Lens' env PlatformVariant #
platformVariantL :: HasConfig env => Lens' env PlatformVariant #
Instances
HasPlatform EnvConfig # | |
HasPlatform BuildConfig # | |
HasPlatform Config # | |
HasPlatform MiniConfig # | |
HasPlatform config => HasPlatform (Env config) # | |
HasPlatform (Platform, PlatformVariant) # | |
data PlatformVariant #
A variant of the platform, used to differentiate Docker builds from host
Constructors
PlatformVariantNone | |
PlatformVariant String |
Instances
Config & HasConfig
The top-level Stackage configuration.
Constructors
Config | |
Fields
|
class HasPlatform env => HasConfig env where #
Class for environment values that can provide a Config
.
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.
These are the components which know nothing about local configuration.
Constructors
BuildConfig | |
Fields
|
stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File) #
projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir) #
Directory containing the project's stack.yaml file
class HasConfig env => HasBuildConfig env where #
Methods
buildConfigL :: Lens' env BuildConfig #
buildConfigL :: HasEnvConfig env => Lens' env BuildConfig #
Instances
HasBuildConfig EnvConfig # | |
HasBuildConfig BuildConfig # | |
HasBuildConfig config => HasBuildConfig (Env config) # | |
GHCVariant & HasGHCVariant
data GHCVariant #
Specialized bariant of GHC (e.g. libgmp4 or integer-simple)
Constructors
GHCStandard | Standard bindist |
GHCIntegerSimple | Bindist that uses integer-simple |
GHCCustom String | Other bindists |
Instances
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
Methods
ghcVariantL :: Lens' env GHCVariant #
ghcVariantL :: HasBuildConfig env => Lens' env GHCVariant #
Instances
HasGHCVariant GHCVariant # | |
HasGHCVariant EnvConfig # | |
HasGHCVariant BuildConfig # | |
HasGHCVariant MiniConfig # | |
HasGHCVariant config => HasGHCVariant (Env config) # | |
snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir) #
Directory containing snapshots
Constraint synonym for use with StackMini
type StackMiniM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m) #
Constraint synonym for constraints satisfied by a MiniConfig
environment.
EnvConfig & HasEnvConfig
Configuration after the environment has been setup.
Constructors
EnvConfig | |
Fields
|
class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env where #
Minimal complete definition
Methods
envConfigL :: Lens' env EnvConfig #
Instances
HasEnvConfig EnvConfig # | |
HasEnvConfig config => HasEnvConfig (Env config) # | |
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.
Details
ApplyGhcOptions
data ApplyGhcOptions #
Which packages do ghc-options on the command line apply to?
Constructors
AGOTargets | all local targets |
AGOLocals | all local packages, even non-targets |
AGOEverything | every package |
ConfigException
data ConfigException #
Constructors
Instances
WhichSolverCmd
data WhichSolverCmd #
Constructors
IsInitCmd | |
IsSolverCmd | |
IsNewCmd |
ConfigMonoid
data ConfigMonoid #
Constructors
Instances
DumpLogs
Which build log files to dump
Constructors
DumpNoLogs | don't dump any logfiles |
DumpWarningLogs | dump logfiles containing warnings |
DumpAllLogs | dump all logfiles |
EnvSettings
data EnvSettings #
Controls which version of the environment is used
Constructors
EnvSettings | |
Fields
|
Instances
GlobalOpts & GlobalOptsMonoid
data GlobalOpts #
Parsed global command-line options.
Constructors
GlobalOpts | |
Fields
|
Instances
data GlobalOptsMonoid #
Parsed global command-line options monoid.
Constructors
GlobalOptsMonoid | |
Fields
|
Instances
data StackYamlLoc filepath #
Constructors
SYLDefault | |
SYLOverride !filepath | |
SYLNoConfig |
Instances
Functor StackYamlLoc # | |
Foldable StackYamlLoc # | |
Traversable StackYamlLoc # | |
Show filepath => Show (StackYamlLoc filepath) # | |
Default logging level should be something useful but not crazy.
LoadConfig
data LoadConfig m #
Value returned by loadConfig
.
Constructors
LoadConfig | |
Fields
|
PackageEntry & PackageLocation
data PackageEntry #
Constructors
PackageEntry | |
Fields
|
Instances
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 |
PLRemote Text RemotePackageType | URL and further details |
Instances
data RemotePackageType #
Instances
PackageIndex, IndexName & IndexLocation
data PackageIndex #
Information on a single package index
Constructors
PackageIndex | |
Fields
|
Instances
Unique name for a package index
Constructors
IndexName | |
Fields |
indexNameText :: IndexName -> Text #
data IndexLocation #
Location of the package index. This ensures that at least one of Git or HTTP is available.
Instances
configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #
Location of the 01-index.tar file
configPackageIndexOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #
Location of the 00-index.tar file. This file is just a copy of the 01-index.tar file, provided for tools which still look for the 00-index.tar file.
configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #
Location of the 01-index.cache file
configPackageIndexCacheOld :: (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 01-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
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
|
PvpBounds
How PVP bounds should be added to .cabal files
Constructors
PvpBoundsNone | |
PvpBoundsUpper | |
PvpBoundsLower | |
PvpBoundsBoth |
ColorWhen
Constructors
ColorNever | |
ColorAlways | |
ColorAuto |
SCM
A software control system.
Constructors
Git |
CustomSnapshot
data CustomSnapshot #
Constructors
CustomSnapshot | |
Fields
|
Instances
GhcOptions
newtype GhcOptions #
Constructors
GhcOptions | |
Fields
|
Instances
ghcOptionsFor :: PackageName -> GhcOptions -> [Text] #
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
hoogleRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #
Hoogle directory.
hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File) #
Get the hoogle database path.
packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #
Package database for installing dependencies into
packageDatabaseExtra :: (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, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir) #
Relative directory for the platform and GHC identifier
platformGhcVerOnlyRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) #
Relative directory for the platform and GHC identifier without GHC bindist build
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.
Command-specific types
Eval
Constructors
EvalOpts | |
Fields
|
Exec
Constructors
ExecOpts | |
Fields
|
data ExecOptsExtra #
Constructors
ExecOptsPlain | |
ExecOptsEmbellished | |
Fields
|
Instances
Setup
data DownloadInfo #
Build of the compiler distribution (e.g. standard, gmp4, tinfo6) | Information for a file to download.
Constructors
DownloadInfo | |
Fields
|
Instances
Constructors
SetupInfo | |
Fields |
data SetupInfoLocation #
Remote or inline SetupInfo
Constructors
SetupInfoFileOrURL String | |
SetupInfoInline SetupInfo |
Instances
Docker entrypoint
newtype DockerEntrypoint #
Data passed into Docker container for the Docker entrypoint's use
Constructors
DockerEntrypoint | |
Fields
|
Instances
Lens helpers
wantedCompilerVersionL :: HasBuildConfig s => Lens' s CompilerVersion #
The compiler specified by the MiniBuildPlan
. This may be
different from the actual compiler used!
actualCompilerVersionL :: HasEnvConfig s => Lens' s CompilerVersion #
The version of the compiler which will actually be used. May be
different than that specified in the MiniBuildPlan
and returned
by wantedCompilerVersionL
.
buildOptsL :: HasConfig s => Lens' s BuildOpts #
packageIndicesL :: HasConfig s => Lens' s [PackageIndex] #
packageCachesL :: HasConfig env => Lens' env (IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize)))) #
configUrlsL :: HasConfig env => Lens' env Urls #
cabalVersionL :: HasEnvConfig env => Lens' env Version #
Lens reexport
view :: MonadReader s m => Getting a s a -> m a #
view
is a synonym for (^.
), generalised for MonadReader
(we are able to use it instead of (^.
) since functions are instances of the MonadReader
class):
>>>
view _1 (1, 2)
1
When you're using Reader
for config and your config type has lenses generated for it, most of the time you'll be using view
instead of asks
:
doSomething :: (MonadReader
Config m) => m Int doSomething = do thingy <-view
setting1 -- same as “asks
(^.
setting1)” anotherThingy <-view
setting2 ...
to :: (s -> a) -> SimpleGetter s a #
to
creates a getter from any function:
a^.
to
f = f a
It's most useful in chains, because it lets you mix lenses and ordinary functions. Suppose you have a record which comes from some third-party library and doesn't have any lens accessors. You want to do something like this:
value ^. _1 . field . at 2
However, field
isn't a getter, and you have to do this instead:
field (value ^. _1) ^. at 2
but now value
is in the middle and it's hard to read the resulting code. A variant with to
is prettier and more readable:
value ^. _1 . to field . at 2