Safe Haskell | None |
---|---|
Language | Haskell2010 |
Dealing with Cabal.
- readPackageDir :: forall env. HasConfig env => PackageConfig -> Path Abs Dir -> Bool -> RIO env (Package, Path Abs File)
- readPackageUnresolvedDir :: forall env. HasConfig env => Path Abs Dir -> Bool -> RIO env (GenericPackageDescription, Path Abs File)
- readPackageUnresolvedIndex :: forall env. HasRunner env => (PackageIdentifierRevision -> IO ByteString) -> PackageIdentifierRevision -> RIO env GenericPackageDescription
- readPackageDescriptionDir :: forall env. HasConfig env => PackageConfig -> Path Abs Dir -> Bool -> RIO env (GenericPackageDescription, PackageDescriptionPair)
- readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo
- resolvePackage :: PackageConfig -> GenericPackageDescription -> Package
- packageFromPackageDescription :: PackageConfig -> [Flag] -> PackageDescriptionPair -> Package
- data Package = Package {
- packageName :: !PackageName
- packageVersion :: !Version
- packageLicense :: !License
- packageFiles :: !GetPackageFiles
- packageDeps :: !(Map PackageName VersionRange)
- packageTools :: !(Map ExeName VersionRange)
- packageAllDeps :: !(Set PackageName)
- packageGhcOptions :: ![Text]
- packageFlags :: !(Map FlagName Bool)
- packageDefaultFlags :: !(Map FlagName Bool)
- packageLibraries :: !PackageLibraries
- packageTests :: !(Map Text TestSuiteInterface)
- packageBenchmarks :: !(Set Text)
- packageExes :: !(Set Text)
- packageOpts :: !GetPackageOpts
- packageHasExposedModules :: !Bool
- packageBuildType :: !(Maybe BuildType)
- packageSetupDeps :: !(Maybe (Map PackageName VersionRange))
- data PackageDescriptionPair = PackageDescriptionPair {}
- newtype GetPackageFiles = GetPackageFiles {
- getPackageFiles :: forall env. HasEnvConfig env => Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])
- newtype GetPackageOpts = GetPackageOpts {
- getPackageOpts :: forall env. HasEnvConfig env => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)
- data PackageConfig = PackageConfig {}
- buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File)
- data PackageException
- = PackageInvalidCabalFile (Either PackageIdentifierRevision (Path Abs File)) PError
- | PackageNoCabalFileFound (Path Abs Dir)
- | PackageMultipleCabalFilesFound (Path Abs Dir) [Path Abs File]
- | MismatchedCabalName (Path Abs File) PackageName
- | MismatchedCabalIdentifier !PackageIdentifierRevision !PackageIdentifier
- resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescriptionPair
- packageDescTools :: PackageDescription -> Map ExeName VersionRange
- packageDependencies :: PackageDescription -> Map PackageName VersionRange
- autogenDir :: Path Abs Dir -> Path Abs Dir
- cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier
- gpdPackageIdentifier :: GenericPackageDescription -> PackageIdentifier
- gpdPackageName :: GenericPackageDescription -> PackageName
- gpdVersion :: GenericPackageDescription -> Version
Documentation
:: HasConfig env | |
=> PackageConfig | |
-> Path Abs Dir | |
-> Bool | print warnings from cabal file parsing? |
-> RIO env (Package, Path Abs File) |
Reads and exposes the package information
readPackageUnresolvedDir Source #
:: HasConfig env | |
=> Path Abs Dir | directory holding the cabal file |
-> Bool | print warnings? |
-> RIO env (GenericPackageDescription, Path Abs File) |
Read the raw, unresolved package information from a file.
readPackageUnresolvedIndex Source #
:: HasRunner env | |
=> (PackageIdentifierRevision -> IO ByteString) | load the raw bytes |
-> PackageIdentifierRevision | |
-> RIO env GenericPackageDescription |
Read the GenericPackageDescription
from the given
PackageIdentifierRevision
.
readPackageDescriptionDir Source #
:: HasConfig env | |
=> PackageConfig | |
-> Path Abs Dir | |
-> Bool | print warnings? |
-> RIO env (GenericPackageDescription, PackageDescriptionPair) |
Get GenericPackageDescription
and PackageDescription
reading info
from given directory.
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 -> [Flag] -> 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.
MSS 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 GetPackageFiles Source #
Files that the package depends on, relative to package directory. Argument is the location of the .cabal file
GetPackageFiles | |
|
newtype GetPackageOpts Source #
Files that the package depends on, relative to package directory. Argument is the location of the .cabal file
GetPackageOpts | |
|
data PackageConfig Source #
Package build configuration
PackageConfig | |
|
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 #
All exceptions thrown by the library.
resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescriptionPair Source #
Evaluates the conditions of a GenericPackageDescription
, yielding
a resolved PackageDescription
.
packageDescTools :: PackageDescription -> Map ExeName VersionRange Source #
Get all dependencies of the package (buildable targets only).
This uses both the new buildToolDepends
and old buildTools
information.
packageDependencies :: PackageDescription -> Map PackageName VersionRange Source #
Get all dependencies of the package (buildable targets only).
cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier Source #
Extract the PackageIdentifier
given an exploded haskell package
path.