| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Stack.Types.SourceMap
Contents
Description
A source map maps a package name to how it should be built, including
source code, flags and options. This module exports types used in various
stages of source map construction. See build_overview.md for details on
these stages.
Synopsis
- data SMWanted = SMWanted {}
- data SMActual global = SMActual {
- compiler :: !ActualCompiler
- project :: !(Map PackageName ProjectPackage)
- deps :: !(Map PackageName DepPackage)
- globals :: !(Map PackageName global)
- data Target
- data PackageType
- data SMTargets = SMTargets {
- targets :: !(Map PackageName Target)
- deps :: !(Map PackageName DepPackage)
- data SourceMap = SourceMap {
- targets :: !SMTargets
- compiler :: !ActualCompiler
- project :: !(Map PackageName ProjectPackage)
- deps :: !(Map PackageName DepPackage)
- globalPkgs :: !(Map PackageName GlobalPackage)
- data FromSnapshot
- data DepPackage = DepPackage {
- depCommon :: !CommonPackage
- location :: !PackageLocation
- hidden :: !Bool
- fromSnapshot :: !FromSnapshot
- data ProjectPackage = ProjectPackage {
- projectCommon :: !CommonPackage
- cabalFP :: !(Path Abs File)
- resolvedDir :: !(ResolvedPath Dir)
- ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent)
- ppComponentsMaybe :: MonadIO m => (NamedComponent -> Maybe NamedComponent) -> ProjectPackage -> m (Set NamedComponent)
- ppGPD :: MonadIO m => ProjectPackage -> m GenericPackageDescription
- ppRoot :: ProjectPackage -> Path Abs Dir
- ppVersion :: MonadIO m => ProjectPackage -> m Version
- data CommonPackage = CommonPackage {
- gpd :: !(IO GenericPackageDescription)
- name :: !PackageName
- flags :: !(Map FlagName Bool)
- ghcOptions :: ![Text]
- cabalConfigOpts :: ![Text]
- buildHaddocks :: !Bool
- newtype GlobalPackageVersion = GlobalPackageVersion Version
- data GlobalPackage
- isReplacedGlobal :: GlobalPackage -> Bool
- newtype SourceMapHash = SourceMapHash SHA256
- smRelDir :: MonadThrow m => SourceMapHash -> m (Path Rel Dir)
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
| |
A source map with information on the actual compiler, including the contents of its global package database. It does not include any information from the command line.
Invariant: a PackageName appears in only one of the Maps.
Constructors
| SMActual | |
Fields
| |
A type representing 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
| Show PackageType Source # | |
Defined in Stack.Types.SourceMap Methods showsPrec :: Int -> PackageType -> ShowS # show :: PackageType -> String # showList :: [PackageType] -> ShowS # | |
| Eq PackageType Source # | |
Defined in Stack.Types.SourceMap | |
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.
One source map value is distinguished from another by a hash of the parts of the value that are immutable.
Constructors
| SourceMap | |
Fields
| |
Helper types
data FromSnapshot Source #
Flag showing if package comes from a snapshot. Used 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. Used to resolve components.
Constructors
| ProjectPackage | |
Fields
| |
ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent) Source #
All components available in the given ProjectPackage
ppComponentsMaybe :: MonadIO m => (NamedComponent -> Maybe NamedComponent) -> ProjectPackage -> m (Set NamedComponent) Source #
ppGPD :: MonadIO m => ProjectPackage -> m GenericPackageDescription Source #
ppRoot :: ProjectPackage -> Path Abs Dir Source #
Root directory for the given ProjectPackage
data CommonPackage Source #
Settings common to dependency packages (DepPackage)
and project packages (ProjectPackage).
Constructors
| CommonPackage | |
Fields
| |
newtype GlobalPackageVersion Source #
A type representing versions of packages in the global package database.
Constructors
| GlobalPackageVersion Version |
data GlobalPackage Source #
A view of a package installed in the global package database or a marker for a replaced global package. A 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