Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Dealing with Cabal.
Synopsis
- readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo
- resolvePackage :: PackageConfig -> GenericPackageDescription -> Package
- packageFromPackageDescription :: PackageConfig -> [PackageFlag] -> PackageDescriptionPair -> Package
- data Package = Package {
- packageName :: !PackageName
- packageVersion :: !Version
- packageLicense :: !(Either License License)
- packageFiles :: !GetPackageFiles
- packageDeps :: !(Map PackageName DepValue)
- packageUnknownTools :: !(Set ExeName)
- packageAllDeps :: !(Set PackageName)
- packageSubLibDeps :: !(Map MungedPackageName DepValue)
- packageGhcOptions :: ![Text]
- packageCabalConfigOpts :: ![Text]
- packageFlags :: !(Map FlagName Bool)
- packageDefaultFlags :: !(Map FlagName Bool)
- packageLibraries :: !PackageLibraries
- packageInternalLibraries :: !(Set Text)
- packageTests :: !(Map Text TestSuiteInterface)
- packageBenchmarks :: !(Set Text)
- packageExes :: !(Set Text)
- packageOpts :: !GetPackageOpts
- packageHasExposedModules :: !Bool
- packageBuildType :: !BuildType
- packageSetupDeps :: !(Maybe (Map PackageName VersionRange))
- packageCabalSpec :: !CabalSpecVersion
- data PackageDescriptionPair = PackageDescriptionPair {}
- newtype GetPackageOpts = GetPackageOpts {
- getPackageOpts :: forall env. HasEnvConfig env => InstallMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> RIO env (Map NamedComponent (Map ModuleName (Path Abs File)), Map NamedComponent [DotCabalPath], Map NamedComponent BuildInfoOpts)
- data PackageConfig = PackageConfig {}
- buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File)
- data PackageException
- resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescriptionPair
- packageDependencies :: PackageDescription -> Map PackageName VersionRange
- applyForceCustomBuild :: Version -> Package -> Package
Documentation
readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo Source #
Read package.buildinfo
ancillary files produced by some Setup.hs hooks.
The file includes Cabal file syntax to be merged into the package description
derived from the package's Cabal file.
NOTE: not to be confused with BuildInfo, an Stack-internal datatype.
packageFromPackageDescription :: PackageConfig -> [PackageFlag] -> PackageDescriptionPair -> Package Source #
Some package info.
Package | |
|
data PackageDescriptionPair Source #
A pair of package descriptions: one which modified the buildable values of test suites and benchmarks depending on whether they are enabled, and one which does not.
Fields are intentionally lazy, we may only need one or the other value.
Michael S Snoyman 2017-08-29: The very presence of this data type is terribly ugly, it represents the fact that the Cabal 2.0 upgrade did _not_ go well. Specifically, we used to have a field to indicate whether a component was enabled in addition to buildable, but that's gone now, and this is an ugly proxy. We should at some point clean up the mess of Package, LocalPackage, etc, and probably pull in the definition of PackageDescription from Cabal with our additionally needed metadata. But this is a good enough hack for the moment. Odds are, you're reading this in the year 2024 and thinking "wtf?"
newtype GetPackageOpts Source #
Files that the package depends on, relative to package directory. Argument is the location of the Cabal file
GetPackageOpts | |
|
Instances
Show GetPackageOpts Source # | |
Defined in Stack.Types.Package showsPrec :: Int -> GetPackageOpts -> ShowS # show :: GetPackageOpts -> String # showList :: [GetPackageOpts] -> ShowS # |
data PackageConfig Source #
Package build configuration
PackageConfig | |
|
Instances
Show PackageConfig Source # | |
Defined in Stack.Types.Package showsPrec :: Int -> PackageConfig -> ShowS # show :: PackageConfig -> String # showList :: [PackageConfig] -> ShowS # |
buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File) Source #
Path for the package's build log.
data PackageException Source #
Type representing exceptions thrown by functions exported by the Stack.Package module.
Instances
Exception PackageException Source # | |
Defined in Stack.Types.Package | |
Show PackageException Source # | |
Defined in Stack.Types.Package showsPrec :: Int -> PackageException -> ShowS # show :: PackageException -> String # showList :: [PackageException] -> ShowS # |
resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescriptionPair Source #
Evaluates the conditions of a GenericPackageDescription
, yielding
a resolved PackageDescription
.
packageDependencies :: PackageDescription -> Map PackageName VersionRange Source #
Get all dependencies of the package (buildable targets only).
applyForceCustomBuild Source #
Force a package to be treated as a custom build type, see https://github.com/commercialhaskell/stack/issues/4488