HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleCabal-3.12.1.0Haskell2010

Distribution.Simple.LocalBuildInfo

Once a package has been configured we have resolved conditionals and dependencies, configured the compiler and other needed external programs. The LocalBuildInfo is used to hold all this information. It holds the install dirs, the compiler, the exact package dependencies, the configured programs, the package database to use and a bunch of miscellaneous configure flags. It gets saved and reloaded from a file (dist/setup-config). It gets passed in to very many subsequent build actions.

  • 11 types
  • 83 values
  • PackageCabal-3.12.1.0
  • Exports99
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceLocalBuildInfo.hs
datadata LocalBuildInfo
#

Data cached after configuration step. See also ConfigFlags.

Constructors

Instances6Read, Show, Generic, Binary, Structured, Rep

This pattern synonym is for backwards compatibility, to adapt to LocalBuildInfo being split into LocalBuildDescr and LocalBuildConfig.

Convenience accessors

4 declarations

Buildable package components

30 declarations
datadata Component
#
Instances9Eq, Read, Show, Generic, Semigroup, Binary, …
datadata ComponentName
#

Constructors

Instances10Eq, Ord, Read, Show, Generic, Binary, …
datadata LibraryName
#
Instances10Eq, Data, Ord, Read, Show, Generic, …

The first five fields are common across all algebraic variants.

Constructors

Instances8Read, Show, Generic, Binary, Structured, IsNode, …

Is a component buildable (i.e., not marked with buildable: False)? See also this note in Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components.

valuedepLibraryPaths
  1. :: Bool

    Building for inplace?

  2. -> Bool

    Generate prefix-relative library paths

  3. -> LocalBuildInfo
  4. -> ComponentLocalBuildInfo

    Component that is being built

  5. -> IO [FilePath]
#

Determine the directories containing the dynamic libraries of the transitive dependencies of the component we are building.

When wanted, and possible, returns paths relative to the installDirs prefix

Installation directories

25 declarations
datadata InstallDirs dir
#

The directories where we will install files for packages.

We have several different directories for different types of files since many systems have conventions whereby different types of files in a package are installed in different directories. This is particularly the case on Unix style systems.

Constructors

Instances10Functor, Eq, Read, Show, Generic, Semigroup, …
datadata CopyDest
#

The location prefix for the copy command.

Constructors

Instances6Eq, Show, Generic, Binary, Structured, Rep
newtypenewtype PathTemplate
#

An abstract path, possibly containing variables that need to be substituted for to get a real FilePath.

Instances8Eq, Ord, Read, Show, Generic, Binary, …

The installation directories in terms of PathTemplates that contain variables.

The defaults for most of the directories are relative to each other, in particular they are all relative to a single prefix. This makes it convenient for the user to override the default installation directory by only having to specify --prefix=... rather than overriding each individually. This is done by allowing $-style variables in the dirs. These are expanded by textual substitution (see substPathTemplate).

A few of these installation directories are split into two components, the dir and subdir. The full installation path is formed by combining the two together with /. The reason for this is compatibility with other Unix build systems which also support --libdir and --datadir. We would like users to be able to configure --libdir=/usr/lib64 for example but because by default we want to support installing multiple versions of packages and building the same package for multiple compilers we append the libsubdir to get: /usr/lib64/$libname/$compiler.

An additional complication is the need to support relocatable packages on systems which support such things, like Windows.

datadata PathTemplateVariable
#

Constructors

Instances8Eq, Ord, Read, Show, Generic, Binary, …

Substitute the install dir templates into each other.

To prevent cyclic substitutions, only some variables are allowed in particular dir templates. If out of scope vars are present, they are not substituted for. Checking for any remaining unsubstituted vars can be done as a subsequent operation.

The reason it is done this way is so that in prefixRelativeInstallDirs we can replace prefix with the PrefixVar and get resulting PathTemplates that still have the PrefixVar in them. Doing this makes it each to check which paths are relative to the $prefix.