Commit b861044f authored by Mikhail Glushenkov's avatar Mikhail Glushenkov Committed by GitHub
Browse files

Merge pull request #4077 from 23Skidoo/new-configure-more-correct-plan-subset

new-configure: Select the same plan subset as new-build.
parents 3be1b3a0 46d1b0c2
{-# LANGUAGE NamedFieldPuns #-}
-- | cabal-install CLI command: build
--
module Distribution.Client.CmdBuild (
......@@ -72,7 +70,7 @@ buildAction (configFlags, configExFlags, installFlags, haddockFlags)
PreBuildHooks {
hookPrePlanning = \_ _ _ -> return (),
hookSelectPlanSubset = \buildSettings elaboratedPlan -> do
hookSelectPlanSubset = \buildSettings' elaboratedPlan -> do
-- Interpret the targets on the command line as build targets
-- (as opposed to say repl or haddock targets).
selectTargets
......@@ -80,7 +78,7 @@ buildAction (configFlags, configExFlags, installFlags, haddockFlags)
BuildDefaultComponents
BuildSpecificComponent
userTargets
(buildSettingOnlyDeps buildSettings)
(buildSettingOnlyDeps buildSettings')
elaboratedPlan
}
......@@ -90,4 +88,3 @@ buildAction (configFlags, configExFlags, installFlags, haddockFlags)
runProjectPostBuildPhase verbosity buildCtx buildOutcomes
where
verbosity = fromFlagOrDefault normal (configVerbosity configFlags)
......@@ -7,6 +7,8 @@ module Distribution.Client.CmdConfigure (
import Distribution.Client.ProjectOrchestration
import Distribution.Client.ProjectConfig
import Distribution.Client.ProjectPlanning
( PackageTarget(..) )
import Distribution.Client.Setup
( GlobalFlags, ConfigFlags(..), ConfigExFlags, InstallFlags )
......@@ -21,7 +23,8 @@ import Distribution.Simple.Utils
( wrapText )
import qualified Distribution.Client.Setup as Client
configureCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags)
configureCommand :: CommandUI (ConfigFlags, ConfigExFlags
,InstallFlags, HaddockFlags)
configureCommand = Client.installCommand {
commandName = "new-configure",
commandSynopsis = "Write out a cabal.project.local file.",
......@@ -29,7 +32,8 @@ configureCommand = Client.installCommand {
commandDescription = Just $ \_ -> wrapText $
"Configures a Nix-local build project, downloading source from"
++ " the network and writing out a cabal.project.local file which"
++ " saves any FLAGS, to be reapplied on subsequent invocations to new-build.",
++ " saves any FLAGS, to be reapplied on subsequent invocations to "
++ "new-build.",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-configure "
......@@ -63,7 +67,18 @@ configureAction (configFlags, configExFlags, installFlags, haddockFlags)
-- planning phase.
writeProjectLocalExtraConfig rootDir cliConfig,
hookSelectPlanSubset = \_ -> return
hookSelectPlanSubset = \buildSettings' elaboratedPlan -> do
-- Select the same subset of targets as 'CmdBuild' would
-- pick (ignoring, for example, executables in libraries
-- we depend on).
selectTargets
verbosity
BuildDefaultComponents
BuildSpecificComponent
[]
(buildSettingOnlyDeps buildSettings')
elaboratedPlan
}
let buildCtx' = buildCtx {
......@@ -72,10 +87,11 @@ configureAction (configFlags, configExFlags, installFlags, haddockFlags)
}
}
--TODO: Hmm, but we don't have any targets. Currently this prints what we
-- would build if we were to build everything. Could pick implicit target like "."
--TODO: should we say what's in the project (+deps) as a whole?
-- TODO: Hmm, but we don't have any targets. Currently this prints
-- what we would build if we were to build everything. Could pick
-- implicit target like "."
--
-- TODO: should we say what's in the project (+deps) as a whole?
printPlan verbosity buildCtx'
where
verbosity = fromFlagOrDefault normal (configVerbosity configFlags)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment