cabal-install-3.8.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellNone
LanguageHaskell2010

Distribution.Client.CmdInstall

Description

cabal-install CLI command: build

Synopsis

The build CLI and action

installAction :: NixStyleFlags ClientInstallFlags -> [String] -> GlobalFlags -> IO () Source #

The install command actually serves four different needs. It installs: * exes: For example a program from hackage. The behavior is similar to the old install command, except that now conflicts between separate runs of the command are impossible thanks to the store. Exes are installed in the store like a normal dependency, then they are symlinked/copied in the directory specified by --installdir. To do this we need a dummy projectBaseContext containing the targets as extra packages and using a temporary dist directory. * libraries Libraries install through a similar process, but using GHC environment files instead of symlinks. This means that 'v2-install'ing libraries only works on GHC >= 8.0.

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

Internals exposed for testing

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

This defines what a TargetSelector means for the bench command. It selects the AvailableTargets 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 Source #

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.

Internals exposed for CmdRepl + CmdRun

establishDummyProjectBaseContext Source #

Arguments

:: Verbosity 
-> ProjectConfig

Project configuration including the global config if needed

-> DistDirLayout

Where to put the dist directory

-> [PackageSpecifier UnresolvedSourcePackage]

The packages to be included in the project

-> CurrentCommand 
-> IO ProjectBaseContext 

Create a dummy project context, without a .cabal or a .cabal.project file (a place where to put a temporary dist directory is still needed)