Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
SMWanted | |
|
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 Map
s.
SMActual | |
|
How a package is intended to be built
TargetAll !PackageType | Build all of the default components. |
TargetComps !(Set NamedComponent) | Only build specific components |
data PackageType Source #
Instances
Eq PackageType Source # | |
Defined in Stack.Types.SourceMap (==) :: PackageType -> PackageType -> Bool # (/=) :: PackageType -> PackageType -> Bool # | |
Show PackageType Source # | |
Defined in Stack.Types.SourceMap 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.
SMTargets | |
|
The final source map, taking an SMTargets
and applying all
command line flags and GHC options.
SourceMap | |
|
Helper types
data FromSnapshot Source #
Flag showing if package comes from a snapshot needed to ignore dependency bounds between such packages
Instances
Show FromSnapshot Source # | |
Defined in Stack.Types.SourceMap showsPrec :: Int -> FromSnapshot -> ShowS # show :: FromSnapshot -> String # showList :: [FromSnapshot] -> ShowS # |
data DepPackage Source #
A view of a dependency package, specified in stack.yaml
DepPackage | |
|
data ProjectPackage Source #
A view of a project package needed for resolving components
ProjectPackage | |
|
data CommonPackage Source #
Common settings for both dependency and project package.
CommonPackage | |
|
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)
Instances
Eq GlobalPackage Source # | |
Defined in Stack.Types.SourceMap (==) :: GlobalPackage -> GlobalPackage -> Bool # (/=) :: GlobalPackage -> GlobalPackage -> Bool # |
isReplacedGlobal :: GlobalPackage -> Bool Source #
newtype SourceMapHash Source #
A unique hash for the immutable portions of a SourceMap
.
smRelDir :: MonadThrow m => SourceMapHash -> m (Path Rel Dir) Source #
Returns relative directory name with source map's hash