1- {-# LANGUAGE RecordWildCards #-}
2-
31-- | cabal-install CLI command: build
42module Distribution.Client.CmdBuild
53 ( -- * The @build@ CLI and action
@@ -30,6 +28,7 @@ import qualified Data.Map as Map
3028import Distribution.Client.Errors
3129import Distribution.Client.NixStyleOptions
3230 ( NixStyleFlags (.. )
31+ , cfgVerbosity
3332 , defaultNixStyleFlags
3433 , nixStyleOptions
3534 )
@@ -40,17 +39,15 @@ import Distribution.Client.ScriptUtils
4039 , withContextAndSelectors
4140 )
4241import Distribution.Client.Setup
43- ( CommonSetupFlags (.. )
44- , ConfigFlags (.. )
45- , GlobalFlags
42+ ( GlobalFlags
4643 , yesNoOpt
4744 )
4845import Distribution.Simple.Command
4946 ( CommandUI (.. )
5047 , option
5148 , usageAlternatives
5249 )
53- import Distribution.Simple.Flag (Flag , fromFlag , fromFlagOrDefault , toFlag )
50+ import Distribution.Simple.Flag (Flag , fromFlag , toFlag )
5451import Distribution.Simple.Utils
5552 ( dieWithException
5653 , wrapText
@@ -134,8 +131,8 @@ defaultBuildFlags =
134131-- For more details on how this works, see the module
135132-- "Distribution.Client.ProjectOrchestration"
136133buildAction :: NixStyleFlags BuildFlags -> [String ] -> GlobalFlags -> IO ()
137- buildAction flags@ NixStyleFlags {extraFlags = buildFlags, .. } targetStrings globalFlags =
138- withContextAndSelectors RejectNoTargets Nothing flags targetStrings globalFlags BuildCommand $ \ targetCtx ctx targetSelectors -> do
134+ buildAction flags@ NixStyleFlags {extraFlags = buildFlags} targetStrings globalFlags =
135+ withContextAndSelectors verbosity RejectNoTargets Nothing flags targetStrings globalFlags BuildCommand $ \ targetCtx ctx targetSelectors -> do
139136 -- TODO: This flags defaults business is ugly
140137 let onlyConfigure =
141138 fromFlag
@@ -185,7 +182,7 @@ buildAction flags@NixStyleFlags{extraFlags = buildFlags, ..} targetStrings globa
185182 buildOutcomes <- runProjectBuildPhase verbosity baseCtx buildCtx
186183 runProjectPostBuildPhase verbosity baseCtx buildCtx buildOutcomes
187184 where
188- verbosity = fromFlagOrDefault normal (setupVerbosity $ configCommonFlags configFlags)
185+ verbosity = cfgVerbosity normal flags
189186
190187-- | This defines what a 'TargetSelector' means for the @bench@ command.
191188-- It selects the 'AvailableTarget's that the 'TargetSelector' refers to,
0 commit comments