Skip to content

Commit

Permalink
Auto merge of #10861 - RalfJung:cargo-install-debug, r=ehuss
Browse files Browse the repository at this point in the history
clarify profile used for 'cargo install --debug'

TIL that the profile used by `cargo build` is called `dev`, not `debug`. That made me wonder, is that profile also used by `cargo install --debug` (despite the name of the flag being `--debug`, not `--dev`)? Turns out the answer is yes, but the first 2 places where I looked for help did not say that. So this PR changes those two places to be explicit about this.
  • Loading branch information
bors committed Jul 14, 2022
2 parents 289ab53 + c9d79d1 commit eff62ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/bin/cargo/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ pub fn cli() -> App {
.arg(flag("no-track", "Do not save tracking information"))
.arg_features()
.arg_profile("Install artifacts with the specified profile")
.arg(flag("debug", "Build in debug mode instead of release mode"))
.arg(flag(
"debug",
"Build in debug mode (with the 'dev' profile) instead of release mode",
))
.arg_targets_bins_examples(
"Install only the specified binary",
"Install all binaries",
Expand Down
2 changes: 1 addition & 1 deletion src/doc/src/reference/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ whether or not [`rpath`] is enabled.
#### dev

The `dev` profile is used for normal development and debugging. It is the
default for build commands like [`cargo build`].
default for build commands like [`cargo build`], and is used for `cargo install --debug`.

The default settings for the `dev` profile are:

Expand Down
2 changes: 1 addition & 1 deletion src/etc/_cargo
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ _cargo() {
'(-f --force)'{-f,--force}'[force overwriting of existing crates or binaries]' \
'--bin=[only install the specified binary]:binary' \
'--branch=[branch to use when installing from git]:branch' \
'--debug[build in debug mode instead of release mode]' \
'--debug[Build in debug mode (with the "dev" profile) instead of release mode]' \
'--example=[install the specified example instead of binaries]:example:_cargo_example_names' \
'--git=[specify URL from which to install the crate]:url:_urls' \
'--path=[local filesystem path to crate to install]: :_directories' \
Expand Down

0 comments on commit eff62ad

Please sign in to comment.