cabal-install-3.10.2.1: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Client.CmdBuild

Contents

- The `build` CLI and action
- Internals exposed for testing

Description

cabal-install CLI command: build

Synopsis

- buildCommand :: CommandUI (NixStyleFlags BuildFlags)
- buildAction :: NixStyleFlags BuildFlags -> [String] -> GlobalFlags -> IO ()
- data BuildFlags = BuildFlags {
  - buildOnlyConfigure :: Flag Bool
  }
- defaultBuildFlags :: BuildFlags
- selectPackageTargets :: TargetSelector -> [AvailableTarget k] -> Either TargetProblem' [k]
- selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either TargetProblem' k

# The `build` CLI and action

buildCommand :: CommandUI (NixStyleFlags BuildFlags) #

buildAction :: NixStyleFlags BuildFlags -> [String] -> GlobalFlags -> IO () #

The `build` command does a lot. It brings the install plan up to date, selects that part of the plan needed by the given or implicit targets and then executes the plan.

For more details on how this works, see the module Distribution.Client.ProjectOrchestration

data BuildFlags #

Constructors

BuildFlags |

Fields

- buildOnlyConfigure :: Flag Bool

defaultBuildFlags :: BuildFlags #

# Internals exposed for testing

selectPackageTargets :: TargetSelector -> [AvailableTarget k] -> Either TargetProblem' [k] #

This defines what a `TargetSelector` means for the `bench` command. It selects the `AvailableTarget`s that the `TargetSelector` refers to, or otherwise classifies the problem.

For the `build` command select all components except non-buildable and disabled tests/benchmarks, fail if there are no such components

selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either TargetProblem' k #

For a `TargetComponent` `TargetSelector`, check if the component can be selected.

For the `build` command we just need the basic checks on being buildable etc.