Skip to content

Switch the defaults to 'v2' commands. #5800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cabal-install/Distribution/Client/CmdBench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import Control.Monad (when)

benchCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags)
benchCommand = Client.installCommand {
commandName = "new-bench",
commandName = "v2-bench",
commandSynopsis = "Run benchmarks",
commandUsage = usageAlternatives "new-bench" [ "[TARGETS] [FLAGS]" ],
commandUsage = usageAlternatives "v2-bench" [ "[TARGETS] [FLAGS]" ],
commandDescription = Just $ \_ -> wrapText $
"Runs the specified benchmarks, first ensuring they are up to "
++ "date.\n\n"
Expand All @@ -53,13 +53,13 @@ benchCommand = Client.installCommand {
++ "'cabal.project.local' and other files.",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-bench\n"
++ " " ++ pname ++ " v2-bench\n"
++ " Run all the benchmarks in the package in the current directory\n"
++ " " ++ pname ++ " new-bench pkgname\n"
++ " " ++ pname ++ " v2-bench pkgname\n"
++ " Run all the benchmarks in the package named pkgname\n"
++ " " ++ pname ++ " new-bench cname\n"
++ " " ++ pname ++ " v2-bench cname\n"
++ " Run the benchmark named cname\n"
++ " " ++ pname ++ " new-bench cname -O2\n"
++ " " ++ pname ++ " v2-bench cname -O2\n"
++ " Run the benchmark built with '-O2' (including local libs used)\n\n"

++ cmdCommonHelpTextNewBuildBeta
Expand Down
14 changes: 7 additions & 7 deletions cabal-install/Distribution/Client/CmdBuild.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ buildCommand ::
(BuildFlags, ( ConfigFlags, ConfigExFlags
, InstallFlags, HaddockFlags, TestFlags))
buildCommand = CommandUI {
commandName = "new-build",
commandName = "v2-build",
commandSynopsis = "Compile targets within the project.",
commandUsage = usageAlternatives "new-build" [ "[TARGETS] [FLAGS]" ],
commandUsage = usageAlternatives "v2-build" [ "[TARGETS] [FLAGS]" ],
commandDescription = Just $ \_ -> wrapText $
"Build one or more targets from within the project. The available "
++ "targets are the packages in the project as well as individual "
Expand All @@ -54,16 +54,16 @@ buildCommand = CommandUI {
++ "'cabal.project.local' and other files.",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-build\n"
++ " " ++ pname ++ " v2-build\n"
++ " Build the package in the current directory "
++ "or all packages in the project\n"
++ " " ++ pname ++ " new-build pkgname\n"
++ " " ++ pname ++ " v2-build pkgname\n"
++ " Build the package named pkgname in the project\n"
++ " " ++ pname ++ " new-build ./pkgfoo\n"
++ " " ++ pname ++ " v2-build ./pkgfoo\n"
++ " Build the package in the ./pkgfoo directory\n"
++ " " ++ pname ++ " new-build cname\n"
++ " " ++ pname ++ " v2-build cname\n"
++ " Build the component named cname in the project\n"
++ " " ++ pname ++ " new-build cname --enable-profiling\n"
++ " " ++ pname ++ " v2-build cname --enable-profiling\n"
++ " Build the component in profiling mode "
++ "(including dependencies as needed)\n\n"

Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/CmdClean.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defaultCleanFlags = CleanFlags

cleanCommand :: CommandUI CleanFlags
cleanCommand = CommandUI
{ commandName = "new-clean"
{ commandName = "v2-clean"
, commandSynopsis = "Clean the package store and remove temporary files."
, commandUsage = \pname ->
"Usage: " ++ pname ++ " new-clean [FLAGS]\n"
Expand Down
20 changes: 10 additions & 10 deletions cabal-install/Distribution/Client/CmdConfigure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import qualified Distribution.Client.Setup as Client
configureCommand :: CommandUI (ConfigFlags, ConfigExFlags
,InstallFlags, HaddockFlags, TestFlags)
configureCommand = Client.installCommand {
commandName = "new-configure",
commandName = "v2-configure",
commandSynopsis = "Add extra project configuration",
commandUsage = usageAlternatives "new-configure" [ "[FLAGS]" ],
commandUsage = usageAlternatives "v2-configure" [ "[FLAGS]" ],
commandDescription = Just $ \_ -> wrapText $
"Adjust how the project is built by setting additional package flags "
++ "and other flags.\n\n"
Expand All @@ -40,28 +40,28 @@ configureCommand = Client.installCommand {
++ "file (or '$project_file.local', if '--project-file' is specified) "
++ "which extends the configuration from the 'cabal.project' file "
++ "(if any). This combination is used as the project configuration for "
++ "all other commands (such as 'new-build', 'new-repl' etc) though it "
++ "all other commands (such as 'v2-build', 'v2-repl' etc) though it "
++ "can be extended/overridden on a per-command basis.\n\n"

++ "The new-configure command also checks that the project configuration "
++ "The v2-configure command also checks that the project configuration "
++ "will work. In particular it checks that there is a consistent set of "
++ "dependencies for the project as a whole.\n\n"

++ "The 'cabal.project.local' file persists across 'new-clean' but is "
++ "overwritten on the next use of the 'new-configure' command. The "
++ "The 'cabal.project.local' file persists across 'v2-clean' but is "
++ "overwritten on the next use of the 'v2-configure' command. The "
++ "intention is that the 'cabal.project' file should be kept in source "
++ "control but the 'cabal.project.local' should not.\n\n"

++ "It is never necessary to use the 'new-configure' command. It is "
++ "It is never necessary to use the 'v2-configure' command. It is "
++ "merely a convenience in cases where you do not want to specify flags "
++ "to 'new-build' (and other commands) every time and yet do not want "
++ "to 'v2-build' (and other commands) every time and yet do not want "
++ "to alter the 'cabal.project' persistently.",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-configure --with-compiler ghc-7.10.3\n"
++ " " ++ pname ++ " v2-configure --with-compiler ghc-7.10.3\n"
++ " Adjust the project configuration to use the given compiler\n"
++ " program and check the resulting configuration works.\n"
++ " " ++ pname ++ " new-configure\n"
++ " " ++ pname ++ " v2-configure\n"
++ " Reset the local configuration to empty and check the overall\n"
++ " project configuration works.\n\n"

Expand Down
10 changes: 5 additions & 5 deletions cabal-install/Distribution/Client/CmdExec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-- Maintainer : [email protected]
-- Portability : portable
--
-- Implementation of the 'new-exec' command for running an arbitrary executable
-- Implementation of the 'v2-exec' command for running an arbitrary executable
-- in an environment suited to the part of the store built for a project.
-------------------------------------------------------------------------------

Expand Down Expand Up @@ -97,22 +97,22 @@ import qualified Data.Map as M

execCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags)
execCommand = CommandUI
{ commandName = "new-exec"
{ commandName = "v2-exec"
, commandSynopsis = "Give a command access to the store."
, commandUsage = \pname ->
"Usage: " ++ pname ++ " new-exec [FLAGS] [--] COMMAND [--] [ARGS]\n"
"Usage: " ++ pname ++ " v2-exec [FLAGS] [--] COMMAND [--] [ARGS]\n"
, commandDescription = Just $ \pname -> wrapText $
"During development it is often useful to run build tasks and perform"
++ " one-off program executions to experiment with the behavior of build"
++ " tools. It is convenient to run these tools in the same way " ++ pname
++ " itself would. The `" ++ pname ++ " new-exec` command provides a way to"
++ " itself would. The `" ++ pname ++ " v2-exec` command provides a way to"
++ " do so.\n"
++ "\n"
++ "Compiler tools will be configured to see the same subset of the store"
++ " that builds would see. The PATH is modified to make all executables in"
++ " the dependency tree available (provided they have been built already)."
++ " Commands are also rewritten in the way cabal itself would. For"
++ " example, `" ++ pname ++ " new-exec ghc` will consult the configuration"
++ " example, `" ++ pname ++ " v2-exec ghc` will consult the configuration"
++ " to choose an appropriate version of ghc and to include any"
++ " ghc-specific flags requested."
, commandNotes = Nothing
Expand Down
18 changes: 9 additions & 9 deletions cabal-install/Distribution/Client/CmdFreeze.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ import qualified Distribution.Client.Setup as Client

freezeCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags)
freezeCommand = Client.installCommand {
commandName = "new-freeze",
commandName = "v2-freeze",
commandSynopsis = "Freeze dependencies.",
commandUsage = usageAlternatives "new-freeze" [ "[FLAGS]" ],
commandUsage = usageAlternatives "v2-freeze" [ "[FLAGS]" ],
commandDescription = Just $ \_ -> wrapText $
"The project configuration is frozen so that it will be reproducible "
++ "in future.\n\n"
Expand All @@ -62,23 +62,23 @@ freezeCommand = Client.installCommand {
++ "the 'cabal.project.freeze' file (or '$project_file.freeze' if "
++ "'--project-file' is specified). This file extends the configuration "
++ "from the 'cabal.project' file and thus is used as the project "
++ "configuration for all other commands (such as 'new-build', "
++ "'new-repl' etc).\n\n"
++ "configuration for all other commands (such as 'v2-build', "
++ "'v2-repl' etc).\n\n"

++ "The freeze file can be kept in source control. To make small "
++ "adjustments it may be edited manually, or to make bigger changes "
++ "you may wish to delete the file and re-freeze. For more control, "
++ "one approach is to try variations using 'new-build --dry-run' with "
++ "one approach is to try variations using 'v2-build --dry-run' with "
++ "solver flags such as '--constraint=\"pkg < 1.2\"' and once you have "
++ "a satisfactory solution to freeze it using the 'new-freeze' command "
++ "a satisfactory solution to freeze it using the 'v2-freeze' command "
++ "with the same set of flags.",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-freeze\n"
++ " " ++ pname ++ " v2-freeze\n"
++ " Freeze the configuration of the current project\n\n"
++ " " ++ pname ++ " new-build --dry-run --constraint=\"aeson < 1\"\n"
++ " " ++ pname ++ " v2-build --dry-run --constraint=\"aeson < 1\"\n"
++ " Check what a solution with the given constraints would look like\n"
++ " " ++ pname ++ " new-freeze --constraint=\"aeson < 1\"\n"
++ " " ++ pname ++ " v2-freeze --constraint=\"aeson < 1\"\n"
++ " Freeze a solution using the given constraints\n\n"

++ "Note: this command is part of the new project-based system (aka "
Expand Down
8 changes: 4 additions & 4 deletions cabal-install/Distribution/Client/CmdHaddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import Control.Monad (when)
haddockCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags
,HaddockFlags, TestFlags)
haddockCommand = Client.installCommand {
commandName = "new-haddock",
commandName = "v2-haddock",
commandSynopsis = "Build Haddock documentation",
commandUsage = usageAlternatives "new-haddock" [ "[FLAGS] TARGET" ],
commandUsage = usageAlternatives "v2-haddock" [ "[FLAGS] TARGET" ],
commandDescription = Just $ \_ -> wrapText $
"Build Haddock documentation for the specified packages within the "
++ "project.\n\n"
Expand All @@ -56,7 +56,7 @@ haddockCommand = Client.installCommand {
++ "'cabal.project.local' and other files.",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-haddock pkgname"
++ " " ++ pname ++ " v2-haddock pkgname"
++ " Build documentation for the package named pkgname\n\n"

++ cmdCommonHelpTextNewBuildBeta
Expand Down Expand Up @@ -153,7 +153,7 @@ selectPackageTargets haddockFlags targetSelector targets
isRequested _ LibKind = True
-- isRequested _ SubLibKind = True --TODO: what about sublibs?

-- TODO/HACK, we encode some defaults here as new-haddock's logic;
-- TODO/HACK, we encode some defaults here as v2-haddock's logic;
-- make sure this matches the defaults applied in
-- "Distribution.Client.ProjectPlanning"; this may need more work
-- to be done properly
Expand Down
12 changes: 6 additions & 6 deletions cabal-install/Distribution/Client/CmdInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ installCommand :: CommandUI ( ConfigFlags, ConfigExFlags, InstallFlags
, HaddockFlags, TestFlags, NewInstallFlags
)
installCommand = CommandUI
{ commandName = "new-install"
{ commandName = "v2-install"
, commandSynopsis = "Install packages."
, commandUsage = usageAlternatives
"new-install" [ "[TARGETS] [FLAGS]" ]
"v2-install" [ "[TARGETS] [FLAGS]" ]
, commandDescription = Just $ \_ -> wrapText $
"Installs one or more packages. This is done by installing them "
++ "in the store and symlinking the executables in the directory "
Expand All @@ -190,12 +190,12 @@ installCommand = CommandUI
++ "the previously installed libraries. This is currently not implemented."
, commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " new-install\n"
++ " " ++ pname ++ " v2-install\n"
++ " Install the package in the current directory\n"
++ " " ++ pname ++ " new-install pkgname\n"
++ " " ++ pname ++ " v2-install pkgname\n"
++ " Install the package named pkgname"
++ " (fetching it from hackage if necessary)\n"
++ " " ++ pname ++ " new-install ./pkgfoo\n"
++ " " ++ pname ++ " v2-install ./pkgfoo\n"
++ " Install the package in the ./pkgfoo directory\n"

++ cmdCommonHelpTextNewBuildBeta
Expand Down Expand Up @@ -244,7 +244,7 @@ installCommand = CommandUI
-- estra 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 'new-install'ing libraries
-- 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
Expand Down
Loading