stack-2.14.0: The Haskell Tool Stack
Safe HaskellSafe-Inferred
LanguageGHC2021

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

Different source map types

data SMWanted Source #

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.

data SMActual global Source #

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.

data Target Source #

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

Instances details
Show PackageType Source # 
Instance details

Defined in Stack.Types.SourceMap

Eq PackageType Source # 
Instance details

Defined in Stack.Types.SourceMap

data SMTargets Source #

Builds on an SMActual by resolving the targets specified on the command line, potentially adding in new dependency packages in the process.

data SourceMap Source #

The final source map, taking an SMTargets and applying all command line flags and GHC options.

Constructors

SourceMap 

Fields

  • smTargets :: !SMTargets

    Doesn't need to be included in the hash, does not affect the source map.

  • smCompiler :: !ActualCompiler

    Need to hash the compiler version _and_ its installation path. Ideally there would be some kind of output from GHC telling us some unique ID for the compiler itself.

  • smProject :: !(Map PackageName ProjectPackage)

    Doesn't need to be included in hash, doesn't affect any of the packages that get stored in the snapshot database.

  • smDeps :: !(Map PackageName DepPackage)

    Need to hash all of the immutable dependencies, can ignore the mutable dependencies.

  • smGlobal :: !(Map PackageName GlobalPackage)

    Doesn't actually need to be hashed, implicitly captured by smCompiler. Can be broken if someone installs new global packages. We can document that as not supported, _or_ we could actually include all of this in the hash and make Stack more resilient.

Helper types

data FromSnapshot Source #

Flag showing if package comes from a snapshot needed to ignore dependency bounds between such packages

Instances

Instances details
Show FromSnapshot Source # 
Instance details

Defined in Stack.Types.SourceMap

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

ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent) Source #

All components available in the given ProjectPackage

ppRoot :: ProjectPackage -> Path Abs Dir Source #

Root directory for the given ProjectPackage

ppVersion :: MonadIO m => ProjectPackage -> m Version Source #

Version for the given 'ProjectPackage

data CommonPackage Source #

Settings common to dependency packages (DepPackage) and project packages (ProjectPackage).

Constructors

CommonPackage 

Fields

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

Instances details
Eq GlobalPackage Source # 
Instance details

Defined in Stack.Types.SourceMap

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