Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module implements the parsing of the two file formats supported
by build-env
:
- SEED files, containing a list of seed units from which to compute
a build plan. See
parseSeedFile
. cabal.config
files containing version constraints on packages. SeeparseCabalDotConfigPkgs
.
Synopsis
- parseCabalDotConfigPkgs :: FilePath -> IO PkgSpecs
- parseSeedFile :: FilePath -> IO (UnitSpecs, AllowNewer)
Documentation
parseCabalDotConfigPkgs :: FilePath -> IO PkgSpecs Source #
Parse constrained packages from the constraints
stanza
of the cabal.config
file at the given filepath:
constraints: pkg1 ==ver1, pkg2 ==ver2, ...
This function disregards all other contents of the cabal.config
package.
parseSeedFile :: FilePath -> IO (UnitSpecs, AllowNewer) Source #
Parse a seed file. Each line must either be:
- A Cabal unit, in the format
unit +flag1 -flag2 >= 0.1 && < 0.3
.
A unit can be of the form pkgName
, lib:pkgName
, exe:pkgName
,
pkgName:lib:compName
, ... as per Cabal component syntax.
The unit name must be followed by a space.
Flags and constraints are optional. When both are present, flags must precede constraints. Constraints must use valid Cabal constraint syntax.
- An allow-newer specification, e.g.
allow-newer: pkg1:pkg2,*:base,...
. This is not allowed to span multiple lines.
Returns (units, allowNewer)
.