Skip to content

Commit ece5269

Browse files
committed
Stabilize --keep-going
1 parent 88d4d94 commit ece5269

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+293
-115
lines changed

src/cargo/util/command_prelude.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub trait CommandExt: Sized {
8787
self.arg_jobs()._arg(
8888
flag(
8989
"keep-going",
90-
"Do not abort the build as soon as there is an error (unstable)",
90+
"Do not abort the build as soon as there is an error",
9191
)
9292
.help_heading(heading::COMPILATION_OPTIONS),
9393
)
@@ -627,11 +627,6 @@ pub trait ArgMatchesExt {
627627
}
628628
}
629629

630-
if build_config.keep_going {
631-
config
632-
.cli_unstable()
633-
.fail_if_stable_opt("--keep-going", 10496)?;
634-
}
635630
if build_config.build_plan {
636631
config
637632
.cli_unstable()

src/doc/man/cargo-bench.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,16 @@ Rust test harness runs benchmarks serially in a single thread.
158158

159159
{{#options}}
160160
{{> options-jobs }}
161-
{{> options-keep-going }}
162161
{{/options}}
163162

163+
While `cargo bench` involves compilation, it does not provide a `--keep-going`
164+
flag. Use `--no-fail-fast` to run as many benchmarks as possible without
165+
stopping at the first failure. To "compile" as many benchmarks as possible, use
166+
`--benches` to build benchmark binaries separately. For example:
167+
168+
cargo build --benches --release --keep-going
169+
cargo bench --no-fail-fast
170+
164171
{{> section-environment }}
165172

166173
{{> section-exit-status }}

src/doc/man/cargo-test.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ includes an option to control the number of threads used:
191191

192192
{{/options}}
193193

194+
While `cargo test` involves compilation, it does not provide a `--keep-going`
195+
flag. Use `--no-fail-fast` to run as many tests as possible without stopping at
196+
the first failure. To "compile" as many tests as possible, use `--tests` to
197+
build test binaries separately. For example:
198+
199+
cargo build --tests --keep-going
200+
cargo test --tests --no-fail-fast
201+
194202
{{> section-environment }}
195203

196204
{{> section-exit-status }}

src/doc/man/generated_txt/cargo-bench.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,14 @@ OPTIONS
413413
If a string default is provided, it sets the value back to defaults.
414414
Should not be 0.
415415

416-
--keep-going
417-
Build as many crates in the dependency graph as possible, rather
418-
than aborting the build on the first one that fails to build.
419-
Unstable, requires -Zunstable-options.
416+
While cargo bench involves compilation, it does not provide a
417+
--keep-going flag. Use --no-fail-fast to run as many benchmarks as
418+
possible without stopping at the first failure. To “compile” as many
419+
benchmarks as possible, use --benches to build benchmark binaries
420+
separately. For example:
421+
422+
cargo build --benches --release --keep-going
423+
cargo bench --no-fail-fast
420424

421425
ENVIRONMENT
422426
See the reference

src/doc/man/generated_txt/cargo-build.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,13 @@ OPTIONS
347347
--keep-going
348348
Build as many crates in the dependency graph as possible, rather
349349
than aborting the build on the first one that fails to build.
350-
Unstable, requires -Zunstable-options.
350+
351+
For example if the current package depends on dependencies fails and
352+
works, one of which fails to build, cargo build -j1 may or may not
353+
build the one that succeeds (depending on which one of the two
354+
builds Cargo picked to run first), whereas cargo build -j1
355+
--keep-going would definitely run both builds, even if the one run
356+
first fails.
351357

352358
--future-incompat-report
353359
Displays a future-incompat report for any future-incompatible

src/doc/man/generated_txt/cargo-check.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,13 @@ OPTIONS
332332
--keep-going
333333
Build as many crates in the dependency graph as possible, rather
334334
than aborting the build on the first one that fails to build.
335-
Unstable, requires -Zunstable-options.
335+
336+
For example if the current package depends on dependencies fails and
337+
works, one of which fails to build, cargo check -j1 may or may not
338+
build the one that succeeds (depending on which one of the two
339+
builds Cargo picked to run first), whereas cargo check -j1
340+
--keep-going would definitely run both builds, even if the one run
341+
first fails.
336342

337343
--future-incompat-report
338344
Displays a future-incompat report for any future-incompatible

src/doc/man/generated_txt/cargo-doc.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,13 @@ OPTIONS
303303
--keep-going
304304
Build as many crates in the dependency graph as possible, rather
305305
than aborting the build on the first one that fails to build.
306-
Unstable, requires -Zunstable-options.
306+
307+
For example if the current package depends on dependencies fails and
308+
works, one of which fails to build, cargo doc -j1 may or may not
309+
build the one that succeeds (depending on which one of the two
310+
builds Cargo picked to run first), whereas cargo doc -j1
311+
--keep-going would definitely run both builds, even if the one run
312+
first fails.
307313

308314
ENVIRONMENT
309315
See the reference

src/doc/man/generated_txt/cargo-fix.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,13 @@ OPTIONS
405405
--keep-going
406406
Build as many crates in the dependency graph as possible, rather
407407
than aborting the build on the first one that fails to build.
408-
Unstable, requires -Zunstable-options.
408+
409+
For example if the current package depends on dependencies fails and
410+
works, one of which fails to build, cargo fix -j1 may or may not
411+
build the one that succeeds (depending on which one of the two
412+
builds Cargo picked to run first), whereas cargo fix -j1
413+
--keep-going would definitely run both builds, even if the one run
414+
first fails.
409415

410416
ENVIRONMENT
411417
See the reference

src/doc/man/generated_txt/cargo-install.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,13 @@ OPTIONS
280280
--keep-going
281281
Build as many crates in the dependency graph as possible, rather
282282
than aborting the build on the first one that fails to build.
283-
Unstable, requires -Zunstable-options.
283+
284+
For example if the current package depends on dependencies fails and
285+
works, one of which fails to build, cargo install -j1 may or may not
286+
build the one that succeeds (depending on which one of the two
287+
builds Cargo picked to run first), whereas cargo install -j1
288+
--keep-going would definitely run both builds, even if the one run
289+
first fails.
284290

285291
Display Options
286292
-v, --verbose

src/doc/man/generated_txt/cargo-package.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,13 @@ OPTIONS
197197
--keep-going
198198
Build as many crates in the dependency graph as possible, rather
199199
than aborting the build on the first one that fails to build.
200-
Unstable, requires -Zunstable-options.
200+
201+
For example if the current package depends on dependencies fails and
202+
works, one of which fails to build, cargo package -j1 may or may not
203+
build the one that succeeds (depending on which one of the two
204+
builds Cargo picked to run first), whereas cargo package -j1
205+
--keep-going would definitely run both builds, even if the one run
206+
first fails.
201207

202208
Display Options
203209
-v, --verbose

0 commit comments

Comments
 (0)