stack-1.3.0: 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 :: (StackM env m, HasConfig env, HasGHCVariant env) => [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)
 
mpiGhcOptions :: ![Text]
 
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?

mpiGitSHA1 :: !(Maybe GitSHA1)

An optional SHA1 representation in hex format of the blob containing the cabal file contents. Useful for grabbing the correct cabal file revision directly from a Git repo

loadMiniBuildPlan :: (StackMiniM env m, HasConfig env, HasGHCVariant env) => SnapName -> m MiniBuildPlan Source

Load up a MiniBuildPlan, preferably from cache

resolveBuildPlan Source

Arguments

:: (StackMiniM env m, HasBuildConfig env) 
=> 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 :: (StackM env m, HasConfig env, HasGHCVariant env) => [GenericPackageDescription] -> NonEmpty 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.

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

Map from tool name to package providing it

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

parseCustomMiniBuildPlan Source

Arguments

:: (StackMiniM env m, HasConfig env, HasGHCVariant env) 
=> Maybe (Path Abs File)

Root directory for when url is a filepath

-> Text 
-> m (MiniBuildPlan, SnapshotHash)