Safe Haskell | None |
---|---|
Language | Haskell2010 |
The Config type.
Synopsis
- class HasPlatform env where
- platformL :: Lens' env Platform
- platformVariantL :: Lens' env PlatformVariant
- data PlatformVariant
- class (HasProcessContext env, HasLogFunc env) => HasRunner env where
- data Runner = Runner {}
- data ColorWhen
- terminalL :: HasRunner env => Lens' env Bool
- reExecL :: HasRunner env => SimpleGetter env Bool
- 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
- configPrefixTimestamps :: !Bool
- configPlatform :: !Platform
- configPlatformVariant :: !PlatformVariant
- configGHCVariant :: !(Maybe GHCVariant)
- configGHCBuild :: !(Maybe CompilerBuild)
- configLatestSnapshot :: !Text
- configSystemGHC :: !Bool
- configInstallGHC :: !Bool
- configSkipGHCCheck :: !Bool
- configSkipMsys :: !Bool
- configCompilerCheck :: !VersionCheck
- configCompilerRepository :: !CompilerRepository
- configLocalBin :: !(Path Abs Dir)
- configRequireStackVersion :: !VersionRange
- configJobs :: !Int
- configOverrideGccPath :: !(Maybe (Path Abs File))
- configExtraIncludeDirs :: ![FilePath]
- configExtraLibDirs :: ![FilePath]
- configConcurrentTests :: !Bool
- configTemplateParams :: !(Map Text Text)
- configScmInit :: !(Maybe SCM)
- configGhcOptionsByName :: !(Map PackageName [Text])
- configGhcOptionsByCat :: !(Map ApplyGhcOptions [Text])
- configCabalConfigOpts :: !(Map CabalConfigKey [Text])
- configSetupInfoLocations :: ![String]
- configSetupInfoInline :: !SetupInfo
- configPvpBounds :: !PvpBounds
- configModifyCodePage :: !Bool
- configExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configRebuildGhcOptions :: !Bool
- configApplyGhcOptions :: !ApplyGhcOptions
- configAllowNewer :: !Bool
- configDefaultTemplate :: !(Maybe TemplateName)
- configAllowDifferentUser :: !Bool
- configDumpLogs :: !DumpLogs
- configProject :: !(ProjectConfig (Project, Path Abs File))
- configAllowLocals :: !Bool
- configSaveHackageCreds :: !Bool
- configHackageBaseUrl :: !Text
- configRunner :: !Runner
- configPantryConfig :: !PantryConfig
- configStackRoot :: !(Path Abs Dir)
- configResolver :: !(Maybe AbstractResolver)
- configUserStorage :: !UserStorage
- configHideSourcePaths :: !Bool
- configRecommendUpgrade :: !Bool
- configStackDeveloperMode :: !Bool
- class (HasPlatform env, HasGHCVariant env, HasProcessContext env, HasPantryConfig env, HasTerm env, HasRunner env) => HasConfig env where
- askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text
- explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool
- configProjectRoot :: Config -> Maybe (Path Abs Dir)
- data BuildConfig = BuildConfig {
- bcConfig :: !Config
- bcSMWanted :: !SMWanted
- bcExtraPackageDBs :: ![Path Abs Dir]
- bcStackYaml :: !(Path Abs File)
- bcProjectStorage :: !ProjectStorage
- bcCurator :: !(Maybe Curator)
- data ProjectPackage = ProjectPackage {
- ppCommon :: !CommonPackage
- ppCabalFP :: !(Path Abs File)
- ppResolvedDir :: !(ResolvedPath Dir)
- data DepPackage = DepPackage {}
- ppRoot :: ProjectPackage -> Path Abs Dir
- ppVersion :: MonadIO m => ProjectPackage -> m Version
- ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent)
- ppGPD :: MonadIO m => ProjectPackage -> m GenericPackageDescription
- 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
- newtype UserStorage = UserStorage {}
- newtype ProjectStorage = ProjectStorage {}
- data GHCVariant
- ghcVariantName :: GHCVariant -> String
- ghcVariantSuffix :: GHCVariant -> String
- parseGHCVariant :: MonadThrow m => String -> m GHCVariant
- class HasGHCVariant env where
- ghcVariantL :: SimpleGetter env GHCVariant
- snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir)
- data EnvConfig = EnvConfig {}
- class HasSourceMap env where
- sourceMapL :: Lens' env SourceMap
- class (HasBuildConfig env, HasSourceMap env, HasCompiler env) => HasEnvConfig env where
- envConfigL :: Lens' env EnvConfig
- getCompilerPath :: HasCompiler env => RIO env (Path Abs File)
- data ApplyGhcOptions
- data CabalConfigKey
- 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 (NonEmpty SnapName)
- | ResolverMismatch !RawSnapshotLocation String
- | ResolverPartial !RawSnapshotLocation String
- | NoSuchDirectory FilePath
- | ParseGHCVariantException String
- | BadStackRoot (Path Abs Dir)
- | Won'tCreateStackRootInDirectoryOwnedByDifferentUser (Path Abs Dir) (Path Abs Dir)
- | UserDoesn'tOwnDirectory (Path Abs Dir)
- | ManualGHCVariantSettingsAreIncompatibleWithSystemGHC
- | NixRequiresSystemGhc
- | NoResolverWhenUsingNoProject
- | DuplicateLocalPackageNames ![(PackageName, [PackageLocation])]
- data ConfigMonoid = ConfigMonoid {
- configMonoidStackRoot :: !(First (Path Abs Dir))
- configMonoidWorkDir :: !(First (Path Rel Dir))
- configMonoidBuildOpts :: !BuildOptsMonoid
- configMonoidDockerOpts :: !DockerOptsMonoid
- configMonoidNixOpts :: !NixOptsMonoid
- configMonoidConnectionCount :: !(First Int)
- configMonoidHideTHLoading :: !FirstTrue
- configMonoidPrefixTimestamps :: !(First Bool)
- configMonoidLatestSnapshot :: !(First Text)
- configMonoidPackageIndices :: !(First [HackageSecurityConfig])
- configMonoidSystemGHC :: !(First Bool)
- configMonoidInstallGHC :: !FirstTrue
- configMonoidSkipGHCCheck :: !FirstFalse
- configMonoidSkipMsys :: !FirstFalse
- configMonoidCompilerCheck :: !(First VersionCheck)
- configMonoidCompilerRepository :: !(First CompilerRepository)
- configMonoidRequireStackVersion :: !IntersectingVersionRange
- configMonoidArch :: !(First String)
- configMonoidGHCVariant :: !(First GHCVariant)
- configMonoidGHCBuild :: !(First CompilerBuild)
- configMonoidJobs :: !(First Int)
- configMonoidExtraIncludeDirs :: ![FilePath]
- configMonoidExtraLibDirs :: ![FilePath]
- configMonoidOverrideGccPath :: !(First (Path Abs File))
- configMonoidOverrideHpack :: !(First FilePath)
- configMonoidConcurrentTests :: !(First Bool)
- configMonoidLocalBinPath :: !(First FilePath)
- configMonoidTemplateParameters :: !(Map Text Text)
- configMonoidScmInit :: !(First SCM)
- configMonoidGhcOptionsByName :: !(MonoidMap PackageName (Dual [Text]))
- configMonoidGhcOptionsByCat :: !(MonoidMap ApplyGhcOptions (Dual [Text]))
- configMonoidCabalConfigOpts :: !(MonoidMap CabalConfigKey (Dual [Text]))
- configMonoidExtraPath :: ![Path Abs Dir]
- configMonoidSetupInfoLocations :: ![String]
- configMonoidSetupInfoInline :: !SetupInfo
- configMonoidLocalProgramsBase :: !(First (Path Abs Dir))
- configMonoidPvpBounds :: !(First PvpBounds)
- configMonoidModifyCodePage :: !FirstTrue
- configMonoidExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
- configMonoidRebuildGhcOptions :: !FirstFalse
- configMonoidApplyGhcOptions :: !(First ApplyGhcOptions)
- configMonoidAllowNewer :: !(First Bool)
- configMonoidDefaultTemplate :: !(First TemplateName)
- configMonoidAllowDifferentUser :: !(First Bool)
- configMonoidDumpLogs :: !(First DumpLogs)
- configMonoidSaveHackageCreds :: !(First Bool)
- configMonoidHackageBaseUrl :: !(First Text)
- configMonoidColorWhen :: !(First ColorWhen)
- configMonoidStyles :: !StylesUpdate
- configMonoidHideSourcePaths :: !FirstTrue
- configMonoidRecommendUpgrade :: !FirstTrue
- configMonoidCasaRepoPrefix :: !(First CasaRepoPrefix)
- configMonoidStackDeveloperMode :: !(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 WantedCompiler)
- globalTerminal :: !Bool
- globalStylesUpdate :: !StylesUpdate
- globalTermWidth :: !(Maybe Int)
- globalStackYaml :: !StackYamlLoc
- globalLockFileBehavior :: !LockFileBehavior
- data GlobalOptsMonoid = GlobalOptsMonoid {
- globalMonoidReExecVersion :: !(First String)
- globalMonoidDockerEntrypoint :: !(First DockerEntrypoint)
- globalMonoidLogLevel :: !(First LogLevel)
- globalMonoidTimeInLog :: !FirstTrue
- globalMonoidConfigMonoid :: !ConfigMonoid
- globalMonoidResolver :: !(First (Unresolved AbstractResolver))
- globalMonoidResolverRoot :: !(First FilePath)
- globalMonoidCompiler :: !(First WantedCompiler)
- globalMonoidTerminal :: !(First Bool)
- globalMonoidStyles :: !StylesUpdate
- globalMonoidTermWidth :: !(First Int)
- globalMonoidStackYaml :: !(First FilePath)
- globalMonoidLockFileBehavior :: !(First LockFileBehavior)
- data StackYamlLoc
- stackYamlLocL :: HasRunner env => Lens' env StackYamlLoc
- data LockFileBehavior
- readLockFileBehavior :: ReadM LockFileBehavior
- lockFileBehaviorL :: HasRunner env => SimpleGetter env LockFileBehavior
- defaultLogLevel :: LogLevel
- data Project = Project {
- projectUserMsg :: !(Maybe String)
- projectPackages :: ![RelFilePath]
- projectDependencies :: ![RawPackageLocation]
- projectFlags :: !(Map PackageName (Map FlagName Bool))
- projectResolver :: !RawSnapshotLocation
- projectCompiler :: !(Maybe WantedCompiler)
- projectExtraPackageDBs :: ![FilePath]
- projectCurator :: !(Maybe Curator)
- projectDropPackages :: !(Set PackageName)
- data ProjectConfig a
- data Curator = Curator {}
- data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid
- parseProjectAndConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings (IO ProjectAndConfigMonoid))
- data PvpBounds = PvpBounds {
- pbType :: !PvpBoundsType
- pbAsRevision :: !Bool
- data PvpBoundsType
- parsePvpBounds :: Text -> Either String PvpBounds
- readColorWhen :: ReadM ColorWhen
- readStyles :: ReadM StylesUpdate
- data SCM = Git
- bindirSuffix :: Path Rel Dir
- data GlobalInfoSource
- getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir)
- docDirSuffix :: Path Rel Dir
- extraBinDirs :: HasEnvConfig env => RIO env (Bool -> [Path Abs Dir])
- hpcReportDir :: HasEnvConfig env => RIO env (Path Abs Dir)
- installationRootDeps :: HasEnvConfig env => RIO env (Path Abs Dir)
- installationRootLocal :: HasEnvConfig env => RIO env (Path Abs Dir)
- bindirCompilerTools :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- hoogleRoot :: HasEnvConfig env => RIO env (Path Abs Dir)
- hoogleDatabasePath :: HasEnvConfig env => RIO env (Path Abs File)
- packageDatabaseDeps :: HasEnvConfig env => RIO env (Path Abs Dir)
- packageDatabaseExtra :: (MonadReader env m, HasEnvConfig env) => m [Path Abs Dir]
- packageDatabaseLocal :: HasEnvConfig env => RIO env (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 = ExecOptsExtra {
- eoEnvSettings :: !EnvSettings
- eoPackages :: ![String]
- eoRtsOptions :: ![String]
- eoCwd :: !(Maybe FilePath)
- data DownloadInfo = DownloadInfo {}
- data VersionedDownloadInfo = VersionedDownloadInfo {}
- data GHCDownloadInfo = GHCDownloadInfo {}
- data SetupInfo = SetupInfo {}
- newtype DockerEntrypoint = DockerEntrypoint {}
- data DockerUser = DockerUser {}
- module Stack.Types.Config.Build
- wantedCompilerVersionL :: HasBuildConfig s => Getting r s WantedCompiler
- actualCompilerVersionL :: HasSourceMap env => SimpleGetter env ActualCompiler
- class HasCompiler env where
- data DumpPackage = DumpPackage {
- dpGhcPkgId :: !GhcPkgId
- dpPackageIdent :: !PackageIdentifier
- dpParentLibIdent :: !(Maybe PackageIdentifier)
- dpLicense :: !(Maybe License)
- dpLibDirs :: ![FilePath]
- dpLibraries :: ![Text]
- dpHasExposedModules :: !Bool
- dpExposedModules :: !(Set ModuleName)
- dpDepends :: ![GhcPkgId]
- dpHaddockInterfaces :: ![FilePath]
- dpHaddockHtml :: !(Maybe FilePath)
- dpIsExposed :: !Bool
- data CompilerPaths = CompilerPaths {
- cpCompilerVersion :: !ActualCompiler
- cpArch :: !Arch
- cpBuild :: !CompilerBuild
- cpCompiler :: !(Path Abs File)
- cpPkg :: !GhcPkgExe
- cpInterpreter :: !(Path Abs File)
- cpHaddock :: !(Path Abs File)
- cpSandboxed :: !Bool
- cpCabalVersion :: !Version
- cpGlobalDB :: !(Path Abs Dir)
- cpGhcInfo :: !ByteString
- cpGlobalDump :: !(Map PackageName DumpPackage)
- newtype GhcPkgExe = GhcPkgExe (Path Abs File)
- getGhcPkgExe :: HasCompiler env => RIO env GhcPkgExe
- cpWhich :: (MonadReader env m, HasCompiler env) => m WhichCompiler
- data ExtraDirs = ExtraDirs {}
- buildOptsL :: HasConfig s => Lens' s BuildOpts
- globalOptsL :: HasRunner env => Lens' env GlobalOpts
- 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 :: HasConfig s => Lens' s (Path Abs Dir)
- cabalVersionL :: HasCompiler env => SimpleGetter env Version
- whichCompilerL :: Getting r ActualCompiler WhichCompiler
- envOverrideSettingsL :: HasConfig env => Lens' env (EnvSettings -> IO ProcessContext)
- shouldForceGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env Bool
- appropriateGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env (Maybe String)
- prettyStackDevL :: HasConfig env => [StyleDoc] -> RIO env ()
- 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 Source #
Class for environment values which have a Platform
Nothing
platformL :: Lens' env Platform Source #
platformL :: HasConfig env => Lens' env Platform Source #
platformVariantL :: Lens' env PlatformVariant Source #
platformVariantL :: HasConfig env => Lens' env PlatformVariant Source #
Instances
HasPlatform EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasPlatform BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasPlatform Config Source # | |
Defined in Stack.Types.Config | |
HasPlatform (Platform, PlatformVariant) Source # | |
Defined in Stack.Types.Config |
data PlatformVariant Source #
A variant of the platform, used to differentiate Docker builds from host
Instances
HasPlatform (Platform, PlatformVariant) Source # | |
Defined in Stack.Types.Config |
Runner
class (HasProcessContext env, HasLogFunc env) => HasRunner env where Source #
Class for environment values which have a Runner
.
The base environment that almost everything in Stack runs in,
based off of parsing command line options in GlobalOpts
. Provides
logging and process execution.
Runner | |
|
Instances
HasProcessContext Runner Source # | |
Defined in Stack.Types.Config | |
HasLogFunc Runner Source # | |
HasTerm Runner Source # | |
HasStylesUpdate Runner Source # | |
Defined in Stack.Types.Config | |
HasRunner Runner Source # | |
Instances
Eq ColorWhen Source # | |
Show ColorWhen Source # | |
Generic ColorWhen Source # | |
FromJSON ColorWhen Source # | |
type Rep ColorWhen Source # | |
Defined in Stack.Types.Config type Rep ColorWhen = D1 (MetaData "ColorWhen" "Stack.Types.Config" "stack-2.3.3-5vuHdtw7Ta51AZnwh24tKe" False) (C1 (MetaCons "ColorNever" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ColorAlways" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ColorAuto" PrefixI False) (U1 :: Type -> Type))) |
Config & HasConfig
The top-level Stackage configuration.
Config | |
|
Instances
HasPantryConfig Config Source # | |
Defined in Stack.Types.Config | |
HasProcessContext Config Source # | |
Defined in Stack.Types.Config | |
HasLogFunc Config Source # | |
HasTerm Config Source # | |
HasStylesUpdate Config Source # | |
Defined in Stack.Types.Config | |
HasConfig Config Source # | |
HasRunner Config Source # | |
HasGHCVariant Config Source # | |
Defined in Stack.Types.Config | |
HasPlatform Config Source # | |
Defined in Stack.Types.Config |
class (HasPlatform env, HasGHCVariant env, HasProcessContext env, HasPantryConfig env, HasTerm env, HasRunner env) => HasConfig env where Source #
Class for environment values that can provide a Config
.
Nothing
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
configProjectRoot :: Config -> Maybe (Path Abs Dir) Source #
The project root directory, if in a project.
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.
These are the components which know nothing about local configuration.
BuildConfig | |
|
Instances
HasPantryConfig BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasProcessContext BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasLogFunc BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasTerm BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasStylesUpdate BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasBuildConfig BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasConfig BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasRunner BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasGHCVariant BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasPlatform BuildConfig Source # | |
Defined in Stack.Types.Config |
data ProjectPackage Source #
A view of a project package needed for resolving components
ProjectPackage | |
|
data DepPackage Source #
A view of a dependency package, specified in stack.yaml
DepPackage | |
|
ppRoot :: ProjectPackage -> Path Abs Dir Source #
Root directory for the given ProjectPackage
ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent) Source #
All components available in the given ProjectPackage
ppGPD :: MonadIO m => ProjectPackage -> m GenericPackageDescription Source #
stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File) Source #
projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir) Source #
Directory containing the project's stack.yaml file
class HasConfig env => HasBuildConfig env where Source #
Nothing
buildConfigL :: Lens' env BuildConfig Source #
buildConfigL :: HasEnvConfig env => Lens' env BuildConfig Source #
Instances
HasBuildConfig EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasBuildConfig BuildConfig Source # | |
Defined in Stack.Types.Config |
Storage databases
newtype UserStorage Source #
A bit of type safety to ensure we're talking to the right database.
newtype ProjectStorage Source #
A bit of type safety to ensure we're talking to the right database.
GHCVariant & HasGHCVariant
data GHCVariant Source #
Specialized bariant of GHC (e.g. libgmp4 or integer-simple)
GHCStandard | Standard bindist |
GHCIntegerSimple | Bindist that uses integer-simple |
GHCCustom String | Other bindists |
Instances
Show GHCVariant Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> GHCVariant -> ShowS # show :: GHCVariant -> String # showList :: [GHCVariant] -> ShowS # | |
FromJSON GHCVariant Source # | |
Defined in Stack.Types.Config parseJSON :: Value -> Parser GHCVariant # parseJSONList :: Value -> Parser [GHCVariant] # | |
HasGHCVariant GHCVariant Source # | |
Defined in Stack.Types.Config |
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
Nothing
ghcVariantL :: SimpleGetter env GHCVariant Source #
ghcVariantL :: HasConfig env => SimpleGetter env GHCVariant Source #
Instances
HasGHCVariant GHCVariant Source # | |
Defined in Stack.Types.Config | |
HasGHCVariant EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasGHCVariant BuildConfig Source # | |
Defined in Stack.Types.Config | |
HasGHCVariant Config Source # | |
Defined in Stack.Types.Config |
snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir) Source #
Directory containing snapshots
EnvConfig & HasEnvConfig
Configuration after the environment has been setup.
Instances
HasPantryConfig EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasProcessContext EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasLogFunc EnvConfig Source # | |
HasTerm EnvConfig Source # | |
HasStylesUpdate EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasSourceMap EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasCompiler EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasEnvConfig EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasBuildConfig EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasConfig EnvConfig Source # | |
HasRunner EnvConfig Source # | |
HasGHCVariant EnvConfig Source # | |
Defined in Stack.Types.Config | |
HasPlatform EnvConfig Source # | |
Defined in Stack.Types.Config |
class HasSourceMap env where Source #
sourceMapL :: Lens' env SourceMap Source #
Instances
HasSourceMap EnvConfig Source # | |
Defined in Stack.Types.Config |
class (HasBuildConfig env, HasSourceMap env, HasCompiler env) => HasEnvConfig env where Source #
envConfigL :: Lens' env EnvConfig Source #
Instances
HasEnvConfig EnvConfig Source # | |
Defined in Stack.Types.Config |
getCompilerPath :: HasCompiler env => RIO env (Path Abs File) Source #
Get the path for the given compiler ignoring any local binaries.
Details
ApplyGhcOptions
data ApplyGhcOptions Source #
Which packages do ghc-options on the command line apply to?
AGOTargets | all local targets |
AGOLocals | all local packages, even non-targets |
AGOEverything | every package |
Instances
CabalConfigKey
data CabalConfigKey Source #
Which packages do configure opts apply to?
CCKTargets | See AGOTargets |
CCKLocals | See AGOLocals |
CCKEverything | See AGOEverything |
CCKPackage !PackageName | A specific package |
Instances
ConfigException
data HpackExecutable #
What to use for running hpack
Since: pantry-0.1.0.0
HpackBundled | Compiled in library |
HpackCommand !FilePath | Executable at the provided path |
Instances
Eq HpackExecutable | |
Defined in Pantry.Types (==) :: HpackExecutable -> HpackExecutable -> Bool # (/=) :: HpackExecutable -> HpackExecutable -> Bool # | |
Ord HpackExecutable | |
Defined in Pantry.Types 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 Pantry.Types | |
Show HpackExecutable | |
Defined in Pantry.Types showsPrec :: Int -> HpackExecutable -> ShowS # show :: HpackExecutable -> String # showList :: [HpackExecutable] -> ShowS # |
data ConfigException Source #
Instances
Show ConfigException Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> ConfigException -> ShowS # show :: ConfigException -> String # showList :: [ConfigException] -> ShowS # | |
Exception ConfigException Source # | |
Defined in Stack.Types.Config |
ConfigMonoid
data ConfigMonoid Source #
Instances
parseConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ConfigMonoid) Source #
DumpLogs
Which build log files to dump
DumpNoLogs | don't dump any logfiles |
DumpWarningLogs | dump logfiles containing warnings |
DumpAllLogs | dump all logfiles |
Instances
Bounded DumpLogs Source # | |
Enum DumpLogs Source # | |
Eq DumpLogs Source # | |
Ord DumpLogs Source # | |
Defined in Stack.Types.Config | |
Read DumpLogs Source # | |
Show DumpLogs Source # | |
FromJSON DumpLogs Source # | |
EnvSettings
data EnvSettings Source #
Controls which version of the environment is used
EnvSettings | |
|
Instances
Eq EnvSettings Source # | |
Defined in Stack.Types.Config (==) :: EnvSettings -> EnvSettings -> Bool # (/=) :: EnvSettings -> EnvSettings -> Bool # | |
Ord EnvSettings Source # | |
Defined in Stack.Types.Config 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 Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> EnvSettings -> ShowS # show :: EnvSettings -> String # showList :: [EnvSettings] -> ShowS # |
defaultEnvSettings :: EnvSettings Source #
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 Source #
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 Source #
Parsed global command-line options.
GlobalOpts | |
|
Instances
Show GlobalOpts Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> GlobalOpts -> ShowS # show :: GlobalOpts -> String # showList :: [GlobalOpts] -> ShowS # |
data GlobalOptsMonoid Source #
Parsed global command-line options monoid.
GlobalOptsMonoid | |
|
Instances
data StackYamlLoc Source #
Location for the project's stack.yaml file.
SYLDefault | Use the standard parent-directory-checking logic |
SYLOverride !(Path Abs File) | Use a specific stack.yaml file provided |
SYLNoProject ![PackageIdentifierRevision] | Do not load up a project, just user configuration. Include the given extra dependencies with the resolver. |
SYLGlobalProject | Do not look for a project configuration, and use the implicit global. |
Instances
Show StackYamlLoc Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> StackYamlLoc -> ShowS # show :: StackYamlLoc -> String # showList :: [StackYamlLoc] -> ShowS # |
stackYamlLocL :: HasRunner env => Lens' env StackYamlLoc Source #
data LockFileBehavior Source #
How to interact with lock files
LFBReadWrite | Read and write lock files |
LFBReadOnly | Read lock files, but do not write them |
LFBIgnore | Entirely ignore lock files |
LFBErrorOnWrite | Error out on trying to write a lock file. This can be used to ensure that lock files in a repository already ensure reproducible builds. |
Instances
Bounded LockFileBehavior Source # | |
Defined in Stack.Types.Config | |
Enum LockFileBehavior Source # | |
Defined in Stack.Types.Config succ :: LockFileBehavior -> LockFileBehavior # pred :: LockFileBehavior -> LockFileBehavior # toEnum :: Int -> LockFileBehavior # fromEnum :: LockFileBehavior -> Int # enumFrom :: LockFileBehavior -> [LockFileBehavior] # enumFromThen :: LockFileBehavior -> LockFileBehavior -> [LockFileBehavior] # enumFromTo :: LockFileBehavior -> LockFileBehavior -> [LockFileBehavior] # enumFromThenTo :: LockFileBehavior -> LockFileBehavior -> LockFileBehavior -> [LockFileBehavior] # | |
Show LockFileBehavior Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> LockFileBehavior -> ShowS # show :: LockFileBehavior -> String # showList :: [LockFileBehavior] -> ShowS # |
readLockFileBehavior :: ReadM LockFileBehavior Source #
Parser for LockFileBehavior
lockFileBehaviorL :: HasRunner env => SimpleGetter env LockFileBehavior Source #
defaultLogLevel :: LogLevel Source #
Default logging level should be something useful but not crazy.
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.
Project | |
|
data ProjectConfig a Source #
Project configuration information. Not every run of Stack has a true local project; see constructors below.
PCProject a | Normal run: we want a project, and have one. This comes from
either |
PCGlobalProject | No project was found when using |
PCNoProject ![PackageIdentifierRevision] | Use a no project run. This comes from |
Extra configuration intended exclusively for usage by the curator tool. In other words, this is not part of the documented and exposed Stack API. SUBJECT TO CHANGE.
Instances
Show Curator Source # | |
ToJSON Curator Source # | |
Defined in Stack.Types.Config | |
FromJSON (WithJSONWarnings Curator) Source # | |
Defined in Stack.Types.Config parseJSON :: Value -> Parser (WithJSONWarnings Curator) # parseJSONList :: Value -> Parser [WithJSONWarnings Curator] # |
parseProjectAndConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings (IO ProjectAndConfigMonoid)) Source #
PvpBounds
PvpBounds | |
|
data PvpBoundsType Source #
How PVP bounds should be added to .cabal files
Instances
ColorWhen
Styles
SCM
A software control system.
Paths
data GlobalInfoSource Source #
Where do we get information on global packages for loading up a
LoadedSnapshot
?
GISSnapshotHints | Accept the hints in the snapshot definition |
GISCompiler ActualCompiler | Look up the actual information in the installed compiler |
getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir) Source #
Per-project work dir
extraBinDirs :: HasEnvConfig env => RIO env (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 :: HasEnvConfig env => RIO env (Path Abs Dir) Source #
Where HPC reports and tix files get stored.
installationRootDeps :: HasEnvConfig env => RIO env (Path Abs Dir) Source #
Installation root for dependencies
installationRootLocal :: HasEnvConfig env => RIO env (Path Abs Dir) Source #
Installation root for locals
bindirCompilerTools :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) Source #
Installation root for compiler tools
hoogleRoot :: HasEnvConfig env => RIO env (Path Abs Dir) Source #
Hoogle directory.
hoogleDatabasePath :: HasEnvConfig env => RIO env (Path Abs File) Source #
Get the hoogle database path.
packageDatabaseDeps :: HasEnvConfig env => RIO env (Path Abs Dir) Source #
Package database for installing dependencies into
packageDatabaseExtra :: (MonadReader env m, HasEnvConfig env) => m [Path Abs Dir] Source #
Extra package databases
packageDatabaseLocal :: HasEnvConfig env => RIO env (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, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir) Source #
Relative directory for the platform and GHC identifier
platformGhcVerOnlyRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) Source #
Relative directory for the platform and GHC identifier without GHC bindist build
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.
shaPathForBytes :: (IsPath Rel t, MonadThrow m) => ByteString -> m (Path Rel t) Source #
Command-specific types
Eval
EvalOpts | |
|
Exec
ExecOpts | |
|
data SpecialExecCmd Source #
Instances
Eq SpecialExecCmd Source # | |
Defined in Stack.Types.Config (==) :: SpecialExecCmd -> SpecialExecCmd -> Bool # (/=) :: SpecialExecCmd -> SpecialExecCmd -> Bool # | |
Show SpecialExecCmd Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> SpecialExecCmd -> ShowS # show :: SpecialExecCmd -> String # showList :: [SpecialExecCmd] -> ShowS # |
data ExecOptsExtra Source #
ExecOptsExtra | |
|
Instances
Show ExecOptsExtra Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> ExecOptsExtra -> ShowS # show :: ExecOptsExtra -> String # showList :: [ExecOptsExtra] -> ShowS # |
Setup
data DownloadInfo Source #
Build of the compiler distribution (e.g. standard, gmp4, tinfo6) | Information for a file to download.
DownloadInfo | |
|
Instances
Show DownloadInfo Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> DownloadInfo -> ShowS # show :: DownloadInfo -> String # showList :: [DownloadInfo] -> ShowS # | |
FromJSON (WithJSONWarnings DownloadInfo) Source # | |
Defined in Stack.Types.Config parseJSON :: Value -> Parser (WithJSONWarnings DownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings DownloadInfo] # |
data VersionedDownloadInfo Source #
Instances
Show VersionedDownloadInfo Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> VersionedDownloadInfo -> ShowS # show :: VersionedDownloadInfo -> String # showList :: [VersionedDownloadInfo] -> ShowS # | |
FromJSON (WithJSONWarnings VersionedDownloadInfo) Source # | |
Defined in Stack.Types.Config |
data GHCDownloadInfo Source #
Instances
Show GHCDownloadInfo Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> GHCDownloadInfo -> ShowS # show :: GHCDownloadInfo -> String # showList :: [GHCDownloadInfo] -> ShowS # | |
FromJSON (WithJSONWarnings GHCDownloadInfo) Source # | |
Defined in Stack.Types.Config |
Instances
Show SetupInfo Source # | |
Semigroup SetupInfo Source # | For the |
Monoid SetupInfo Source # | |
FromJSON (WithJSONWarnings SetupInfo) Source # | |
Defined in Stack.Types.Config parseJSON :: Value -> Parser (WithJSONWarnings SetupInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings SetupInfo] # |
Docker entrypoint
newtype DockerEntrypoint Source #
Data passed into Docker container for the Docker entrypoint's use
DockerEntrypoint | |
|
Instances
Read DockerEntrypoint Source # | |
Defined in Stack.Types.Config | |
Show DockerEntrypoint Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> DockerEntrypoint -> ShowS # show :: DockerEntrypoint -> String # showList :: [DockerEntrypoint] -> ShowS # |
data DockerUser Source #
Docker host user info
Instances
Read DockerUser Source # | |
Defined in Stack.Types.Config readsPrec :: Int -> ReadS DockerUser # readList :: ReadS [DockerUser] # readPrec :: ReadPrec DockerUser # readListPrec :: ReadPrec [DockerUser] # | |
Show DockerUser Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> DockerUser -> ShowS # show :: DockerUser -> String # showList :: [DockerUser] -> ShowS # |
module Stack.Types.Config.Build
Lens helpers
wantedCompilerVersionL :: HasBuildConfig s => Getting r s WantedCompiler Source #
The compiler specified by the SnapshotDef
. This may be
different from the actual compiler used!
actualCompilerVersionL :: HasSourceMap env => SimpleGetter env ActualCompiler Source #
The version of the compiler which will actually be used. May be
different than that specified in the SnapshotDef
and returned
by wantedCompilerVersionL
.
class HasCompiler env where Source #
An environment which ensures that the given compiler is available on the PATH
Instances
HasCompiler CompilerPaths Source # | |
Defined in Stack.Types.Config | |
HasCompiler EnvConfig Source # | |
Defined in Stack.Types.Config |
data DumpPackage Source #
Dump information for a single package
DumpPackage | |
|
Instances
Eq DumpPackage Source # | |
Defined in Stack.Types.Config (==) :: DumpPackage -> DumpPackage -> Bool # (/=) :: DumpPackage -> DumpPackage -> Bool # | |
Read DumpPackage Source # | |
Defined in Stack.Types.Config readsPrec :: Int -> ReadS DumpPackage # readList :: ReadS [DumpPackage] # readPrec :: ReadPrec DumpPackage # readListPrec :: ReadPrec [DumpPackage] # | |
Show DumpPackage Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> DumpPackage -> ShowS # show :: DumpPackage -> String # showList :: [DumpPackage] -> ShowS # |
data CompilerPaths Source #
Paths on the filesystem for the compiler we're using
CompilerPaths | |
|
Instances
Show CompilerPaths Source # | |
Defined in Stack.Types.Config showsPrec :: Int -> CompilerPaths -> ShowS # show :: CompilerPaths -> String # showList :: [CompilerPaths] -> ShowS # | |
HasCompiler CompilerPaths Source # | |
Defined in Stack.Types.Config |
Location of the ghc-pkg executable
getGhcPkgExe :: HasCompiler env => RIO env GhcPkgExe Source #
Get the GhcPkgExe
from a HasCompiler
environment
cpWhich :: (MonadReader env m, HasCompiler env) => m WhichCompiler Source #
Instances
Show ExtraDirs Source # | |
Generic ExtraDirs Source # | |
Semigroup ExtraDirs Source # | |
Monoid ExtraDirs Source # | |
type Rep ExtraDirs Source # | |
Defined in Stack.Types.Config type Rep ExtraDirs = D1 (MetaData "ExtraDirs" "Stack.Types.Config" "stack-2.3.3-5vuHdtw7Ta51AZnwh24tKe" False) (C1 (MetaCons "ExtraDirs" PrefixI True) (S1 (MetaSel (Just "edBins") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Path Abs Dir]) :*: (S1 (MetaSel (Just "edInclude") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Path Abs Dir]) :*: S1 (MetaSel (Just "edLib") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Path Abs Dir])))) |
globalOptsL :: HasRunner env => Lens' env GlobalOpts Source #
cabalVersionL :: HasCompiler env => SimpleGetter env Version Source #
envOverrideSettingsL :: HasConfig env => Lens' env (EnvSettings -> IO ProcessContext) Source #
shouldForceGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env Bool Source #
appropriateGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env (Maybe String) Source #
Helper logging functions
prettyStackDevL :: HasConfig env => [StyleDoc] -> RIO env () Source #
In dev mode, print as a warning, otherwise as debug
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