Safe Haskell | None |
---|---|
Language | Haskell2010 |
The Config type.
- data Config = Config {
- configStackRoot :: !(Path Abs Dir)
- configDocker :: !DockerOpts
- configEnvOverride :: !(EnvSettings -> IO EnvOverride)
- configLocalPrograms :: !(Path Abs Dir)
- configConnectionCount :: !Int
- configHideTHLoading :: !Bool
- configPlatform :: !Platform
- configLatestSnapshotUrl :: !Text
- configPackageIndices :: ![PackageIndex]
- configSystemGHC :: !Bool
- configInstallGHC :: !Bool
- configLocalBin :: !(Path Abs Dir)
- configRequireStackVersion :: !VersionRange
- configJobs :: !Int
- configExtraIncludeDirs :: !(Set Text)
- configExtraLibDirs :: !(Set Text)
- data PackageIndex = PackageIndex {
- indexName :: !IndexName
- indexLocation :: !IndexLocation
- indexDownloadPrefix :: !Text
- indexGpgVerify :: !Bool
- indexRequireHashes :: !Bool
- newtype IndexName = IndexName {}
- indexNameText :: IndexName -> Text
- data IndexLocation
- data EnvSettings = EnvSettings {}
- data BuildConfig = BuildConfig {
- bcConfig :: !Config
- bcResolver :: !Resolver
- bcGhcVersionExpected :: !Version
- bcPackages :: !(Map (Path Abs Dir) Bool)
- bcExtraDeps :: !(Map PackageName Version)
- bcRoot :: !(Path Abs Dir)
- bcStackYaml :: !(Path Abs File)
- bcFlags :: !(Map PackageName (Map FlagName Bool))
- data EnvConfig = EnvConfig {}
- class HasBuildConfig r => HasEnvConfig r where
- getEnvConfig :: r -> EnvConfig
- data LoadConfig m = LoadConfig {
- lcConfig :: !Config
- lcLoadBuildConfig :: !(Maybe Resolver -> NoBuildConfigStrategy -> m BuildConfig)
- lcProjectRoot :: !(Maybe (Path Abs Dir))
- data NoBuildConfigStrategy
- data PackageEntry = PackageEntry {
- peExtraDepMaybe :: !(Maybe Bool)
- peValidWanted :: !(Maybe Bool)
- peLocation :: !PackageLocation
- peSubdirs :: ![FilePath]
- peExtraDep :: PackageEntry -> Bool
- data PackageLocation
- = PLFilePath FilePath
- | PLHttpTarball Text
- | PLGit Text Text
- data Project = Project {
- projectPackages :: ![PackageEntry]
- projectExtraDeps :: !(Map PackageName Version)
- projectFlags :: !(Map PackageName (Map FlagName Bool))
- projectResolver :: !Resolver
- data Resolver
- renderResolver :: Resolver -> Text
- parseResolver :: MonadThrow m => Text -> m Resolver
- class HasStackRoot env where
- getStackRoot :: env -> Path Abs Dir
- class HasPlatform env where
- getPlatform :: env -> Platform
- class (HasStackRoot env, HasPlatform env) => HasConfig env where
- class HasConfig env => HasBuildConfig env where
- getBuildConfig :: env -> BuildConfig
- data ConfigMonoid = ConfigMonoid {
- configMonoidDockerOpts :: !DockerOptsMonoid
- configMonoidConnectionCount :: !(Maybe Int)
- configMonoidHideTHLoading :: !(Maybe Bool)
- configMonoidLatestSnapshotUrl :: !(Maybe Text)
- configMonoidPackageIndices :: !(Maybe [PackageIndex])
- configMonoidSystemGHC :: !(Maybe Bool)
- configMonoidInstallGHC :: !(Maybe Bool)
- configMonoidRequireStackVersion :: !VersionRange
- configMonoidOS :: !(Maybe String)
- configMonoidArch :: !(Maybe String)
- configMonoidJobs :: !(Maybe Int)
- configMonoidExtraIncludeDirs :: !(Set Text)
- configMonoidExtraLibDirs :: !(Set Text)
- newtype VersionRangeJSON = VersionRangeJSON {}
- data ConfigException
- = ParseConfigFileException (Path Abs File) ParseException
- | ParseResolverException Text
- | NoProjectConfigFound (Path Abs Dir) (Maybe Text)
- | UnexpectedTarballContents [Path Abs Dir] [Path Abs File]
- | BadStackVersionException VersionRange
- | NoMatchingSnapshot [SnapName]
- askConfig :: (MonadReader env m, HasConfig env) => m Config
- askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text
- configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir)
- configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndex :: (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)
- configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File)
- workDirRel :: Path Rel Dir
- configProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir)
- configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File)
- platformRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)
- configShakeFilesDir :: (MonadReader env m, HasBuildConfig env) => m (Path Abs Dir)
- configLocalUnpackDir :: (MonadReader env m, HasBuildConfig env) => m (Path Abs Dir)
- snapshotsDir :: (MonadReader env m, HasConfig env, MonadThrow m) => 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)
- packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasStackRoot env, HasPlatform env) => SnapName -> m (Path Abs File)
- bindirSuffix :: Path Rel Dir
- docdirSuffix :: Path Rel Dir
- extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir])
- getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride
- data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid
- packageEntryCurrDir :: PackageEntry
Documentation
The top-level Stackage configuration.
Config | |
|
data PackageIndex Source
Information on a single package index
PackageIndex | |
|
Show PackageIndex | |
FromJSON PackageIndex |
Unique name for a package index
indexNameText :: IndexName -> Text Source
data IndexLocation Source
Location of the package index. This ensures that at least one of Git or HTTP is available.
data EnvSettings Source
Controls which version of the environment is used
EnvSettings | |
|
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 | |
|
Configuration after the environment has been setup.
class HasBuildConfig r => HasEnvConfig r where Source
getEnvConfig :: r -> EnvConfig Source
HasEnvConfig EnvConfig | |
HasEnvConfig config => HasEnvConfig (Env config) |
data LoadConfig m Source
Value returned by loadConfig
.
LoadConfig | |
|
data PackageEntry Source
PackageEntry | |
|
Show PackageEntry | |
ToJSON PackageEntry | |
FromJSON 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 |
PLHttpTarball Text | |
PLGit Text Text | URL and commit |
Show PackageLocation | |
ToJSON PackageLocation | |
FromJSON PackageLocation |
A project is a collection of packages. We can have multiple stack.yaml files, but only one of them may contain project information.
Project | |
|
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 |
ResolverGhc !MajorVersion | Require a specific GHC major 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. |
renderResolver :: Resolver -> Text Source
Convert a Resolver into its Text
representation, as will be used by JSON/YAML
parseResolver :: MonadThrow m => Text -> m Resolver Source
Try to parse a Resolver
, using same format as JSONYAMLrenderResolver
class HasStackRoot env where Source
Class for environment values which have access to the stack root
Nothing
getStackRoot :: env -> Path Abs Dir Source
HasStackRoot EnvConfig | |
HasStackRoot BuildConfig | |
HasStackRoot Config | |
HasStackRoot config => HasStackRoot (Env config) |
class HasPlatform env where Source
Class for environment values which have a Platform
Nothing
getPlatform :: env -> Platform Source
HasPlatform Platform | |
HasPlatform EnvConfig | |
HasPlatform BuildConfig | |
HasPlatform Config | |
HasPlatform config => HasPlatform (Env config) |
class (HasStackRoot env, HasPlatform env) => HasConfig env where Source
Class for environment values that can provide a Config
.
Nothing
class HasConfig env => HasBuildConfig env where Source
Class for environment values that can provide a BuildConfig
.
getBuildConfig :: env -> BuildConfig Source
HasBuildConfig EnvConfig | |
HasBuildConfig BuildConfig | |
HasBuildConfig config => HasBuildConfig (Env config) |
data ConfigMonoid Source
ConfigMonoid | |
|
Show ConfigMonoid | |
Monoid ConfigMonoid | |
FromJSON ConfigMonoid |
newtype VersionRangeJSON Source
Newtype for non-orphan FromJSON instance.
FromJSON VersionRangeJSON | Parse VersionRange. |
data ConfigException Source
ParseConfigFileException (Path Abs File) ParseException | |
ParseResolverException Text | |
NoProjectConfigFound (Path Abs Dir) (Maybe Text) | |
UnexpectedTarballContents [Path Abs Dir] [Path Abs File] | |
BadStackVersionException VersionRange | |
NoMatchingSnapshot [SnapName] |
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
workDirRel :: Path Rel Dir Source
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
platformRelDir :: (MonadReader env m, HasPlatform 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, 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, HasStackRoot env, HasPlatform 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
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
FromJSON ProjectAndConfigMonoid |
packageEntryCurrDir :: PackageEntry Source
A PackageEntry for the current directory, used as a default