stack- The Haskell Tool Stack

Safe HaskellNone



Reading in SnapshotDefs and converting them into LoadedSnapshots.



loadResolver :: forall env. HasConfig env => Resolver -> RIO env SnapshotDef Source #

Convert a Resolver into a SnapshotDef

loadSnapshot Source #


:: (HasConfig env, HasGHCVariant env) 
=> Maybe (CompilerVersion CVActual)

installed GHC we should query; if none provided, use the global hints

-> Path Abs Dir

project root, used for checking out necessary files

-> SnapshotDef 
-> RIO env LoadedSnapshot 

Fully load up a SnapshotDef into a LoadedSnapshot

calculatePackagePromotion Source #


:: (HasConfig env, HasGHCVariant env) 
=> (PackageIdentifierRevision -> IO ByteString)

load from index

-> Path Abs Dir

project root

-> LoadedSnapshot 
-> [(GenericPackageDescription, SinglePackageLocation, localLocation)]

packages we want to add on top of this snapshot

-> Map PackageName (Map FlagName Bool)


-> Map PackageName Bool

overrides whether a package should be registered hidden

-> Map PackageName [Text]

GHC options

-> Set PackageName

packages in the snapshot to drop

-> RIO env (Map PackageName (LoadedPackageInfo GhcPkgId), Map PackageName (LoadedPackageInfo SinglePackageLocation), Map PackageName (LoadedPackageInfo (SinglePackageLocation, Maybe localLocation))) 

Given information on a LoadedSnapshot and a given set of additional packages and configuration values, calculates the new global and snapshot packages, as well as the new local packages.

The new globals and snapshots must be a subset of the initial values.