| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Stack.Types.SourceMap
Description
A sourcemap maps a package name to how it should be built,
including source code, flags, options, etc. This module contains
various stages of source map construction. See the
build_overview.md doc for details on these stages.
Synopsis
- data SMWanted = SMWanted {}
- data SMActual global = SMActual {
- smaCompiler :: !ActualCompiler
- smaProject :: !(Map PackageName ProjectPackage)
- smaDeps :: !(Map PackageName DepPackage)
- smaGlobal :: !(Map PackageName global)
- data Target
- data PackageType
- data SMTargets = SMTargets {
- smtTargets :: !(Map PackageName Target)
- smtDeps :: !(Map PackageName DepPackage)
- data SourceMap = SourceMap {
- smTargets :: !SMTargets
- smCompiler :: !ActualCompiler
- smProject :: !(Map PackageName ProjectPackage)
- smDeps :: !(Map PackageName DepPackage)
- smGlobal :: !(Map PackageName GlobalPackage)
- data FromSnapshot
- data DepPackage = DepPackage {}
- data ProjectPackage = ProjectPackage {
- ppCommon :: !CommonPackage
- ppCabalFP :: !(Path Abs File)
- ppResolvedDir :: !(ResolvedPath Dir)
- data CommonPackage = CommonPackage {
- cpGPD :: !(IO GenericPackageDescription)
- cpName :: !PackageName
- cpFlags :: !(Map FlagName Bool)
- cpGhcOptions :: ![Text]
- cpCabalConfigOpts :: ![Text]
- cpHaddocks :: !Bool
- newtype GlobalPackageVersion = GlobalPackageVersion Version
- data GlobalPackage
- isReplacedGlobal :: GlobalPackage -> Bool
- newtype SourceMapHash = SourceMapHash SHA256
- smRelDir :: MonadThrow m => SourceMapHash -> m (Path Rel Dir)
Different source map types
A source map with information on the wanted (but not actual)
compiler. This is derived by parsing the stack.yaml file for
packages, extra-deps, their configuration (e.g., flags and
options), and parsing the snapshot it refers to. It does not
include global packages or any information from the command line.
Invariant: a PackageName appears in either smwProject or
smwDeps, but not both.
Constructors
| SMWanted | |
Fields
| |
Adds in actual compiler information to SMWanted, in particular
the contents of the global package database.
Invariant: a PackageName appears in only one of the Maps.
Constructors
| SMActual | |
Fields
| |
How a package is intended to be built
Constructors
| TargetAll !PackageType | Build all of the default components. |
| TargetComps !(Set NamedComponent) | Only build specific components |
data PackageType Source #
Constructors
| PTProject | |
| PTDependency |
Instances
| Eq PackageType Source # | |
Defined in Stack.Types.SourceMap | |
| Show PackageType Source # | |
Defined in Stack.Types.SourceMap Methods showsPrec :: Int -> PackageType -> ShowS # show :: PackageType -> String # showList :: [PackageType] -> ShowS # | |
Builds on an SMActual by resolving the targets specified on the
command line, potentially adding in new dependency packages in the
process.
Constructors
| SMTargets | |
Fields
| |
The final source map, taking an SMTargets and applying all
command line flags and GHC options.
Constructors
| SourceMap | |
Fields
| |
Helper types
data FromSnapshot Source #
Flag showing if package comes from a snapshot needed to ignore dependency bounds between such packages
Constructors
| FromSnapshot | |
| NotFromSnapshot |
Instances
| Show FromSnapshot Source # | |
Defined in Stack.Types.SourceMap Methods showsPrec :: Int -> FromSnapshot -> ShowS # show :: FromSnapshot -> String # showList :: [FromSnapshot] -> ShowS # | |
data DepPackage Source #
A view of a dependency package, specified in stack.yaml
Constructors
| DepPackage | |
Fields
| |
data ProjectPackage Source #
A view of a project package needed for resolving components
Constructors
| ProjectPackage | |
Fields
| |
data CommonPackage Source #
Common settings for both dependency and project package.
Constructors
| CommonPackage | |
Fields
| |
newtype GlobalPackageVersion Source #
Constructors
| GlobalPackageVersion Version |
data GlobalPackage Source #
A view of a package installed in the global package database also could include marker for a replaced global package (could be replaced because of a replaced dependency)
Constructors
| GlobalPackage !Version | |
| ReplacedGlobalPackage ![PackageName] |
Instances
| Eq GlobalPackage Source # | |
Defined in Stack.Types.SourceMap Methods (==) :: GlobalPackage -> GlobalPackage -> Bool # (/=) :: GlobalPackage -> GlobalPackage -> Bool # | |
isReplacedGlobal :: GlobalPackage -> Bool Source #
newtype SourceMapHash Source #
A unique hash for the immutable portions of a SourceMap.
Constructors
| SourceMapHash SHA256 |
smRelDir :: MonadThrow m => SourceMapHash -> m (Path Rel Dir) Source #
Returns relative directory name with source map's hash