stack-1.0.4.3: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.BuildPlan

Description

Resolving a build plan for a set of packages in a given Stackage snapshot.

Synopsis

Documentation

checkSnapBuildPlan :: (MonadIO m, MonadCatch m, MonadLogger m, MonadReader env m, HasHttpManager env, HasConfig env, HasGHCVariant env, MonadBaseControl IO m) => [GenericPackageDescription] -> Maybe (Map PackageName (Map FlagName Bool)) -> SnapName -> m BuildPlanCheck Source

Check a set of GenericPackageDescriptions and a set of flags against a given snapshot. Returns how well the snapshot satisfies the dependencies of the packages.

data MiniPackageInfo Source

Information on a single package for the MiniBuildPlan.

Constructors

MiniPackageInfo 

Fields

mpiVersion :: !Version
 
mpiFlags :: !(Map FlagName Bool)
 
mpiPackageDeps :: !(Set PackageName)
 
mpiToolDeps :: !(Set Text)

Due to ambiguity in Cabal, it is unclear whether this refers to the executable name, the package name, or something else. We have to guess based on what's available, which is why we store this is an unwrapped Text.

mpiExes :: !(Set ExeName)

Executables provided by this package

mpiHasLibrary :: !Bool

Is there a library present?

resolveBuildPlan Source

Arguments

:: (MonadThrow m, MonadIO m, MonadReader env m, HasBuildConfig env, MonadLogger m, HasHttpManager env, MonadBaseControl IO m, MonadCatch m) 
=> MiniBuildPlan 
-> (PackageName -> Bool)

is it shadowed by a local package?

-> Map PackageName (Set PackageName)

required packages, and users of it

-> m (Map PackageName (Version, Map FlagName Bool), Map PackageName (Set PackageName)) 

Determine the necessary packages to install to have the given set of packages available.

This function will not provide test suite and benchmark dependencies.

This may fail if a target package is not present in the BuildPlan.

selectBestSnapshot :: (MonadIO m, MonadCatch m, MonadLogger m, MonadReader env m, HasHttpManager env, HasConfig env, HasGHCVariant env, MonadBaseControl IO m) => [GenericPackageDescription] -> [SnapName] -> m (SnapName, BuildPlanCheck) Source

Find a snapshot and set of flags that is compatible with and matches as best as possible with the given GenericPackageDescriptions. Returns Nothing if no such snapshot is found.

type ToolMap = Map ByteString (Set PackageName) Source

Look up with packages provide which tools.

getToolMap :: MiniBuildPlan -> Map Text (Set PackageName) Source

Map from tool name to package providing it

showItems :: Show a => [a] -> Text Source

parseCustomMiniBuildPlan Source

Arguments

:: (MonadIO m, MonadCatch m, MonadLogger m, MonadReader env m, HasHttpManager env, HasConfig env, MonadBaseControl IO m) 
=> Path Abs File

stack.yaml file location

-> Text 
-> m MiniBuildPlan