ProjectConfigSkeleton is a tree of conditional blocks and imports wrapping a config. It can be finalized by providing the conditional resolution info and then resolving and downloading the imports
Modulecabal-install-3.12.1.0Haskell2010
Distribution.Client.ProjectConfig.Legacy
Project configuration, implementation in terms of legacy types.
- 2 types
- 13 values
- Packagecabal-install-3.12.1.0
- Exports15
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceLegacy.hs
parseProject :: FilePathThe root of the project configuration, typically cabal.project
-> FilePath-> HttpTransport-> Verbosity-> ProjectConfigToParseThe contents of the file to parse
-> IO (ParseResult ProjectConfigSkeleton)
Parses a project from its root config file, typically cabal.project.
Project config in terms of legacy types
3 declarationsWe already have parsers/pretty-printers for almost all the fields in the project config file, but they're in terms of the types used for the command line flags for Setup.hs or cabal commands. We don't want to redefine them all, at least not yet so for the moment we use the parsers at the old types and use conversion functions.
Ultimately if/when this project-based approach becomes the default then we can redefine the parsers directly for the new types.
Instances5Show, Generic, Semigroup, Monoid, Rep
Show LegacyProjectConfigDefined in cabal-install-3.12.1.0 · Distribution.Client.ProjectConfig.LegacyGeneric LegacyProjectConfigDefined in cabal-install-3.12.1.0 · Distribution.Client.ProjectConfig.LegacySemigroup LegacyProjectConfigDefined in cabal-install-3.12.1.0 · Distribution.Client.ProjectConfig.LegacyMonoid LegacyProjectConfigDefined in cabal-install-3.12.1.0 · Distribution.Client.ProjectConfig.Legacytype Rep LegacyProjectConfig = D1 ('MetaDataDefined in cabal-install-3.12.1.0 · Distribution.Client.ProjectConfig.Legacy"LegacyProjectConfig"
"Distribution.Client.ProjectConfig.Legacy"
"cabal-install-3.12.1.0-1D90DH9PPem9Tqn79I9vRN"
'False) (C1 ('MetaCons"LegacyProjectConfig"
'PrefixI 'True) (((S1 ('MetaSel ('Just"legacyPackages"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String]) :*: S1 ('MetaSel ('Just"legacyPackagesOptional"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String])) :*: (S1 ('MetaSel ('Just"legacyPackagesRepo"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceRepoList]) :*: S1 ('MetaSel ('Just"legacyPackagesNamed"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PackageVersionConstraint]))) :*: ((S1 ('MetaSel ('Just"legacySharedConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LegacySharedConfig) :*: S1 ('MetaSel ('Just"legacyAllConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LegacyPackageConfig)) :*: (S1 ('MetaSel ('Just"legacyLocalConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LegacyPackageConfig) :*: S1 ('MetaSel ('Just"legacySpecificConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MapMappend PackageName LegacyPackageConfig))))))
Conversion to and from legacy config types
4 declarationsConvert configuration from the cabal configure or cabal build command
line into a ProjectConfig value that can combined with configuration from
other sources.
At the moment this uses the legacy command line flag types. See LegacyProjectConfig for an explanation.
Convert the project config from the legacy types to the ProjectConfig and associated types. See LegacyProjectConfig for an explanation of the approach.
Convert from the types currently used for the user-wide Cabal config file into the ProjectConfig type.
Only a subset of the ProjectConfig can be represented in the user-wide config. In particular it does not include packages that are in the project, and it also doesn't support package-specific configuration (only configuration that applies to all packages).
Internals, just for tests
2 declarationsThis is a bit tricky since it has to cover globs which have embedded ,
chars. But we don't just want to parse strictly as a glob since we want to
allow http urls which don't parse as globs, and possibly some
system-dependent file paths. So we parse fairly liberally as a token, but
we allow , inside matched {} braces.