HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecabal-install-3.12.1.0Haskell2010

Distribution.Client.ProjectConfig

Handling project configuration.

  • 17 types
  • 21 values

Types for project config

8 declarations
datadata ProjectConfig
#

This type corresponds directly to what can be written in the cabal.project file. Other sources of configuration can also be injected into this type, such as the user-wide config file and the command line of cabal configure or cabal build.

Since it corresponds to the external project file it is an instance of Monoid and all the fields can be empty. This also means there has to be a step where we resolve configuration. At a minimum resolving means applying defaults but it can also mean merging information from multiple sources. For example for package-specific configuration the project file can specify configuration that applies to all local packages, and then additional configuration for a specific package.

Future directions: multiple profiles, conditionals. If we add these features then the gap between configuration as written in the config file and resolved settings we actually use will become even bigger.

Constructors

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …
newtypenewtype ProjectConfigToParse
#

The project configuration is configuration that is parsed but parse configuration may import more configuration. Holds the unparsed contents of an imported file contributing to the project config.

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …
datadata ProjectConfigShared
#

Project configuration that is shared between all packages in the project. In particular this includes configuration that affects the solver.

Constructors

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …

Specifies the provenance of project configuration, whether defaults were used or if the configuration was read from an explicit file path.

Constructors

Instances7Eq, Ord, Show, Generic, Binary, Structured, …
datadata PackageConfig
#

Project configuration that is specific to each package, that is where we can in principle have different values for different packages in the same project.

Constructors

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …
newtypenewtype MapLast k v
#

Newtype wrapper for Map that provides a Monoid instance that takes the last value rather than the first value for overlapping keys.

Constructors

Instances9Functor, Eq, Show, Generic, Semigroup, Monoid, …
newtypenewtype MapMappend k v
#

Newtype wrapper for Map that provides a Monoid instance that mappends values of overlapping keys rather than taking the first.

Constructors

Instances9Functor, Eq, Show, Generic, Semigroup, Monoid, …

Project root

3 declarations
valuefindProjectRoot
  1. :: Verbosity
  2. -> Maybe FilePath

    Explicit project directory

  3. -> Maybe FilePath

    Explicit project file

  4. -> IO (Either BadProjectRoot ProjectRoot)
#

Find the root of this project.

The project directory will be one of the following: 1. mprojectDir when present 2. The first directory containing mprojectFile/cabal.project, starting from the current directory and recursively checking parent directories 3. The current directory

datadata ProjectRoot
#

Information about the root directory of the project.

It can either be an implicit project root in the current dir if no cabal.project file is found, or an explicit root if either the file is found or the project root directory was specicied.

Constructors

Instances2Eq, Show
  • Eq ProjectRootDefined in cabal-install-3.12.1.0 · Distribution.Client.DistDirLayout
  • Show ProjectRootDefined in cabal-install-3.12.1.0 · Distribution.Client.DistDirLayout

Project config files

12 declarations

Packages within projects

6 declarations

The location of a package as part of a project. Local file paths are either absolute (if the user specified it as such) or they are relative to the project root.

Instances1Show

Resolving configuration

7 declarations
datadata SolverSettings
#
Instances6Eq, Show, Generic, Binary, Structured, Rep
datadata BuildTimeSettings
#

Resolved configuration for things that affect how we build and not the value of the things we build. The idea is that this is easier to use than the raw configuration because in the raw configuration everything is optional (monoidial). In the BuildTimeSettings every field is filled in, if only with the defaults.

Use resolveBuildTimeSettings to make one from the project config (by applying defaults etc).

Checking configuration

2 declarations