Skip to content

Commit eff62ad

Browse files
committed
Auto merge of #10861 - RalfJung:cargo-install-debug, r=ehuss
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.
2 parents 289ab53 + c9d79d1 commit eff62ad

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/bin/cargo/commands/install.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ pub fn cli() -> App {
5555
.arg(flag("no-track", "Do not save tracking information"))
5656
.arg_features()
5757
.arg_profile("Install artifacts with the specified profile")
58-
.arg(flag("debug", "Build in debug mode instead of release mode"))
58+
.arg(flag(
59+
"debug",
60+
"Build in debug mode (with the 'dev' profile) instead of release mode",
61+
))
5962
.arg_targets_bins_examples(
6063
"Install only the specified binary",
6164
"Install all binaries",

src/doc/src/reference/profiles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ whether or not [`rpath`] is enabled.
246246
#### dev
247247

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

251251
The default settings for the `dev` profile are:
252252

src/etc/_cargo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ _cargo() {
168168
'(-f --force)'{-f,--force}'[force overwriting of existing crates or binaries]' \
169169
'--bin=[only install the specified binary]:binary' \
170170
'--branch=[branch to use when installing from git]:branch' \
171-
'--debug[build in debug mode instead of release mode]' \
171+
'--debug[Build in debug mode (with the "dev" profile) instead of release mode]' \
172172
'--example=[install the specified example instead of binaries]:example:_cargo_example_names' \
173173
'--git=[specify URL from which to install the crate]:url:_urls' \
174174
'--path=[local filesystem path to crate to install]: :_directories' \

0 commit comments

Comments
 (0)