Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stack.Types.Config
Contents
Description
The Config type.
Synopsis
- class HasPlatform env where
- platformL :: Lens' env Platform
- platformVariantL :: Lens' env PlatformVariant
- data PlatformVariant
- data Config = Config {
- configWorkDir :: !(Path Rel Dir)
- configUserConfigPath :: !(Path Abs File)
- configBuild :: !BuildOpts
- configDocker :: !DockerOpts
- configNix :: !NixOpts
- configProcessContextSettings :: !(EnvSettings -> IO ProcessContext)
- configLocalProgramsBase :: !(Path Abs Dir)
- configLocalPrograms :: !(Path Abs Dir)
- configHideTHLoading :: !Bool
- configPlatform :: !Platform
- configPlatformVariant :: !PlatformVariant
- configGHCVariant0 :: !(Maybe GHCVariant)
- configGHCBuild :: !(Maybe CompilerBuild)
- configUrls :: !Urls
- configSystemGHC :: !Bool
- configInstallGHC :: !Bool
- configSkipGHCCheck :: !Bool
- configSkipMsys :: !Bool
- configCompilerCheck :: !VersionCheck
- configLocalBin :: !(Path Abs Dir)
- configRequireStackVersion :: !VersionRange
- configJobs :: !Int
- configOverrideGccPath :: !(Maybe (Path Abs File))
- configOverrideHpack :: !HpackExecutable
- configExtraIncludeDirs :: !(Set FilePath)
- configExtraLibDirs :: !(Set FilePath)
- configConcurrentTests :: !Bool
- configImage :: !ImageOpts
- configTemplateParams :: !(Map Text Text)
- configScmInit :: !(Maybe SCM)
- configGhcOptionsByName :: !(Map PackageName [Text])
- configGhcOptionsByCat :: !(Map ApplyGhcOptions [Text])
- configSetupInfoLocations :: ![SetupInfoLocation]
- configPvpBounds :: !PvpBounds
- configModifyCodePage :: !Bool
- configExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configRebuildGhcOptions :: !Bool
- configApplyGhcOptions :: !ApplyGhcOptions
- configAllowNewer :: !Bool
- configDefaultTemplate :: !(Maybe TemplateName)
- configAllowDifferentUser :: !Bool
- configDumpLogs :: !DumpLogs
- configMaybeProject :: !(Maybe (Project, Path Abs File))
- configAllowLocals :: !Bool
- configSaveHackageCreds :: !Bool
- configHackageBaseUrl :: !Text
- configRunner :: !Runner
- configCabalLoader :: !CabalLoader
- class (HasPlatform env, HasProcessContext env, HasCabalLoader env) => HasConfig env where
- askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text
- explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool
- data BuildConfig = BuildConfig {
- bcConfig :: !Config
- bcSnapshotDef :: !SnapshotDef
- bcGHCVariant :: !GHCVariant
- bcPackages :: ![PackageLocation Subdirs]
- bcDependencies :: ![PackageLocationIndex Subdirs]
- bcExtraPackageDBs :: ![Path Abs Dir]
- bcStackYaml :: !(Path Abs File)
- bcFlags :: !(Map PackageName (Map FlagName Bool))
- bcImplicitGlobal :: !Bool
- data LocalPackages = LocalPackages {}
- data LocalPackageView = LocalPackageView {
- lpvCabalFP :: !(Path Abs File)
- lpvGPD :: !GenericPackageDescription
- lpvLoc :: !(PackageLocation FilePath)
- lpvRoot :: LocalPackageView -> Path Abs Dir
- lpvName :: LocalPackageView -> PackageName
- lpvVersion :: LocalPackageView -> Version
- lpvComponents :: LocalPackageView -> Set NamedComponent
- stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File)
- projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir)
- class HasConfig env => HasBuildConfig env where
- buildConfigL :: Lens' env BuildConfig
- data GHCVariant
- ghcVariantName :: GHCVariant -> String
- ghcVariantSuffix :: GHCVariant -> String
- parseGHCVariant :: MonadThrow m => String -> m GHCVariant
- class HasGHCVariant env where
- ghcVariantL :: Lens' env GHCVariant
- snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir)
- data EnvConfig = EnvConfig {}
- class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env where
- envConfigL :: Lens' env EnvConfig
- getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File)
- data ApplyGhcOptions
- data HpackExecutable
- data ConfigException
- = ParseConfigFileException (Path Abs File) ParseException
- | ParseCustomSnapshotException Text ParseException
- | 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 !Text String
- | ResolverPartial WhichSolverCmd !Text 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
- | DuplicateLocalPackageNames ![(PackageName, [PackageLocationIndex FilePath])]
- 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 FilePath)
- configMonoidExtraLibDirs :: !(Set FilePath)
- configMonoidOverrideGccPath :: !(First (Path Abs File))
- configMonoidOverrideHpack :: !(First FilePath)
- configMonoidConcurrentTests :: !(First Bool)
- configMonoidLocalBinPath :: !(First FilePath)
- configMonoidImageOpts :: !ImageOptsMonoid
- configMonoidTemplateParameters :: !(Map Text Text)
- configMonoidScmInit :: !(First SCM)
- configMonoidGhcOptionsByName :: !(MonoidMap PackageName (Dual [Text]))
- configMonoidGhcOptionsByCat :: !(MonoidMap ApplyGhcOptions (Dual [Text]))
- 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)
- configMonoidSaveHackageCreds :: !(First Bool)
- configMonoidHackageBaseUrl :: !(First Text)
- configMonoidIgnoreRevisionMismatch :: !(First Bool)
- configMonoidInstallGHCName :: Text
- configMonoidSystemGHCName :: Text
- parseConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ConfigMonoid)
- data DumpLogs
- data EnvSettings = EnvSettings {
- esIncludeLocals :: !Bool
- esIncludeGhcPackagePath :: !Bool
- esStackExe :: !Bool
- esLocaleUtf8 :: !Bool
- esKeepGhcRts :: !Bool
- minimalEnvSettings :: EnvSettings
- defaultEnvSettings :: EnvSettings
- plainEnvSettings :: EnvSettings
- data GlobalOpts = GlobalOpts {
- globalReExecVersion :: !(Maybe String)
- globalDockerEntrypoint :: !(Maybe DockerEntrypoint)
- globalLogLevel :: !LogLevel
- globalTimeInLog :: !Bool
- globalConfigMonoid :: !ConfigMonoid
- globalResolver :: !(Maybe AbstractResolver)
- globalCompiler :: !(Maybe (CompilerVersion CVWanted))
- globalTerminal :: !Bool
- globalColorWhen :: !ColorWhen
- globalTermWidth :: !(Maybe Int)
- 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 CVWanted))
- globalMonoidTerminal :: !(First Bool)
- globalMonoidColorWhen :: !(First ColorWhen)
- globalMonoidTermWidth :: !(First Int)
- globalMonoidStackYaml :: !(First FilePath)
- data StackYamlLoc filepath
- = SYLDefault
- | SYLOverride !filepath
- | SYLNoConfig !(Path Abs Dir)
- defaultLogLevel :: LogLevel
- data LoadConfig = LoadConfig {
- lcConfig :: !Config
- lcLoadBuildConfig :: !(Maybe (CompilerVersion CVWanted) -> IO BuildConfig)
- lcProjectRoot :: !(Maybe (Path Abs Dir))
- data PackageIndex = PackageIndex {
- indexName :: !IndexName
- indexLocation :: !Text
- indexType :: !IndexType
- indexDownloadPrefix :: !Text
- indexRequireHashes :: !Bool
- newtype IndexName = IndexName {}
- indexNameText :: IndexName -> Text
- data Project = Project {
- projectUserMsg :: !(Maybe String)
- projectPackages :: ![PackageLocation Subdirs]
- projectDependencies :: ![PackageLocationIndex Subdirs]
- projectFlags :: !(Map PackageName (Map FlagName Bool))
- projectResolver :: !Resolver
- projectCompiler :: !(Maybe (CompilerVersion CVWanted))
- projectExtraPackageDBs :: ![FilePath]
- data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid
- parseProjectAndConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ProjectAndConfigMonoid)
- data PvpBounds = PvpBounds {
- pbType :: !PvpBoundsType
- pbAsRevision :: !Bool
- data PvpBoundsType
- parsePvpBounds :: Text -> Either String PvpBounds
- readColorWhen :: ReadM ColorWhen
- data SCM = Git
- bindirSuffix :: Path Rel Dir
- configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File)
- configLoadedSnapshotCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapshotDef -> GlobalInfoSource -> m (Path Abs File)
- data GlobalInfoSource
- 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)
- bindirCompilerTools :: (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)
- shaPath :: (IsPath Rel t, MonadThrow m) => Path Rel t -> m (Path Rel t)
- shaPathForBytes :: (IsPath Rel t, MonadThrow m) => ByteString -> m (Path Rel t)
- 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]
- eoCwd :: !(Maybe FilePath)
- data DownloadInfo = DownloadInfo {}
- data VersionedDownloadInfo = VersionedDownloadInfo {}
- data GHCDownloadInfo = GHCDownloadInfo {}
- data SetupInfo = SetupInfo {}
- data SetupInfoLocation
- newtype DockerEntrypoint = DockerEntrypoint {}
- data DockerUser = DockerUser {}
- module Stack.Types.Config.Build
- wantedCompilerVersionL :: HasBuildConfig s => Getting r s (CompilerVersion CVWanted)
- actualCompilerVersionL :: HasEnvConfig s => Lens' s (CompilerVersion CVActual)
- 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
- stackRootL :: HasCabalLoader s => Lens' s (Path Abs Dir)
- configUrlsL :: HasConfig env => Lens' env Urls
- cabalVersionL :: HasEnvConfig env => Lens' env Version
- whichCompilerL :: Getting r (CompilerVersion a) WhichCompiler
- envOverrideSettingsL :: HasConfig env => Lens' env (EnvSettings -> IO ProcessContext)
- loadedSnapshotL :: HasEnvConfig env => Lens' env LoadedSnapshot
- globalHintsL :: HasBuildConfig s => Getting r s (Map PackageName (Maybe Version))
- shouldForceGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env Bool
- appropriateGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env (Maybe String)
- 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
Minimal complete definition
Nothing
Methods
platformL :: Lens' env Platform #
platformL :: HasConfig env => Lens' env Platform #
platformVariantL :: Lens' env PlatformVariant #
platformVariantL :: HasConfig env => Lens' env PlatformVariant #
Instances
HasPlatform LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasPlatform EnvConfig # | |
Defined in Stack.Types.Config | |
HasPlatform BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasPlatform Config # | |
Defined in Stack.Types.Config | |
HasPlatform MiniConfig # | |
Defined in Stack.Config Methods | |
HasPlatform (Platform, PlatformVariant) # | |
Defined in Stack.Types.Config Methods platformL :: Lens' (Platform, PlatformVariant) Platform # platformVariantL :: Lens' (Platform, PlatformVariant) PlatformVariant # |
data PlatformVariant #
A variant of the platform, used to differentiate Docker builds from host
Constructors
PlatformVariantNone | |
PlatformVariant String |
Instances
HasPlatform (Platform, PlatformVariant) # | |
Defined in Stack.Types.Config Methods platformL :: Lens' (Platform, PlatformVariant) Platform # platformVariantL :: Lens' (Platform, PlatformVariant) PlatformVariant # |
Config & HasConfig
The top-level Stackage configuration.
Constructors
Config | |
Fields
|
Instances
HasProcessContext Config # | |
Defined in Stack.Types.Config Methods | |
HasLogFunc Config # | |
HasRunner Config # | |
HasCabalLoader Config # | |
Defined in Stack.Types.Config Methods | |
HasConfig Config # | |
HasPlatform Config # | |
Defined in Stack.Types.Config |
class (HasPlatform env, HasProcessContext env, HasCabalLoader env) => HasConfig env where #
Class for environment values that can provide a Config
.
Minimal complete definition
Nothing
Instances
HasConfig LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasConfig EnvConfig # | |
HasConfig BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasConfig Config # | |
HasConfig MiniConfig # | |
Defined in Stack.Config Methods |
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
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
|
Instances
HasProcessContext BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasLogFunc BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasRunner BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasCabalLoader BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasBuildConfig BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasConfig BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasGHCVariant BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasPlatform BuildConfig # | |
Defined in Stack.Types.Config Methods |
data LocalPackages #
Constructors
LocalPackages | |
Fields |
data LocalPackageView #
A view of a local package needed for resolving components
Constructors
LocalPackageView | |
Fields
|
lpvRoot :: LocalPackageView -> Path Abs Dir #
Root directory for the given LocalPackageView
lpvName :: LocalPackageView -> PackageName #
Package name for the given 'LocalPackageView
lpvVersion :: LocalPackageView -> Version #
Version for the given 'LocalPackageView
lpvComponents :: LocalPackageView -> Set NamedComponent #
All components available in the given LocalPackageView
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 #
Minimal complete definition
Nothing
Methods
buildConfigL :: Lens' env BuildConfig #
buildConfigL :: HasEnvConfig env => Lens' env BuildConfig #
Instances
HasBuildConfig EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasBuildConfig BuildConfig # | |
Defined in Stack.Types.Config Methods |
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
Show GHCVariant # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> GHCVariant -> ShowS # show :: GHCVariant -> String # showList :: [GHCVariant] -> ShowS # | |
FromJSON GHCVariant # | |
Defined in Stack.Types.Config | |
HasGHCVariant GHCVariant # | |
Defined in Stack.Types.Config Methods |
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
Minimal complete definition
Nothing
Methods
ghcVariantL :: Lens' env GHCVariant #
ghcVariantL :: HasBuildConfig env => Lens' env GHCVariant #
Instances
HasGHCVariant GHCVariant # | |
Defined in Stack.Types.Config Methods | |
HasGHCVariant EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasGHCVariant BuildConfig # | |
Defined in Stack.Types.Config Methods | |
HasGHCVariant MiniConfig # | |
Defined in Stack.Config Methods |
snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir) #
Directory containing snapshots
EnvConfig & HasEnvConfig
Configuration after the environment has been setup.
Constructors
EnvConfig | |
Fields
|
Instances
HasProcessContext EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasLogFunc EnvConfig # | |
HasRunner EnvConfig # | |
HasCabalLoader EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasEnvConfig EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasBuildConfig EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasConfig EnvConfig # | |
HasGHCVariant EnvConfig # | |
Defined in Stack.Types.Config Methods | |
HasPlatform EnvConfig # | |
Defined in Stack.Types.Config |
class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env where #
Methods
envConfigL :: Lens' env EnvConfig #
Instances
HasEnvConfig EnvConfig # | |
Defined in Stack.Types.Config Methods |
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 |
Instances
ConfigException
data HpackExecutable #
Constructors
HpackBundled | |
HpackCommand String |
Instances
Eq HpackExecutable # | |
Defined in Stack.Types.Config Methods (==) :: HpackExecutable -> HpackExecutable -> Bool # (/=) :: HpackExecutable -> HpackExecutable -> Bool # | |
Ord HpackExecutable # | |
Defined in Stack.Types.Config Methods compare :: HpackExecutable -> HpackExecutable -> Ordering # (<) :: HpackExecutable -> HpackExecutable -> Bool # (<=) :: HpackExecutable -> HpackExecutable -> Bool # (>) :: HpackExecutable -> HpackExecutable -> Bool # (>=) :: HpackExecutable -> HpackExecutable -> Bool # max :: HpackExecutable -> HpackExecutable -> HpackExecutable # min :: HpackExecutable -> HpackExecutable -> HpackExecutable # | |
Read HpackExecutable # | |
Defined in Stack.Types.Config Methods readsPrec :: Int -> ReadS HpackExecutable # readList :: ReadS [HpackExecutable] # | |
Show HpackExecutable # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> HpackExecutable -> ShowS # show :: HpackExecutable -> String # showList :: [HpackExecutable] -> ShowS # |
data ConfigException #
Constructors
Instances
Show ConfigException # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> ConfigException -> ShowS # show :: ConfigException -> String # showList :: [ConfigException] -> ShowS # | |
Exception ConfigException # | |
Defined in Stack.Types.Config Methods toException :: ConfigException -> SomeException # |
WhichSolverCmd
data WhichSolverCmd #
Constructors
IsInitCmd | |
IsSolverCmd | |
IsNewCmd |
ConfigMonoid
data ConfigMonoid #
Constructors
Instances
parseConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ConfigMonoid) #
DumpLogs
Which build log files to dump
Constructors
DumpNoLogs | don't dump any logfiles |
DumpWarningLogs | dump logfiles containing warnings |
DumpAllLogs | dump all logfiles |
Instances
Bounded DumpLogs # | |
Enum DumpLogs # | |
Defined in Stack.Types.Config | |
Eq DumpLogs # | |
Ord DumpLogs # | |
Defined in Stack.Types.Config | |
Read DumpLogs # | |
Show DumpLogs # | |
FromJSON DumpLogs # | |
EnvSettings
data EnvSettings #
Controls which version of the environment is used
Constructors
EnvSettings | |
Fields
|
Instances
Eq EnvSettings # | |
Defined in Stack.Types.Config | |
Ord EnvSettings # | |
Defined in Stack.Types.Config Methods compare :: EnvSettings -> EnvSettings -> Ordering # (<) :: EnvSettings -> EnvSettings -> Bool # (<=) :: EnvSettings -> EnvSettings -> Bool # (>) :: EnvSettings -> EnvSettings -> Bool # (>=) :: EnvSettings -> EnvSettings -> Bool # max :: EnvSettings -> EnvSettings -> EnvSettings # min :: EnvSettings -> EnvSettings -> EnvSettings # | |
Show EnvSettings # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> EnvSettings -> ShowS # show :: EnvSettings -> String # showList :: [EnvSettings] -> ShowS # |
defaultEnvSettings :: EnvSettings #
Default EnvSettings
which includes locals and GHC_PACKAGE_PATH.
Note that this also passes through the GHCRTS environment variable. See https://github.com/commercialhaskell/stack/issues/3444
plainEnvSettings :: EnvSettings #
Environment settings which do not embellish the environment
Note that this also passes through the GHCRTS environment variable. See https://github.com/commercialhaskell/stack/issues/3444
GlobalOpts & GlobalOptsMonoid
data GlobalOpts #
Parsed global command-line options.
Constructors
GlobalOpts | |
Fields
|
Instances
Show GlobalOpts # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> GlobalOpts -> ShowS # show :: GlobalOpts -> String # showList :: [GlobalOpts] -> ShowS # |
data GlobalOptsMonoid #
Parsed global command-line options monoid.
Constructors
GlobalOptsMonoid | |
Fields
|
Instances
data StackYamlLoc filepath #
Constructors
SYLDefault | |
SYLOverride !filepath | |
SYLNoConfig !(Path Abs Dir) | FilePath is the directory containing the script file, used for resolving custom snapshot files. |
Instances
Default logging level should be something useful but not crazy.
LoadConfig
data LoadConfig #
Value returned by loadConfig
.
Constructors
LoadConfig | |
Fields
|
Instances
HasProcessContext LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasLogFunc LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasRunner LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasCabalLoader LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasConfig LoadConfig # | |
Defined in Stack.Types.Config Methods | |
HasPlatform LoadConfig # | |
Defined in Stack.Types.Config Methods |
PackageIndex, IndexName & IndexLocation
data PackageIndex #
Information on a single package index
Constructors
PackageIndex | |
Fields
|
Instances
Show PackageIndex # | |
Defined in Stack.Types.PackageIndex Methods showsPrec :: Int -> PackageIndex -> ShowS # show :: PackageIndex -> String # showList :: [PackageIndex] -> ShowS # | |
FromJSON (WithJSONWarnings PackageIndex) # | |
Defined in Stack.Types.PackageIndex Methods parseJSON :: Value -> Parser (WithJSONWarnings PackageIndex) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageIndex] # |
Unique name for a package index
Constructors
IndexName | |
Fields |
Instances
Eq IndexName # | |
Ord IndexName # | |
Show IndexName # | |
Hashable IndexName # | |
Defined in Stack.Types.PackageIndex | |
ToJSON IndexName # | |
Defined in Stack.Types.PackageIndex | |
FromJSON IndexName # | |
Store IndexName # | |
indexNameText :: IndexName -> Text #
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
|
data ProjectAndConfigMonoid #
Constructors
ProjectAndConfigMonoid !Project !ConfigMonoid |
parseProjectAndConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ProjectAndConfigMonoid) #
PvpBounds
Constructors
PvpBounds | |
Fields
|
Instances
Eq PvpBounds # | |
Ord PvpBounds # | |
Read PvpBounds # | |
Show PvpBounds # | |
ToJSON PvpBounds # | |
Defined in Stack.Types.Config | |
FromJSON PvpBounds # | |
data PvpBoundsType #
How PVP bounds should be added to .cabal files
Constructors
PvpBoundsNone | |
PvpBoundsUpper | |
PvpBoundsLower | |
PvpBoundsBoth |
Instances
ColorWhen
SCM
A software control system.
Constructors
Git |
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
configLoadedSnapshotCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapshotDef -> GlobalInfoSource -> m (Path Abs File) #
Where to store LoadedSnapshot
caches
data GlobalInfoSource #
Where do we get information on global packages for loading up a
LoadedSnapshot
?
Constructors
GISSnapshotHints | Accept the hints in the snapshot definition |
GISCompiler (CompilerVersion CVActual) | Look up the actual information in the installed compiler |
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
bindirCompilerTools :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #
Installation root for compiler tools
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.
shaPathForBytes :: (IsPath Rel t, MonadThrow m) => ByteString -> m (Path Rel t) #
Command-specific types
Eval
Constructors
EvalOpts | |
Fields
|
Exec
Constructors
ExecOpts | |
Fields
|
data SpecialExecCmd #
Constructors
ExecCmd String | |
ExecRun | |
ExecGhc | |
ExecRunGhc |
Instances
Eq SpecialExecCmd # | |
Defined in Stack.Types.Config Methods (==) :: SpecialExecCmd -> SpecialExecCmd -> Bool # (/=) :: SpecialExecCmd -> SpecialExecCmd -> Bool # | |
Show SpecialExecCmd # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> SpecialExecCmd -> ShowS # show :: SpecialExecCmd -> String # showList :: [SpecialExecCmd] -> ShowS # |
data ExecOptsExtra #
Constructors
ExecOptsPlain | |
ExecOptsEmbellished | |
Fields
|
Instances
Show ExecOptsExtra # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> ExecOptsExtra -> ShowS # show :: ExecOptsExtra -> String # showList :: [ExecOptsExtra] -> ShowS # |
Setup
data DownloadInfo #
Build of the compiler distribution (e.g. standard, gmp4, tinfo6) | Information for a file to download.
Constructors
DownloadInfo | |
Fields
|
Instances
Show DownloadInfo # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> DownloadInfo -> ShowS # show :: DownloadInfo -> String # showList :: [DownloadInfo] -> ShowS # | |
FromJSON (WithJSONWarnings DownloadInfo) # | |
Defined in Stack.Types.Config Methods parseJSON :: Value -> Parser (WithJSONWarnings DownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings DownloadInfo] # |
data VersionedDownloadInfo #
Constructors
VersionedDownloadInfo | |
Fields |
Instances
Show VersionedDownloadInfo # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> VersionedDownloadInfo -> ShowS # show :: VersionedDownloadInfo -> String # showList :: [VersionedDownloadInfo] -> ShowS # | |
FromJSON (WithJSONWarnings VersionedDownloadInfo) # | |
Defined in Stack.Types.Config Methods parseJSON :: Value -> Parser (WithJSONWarnings VersionedDownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings VersionedDownloadInfo] # |
data GHCDownloadInfo #
Constructors
GHCDownloadInfo | |
Fields |
Instances
Show GHCDownloadInfo # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> GHCDownloadInfo -> ShowS # show :: GHCDownloadInfo -> String # showList :: [GHCDownloadInfo] -> ShowS # | |
FromJSON (WithJSONWarnings GHCDownloadInfo) # | |
Defined in Stack.Types.Config Methods parseJSON :: Value -> Parser (WithJSONWarnings GHCDownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings GHCDownloadInfo] # |
Constructors
SetupInfo | |
Fields |
Instances
Show SetupInfo # | |
Semigroup SetupInfo # | For |
Monoid SetupInfo # | |
FromJSON (WithJSONWarnings SetupInfo) # | |
Defined in Stack.Types.Config Methods parseJSON :: Value -> Parser (WithJSONWarnings SetupInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings SetupInfo] # |
data SetupInfoLocation #
Remote or inline SetupInfo
Constructors
SetupInfoFileOrURL String | |
SetupInfoInline SetupInfo |
Instances
Show SetupInfoLocation # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> SetupInfoLocation -> ShowS # show :: SetupInfoLocation -> String # showList :: [SetupInfoLocation] -> ShowS # | |
FromJSON (WithJSONWarnings SetupInfoLocation) # | |
Defined in Stack.Types.Config Methods parseJSON :: Value -> Parser (WithJSONWarnings SetupInfoLocation) # parseJSONList :: Value -> Parser [WithJSONWarnings SetupInfoLocation] # |
Docker entrypoint
newtype DockerEntrypoint #
Data passed into Docker container for the Docker entrypoint's use
Constructors
DockerEntrypoint | |
Fields
|
Instances
Read DockerEntrypoint # | |
Defined in Stack.Types.Config Methods readsPrec :: Int -> ReadS DockerEntrypoint # readList :: ReadS [DockerEntrypoint] # | |
Show DockerEntrypoint # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> DockerEntrypoint -> ShowS # show :: DockerEntrypoint -> String # showList :: [DockerEntrypoint] -> ShowS # |
data DockerUser #
Docker host user info
Constructors
DockerUser | |
Instances
Read DockerUser # | |
Defined in Stack.Types.Config Methods readsPrec :: Int -> ReadS DockerUser # readList :: ReadS [DockerUser] # readPrec :: ReadPrec DockerUser # readListPrec :: ReadPrec [DockerUser] # | |
Show DockerUser # | |
Defined in Stack.Types.Config Methods showsPrec :: Int -> DockerUser -> ShowS # show :: DockerUser -> String # showList :: [DockerUser] -> ShowS # |
module Stack.Types.Config.Build
Lens helpers
wantedCompilerVersionL :: HasBuildConfig s => Getting r s (CompilerVersion CVWanted) #
The compiler specified by the SnapshotDef
. This may be
different from the actual compiler used!
actualCompilerVersionL :: HasEnvConfig s => Lens' s (CompilerVersion CVActual) #
The version of the compiler which will actually be used. May be
different than that specified in the SnapshotDef
and returned
by wantedCompilerVersionL
.
buildOptsL :: HasConfig s => Lens' s BuildOpts #
stackRootL :: HasCabalLoader s => Lens' s (Path Abs Dir) #
configUrlsL :: HasConfig env => Lens' env Urls #
cabalVersionL :: HasEnvConfig env => Lens' env Version #
whichCompilerL :: Getting r (CompilerVersion a) WhichCompiler #
envOverrideSettingsL :: HasConfig env => Lens' env (EnvSettings -> IO ProcessContext) #
loadedSnapshotL :: HasEnvConfig env => Lens' env LoadedSnapshot #
globalHintsL :: HasBuildConfig s => Getting r s (Map PackageName (Maybe Version)) #
shouldForceGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env Bool #
appropriateGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env (Maybe String) #
Lens reexport
view :: MonadReader s m => Getting a s a -> m a #
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