build-env-1.1.0.0: Compute, fetch and install Cabal build plans into a local environment
Safe HaskellSafe-Inferred
LanguageHaskell2010

BuildEnv.File

Description

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. See parseCabalDotConfigPkgs.
Synopsis

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).