Skip to content

Commit ac9212f

Browse files
committed
Stabilize --keep-going
1 parent b4a770b commit ac9212f

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

+287
-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
@@ -157,9 +157,16 @@ Rust test harness runs benchmarks serially in a single thread.
157157

158158
{{#options}}
159159
{{> options-jobs }}
160-
{{> options-keep-going }}
161160
{{/options}}
162161

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

165172
{{> section-exit-status }}

src/doc/man/cargo-test.md

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

191191
{{/options}}
192192

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

195203
{{> 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 check -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 check -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 check -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 check -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 check -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 check -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 check -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 check -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 check -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 check -j1
205+
--keep-going would definitely run both builds, even if the one run
206+
first fails.
201207

202208
Display Options
203209
-v, --verbose

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ OPTIONS
163163
--keep-going
164164
Build as many crates in the dependency graph as possible, rather
165165
than aborting the build on the first one that fails to build.
166-
Unstable, requires -Zunstable-options.
166+
167+
For example if the current package depends on dependencies fails and
168+
works, one of which fails to build, cargo check -j1 may or may not
169+
build the one that succeeds (depending on which one of the two
170+
builds Cargo picked to run first), whereas cargo check -j1
171+
--keep-going would definitely run both builds, even if the one run
172+
first fails.
167173

168174
Display Options
169175
-v, --verbose

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,13 @@ OPTIONS
251251
--keep-going
252252
Build as many crates in the dependency graph as possible, rather
253253
than aborting the build on the first one that fails to build.
254-
Unstable, requires -Zunstable-options.
254+
255+
For example if the current package depends on dependencies fails and
256+
works, one of which fails to build, cargo check -j1 may or may not
257+
build the one that succeeds (depending on which one of the two
258+
builds Cargo picked to run first), whereas cargo check -j1
259+
--keep-going would definitely run both builds, even if the one run
260+
first fails.
255261

256262
ENVIRONMENT
257263
See the reference

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

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

354360
--future-incompat-report
355361
Displays a future-incompat report for any future-incompatible

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,13 @@ OPTIONS
319319
--keep-going
320320
Build as many crates in the dependency graph as possible, rather
321321
than aborting the build on the first one that fails to build.
322-
Unstable, requires -Zunstable-options.
322+
323+
For example if the current package depends on dependencies fails and
324+
works, one of which fails to build, cargo check -j1 may or may not
325+
build the one that succeeds (depending on which one of the two
326+
builds Cargo picked to run first), whereas cargo check -j1
327+
--keep-going would definitely run both builds, even if the one run
328+
first fails.
323329

324330
ENVIRONMENT
325331
See the reference

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ OPTIONS
448448

449449
See cargo-report(1)
450450

451+
While cargo test involves compilation, it does not provide a
452+
--keep-going flag. Use --no-fail-fast to run as many tests as possible
453+
without stopping at the first failure. To “compile” as many tests as
454+
possible, use --tests to build test binaries separately. For example:
455+
456+
cargo build --tests --keep-going
457+
cargo test --tests --no-fail-fast
458+
451459
ENVIRONMENT
452460
See the reference
453461
<https://doc.rust-lang.org/cargo/reference/environment-variables.html>
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{{#option "`--keep-going`"}}
22
Build as many crates in the dependency graph as possible, rather than aborting
3-
the build on the first one that fails to build. Unstable, requires
4-
`-Zunstable-options`.
3+
the build on the first one that fails to build.
4+
5+
For example if the current package depends on dependencies `fails` and `works`,
6+
one of which fails to build, `cargo check -j1` may or may not build the one that
7+
succeeds (depending on which one of the two builds Cargo picked to run first),
8+
whereas `cargo check -j1 --keep-going` would definitely run both builds, even if
9+
the one run first fails.
510
{{/option}}

src/doc/src/commands/cargo-bench.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,13 +481,15 @@ a string <code>default</code> is provided, it sets the value back to defaults.
481481
Should not be 0.</dd>
482482

483483

484-
<dt class="option-term" id="option-cargo-bench---keep-going"><a class="option-anchor" href="#option-cargo-bench---keep-going"></a><code>--keep-going</code></dt>
485-
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
486-
the build on the first one that fails to build. Unstable, requires
487-
<code>-Zunstable-options</code>.</dd>
484+
</dl>
488485

486+
While `cargo bench` involves compilation, it does not provide a `--keep-going`
487+
flag. Use `--no-fail-fast` to run as many benchmarks as possible without
488+
stopping at the first failure. To "compile" as many benchmarks as possible, use
489+
`--benches` to build benchmark binaries separately. For example:
489490

490-
</dl>
491+
cargo build --benches --release --keep-going
492+
cargo bench --no-fail-fast
491493

492494
## ENVIRONMENT
493495

src/doc/src/commands/cargo-build.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,12 @@ Should not be 0.</dd>
409409

410410
<dt class="option-term" id="option-cargo-build---keep-going"><a class="option-anchor" href="#option-cargo-build---keep-going"></a><code>--keep-going</code></dt>
411411
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
412-
the build on the first one that fails to build. Unstable, requires
413-
<code>-Zunstable-options</code>.</dd>
412+
the build on the first one that fails to build.</p>
413+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
414+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
415+
succeeds (depending on which one of the two builds Cargo picked to run first),
416+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
417+
the one run first fails.</dd>
414418

415419

416420
<dt class="option-term" id="option-cargo-build---future-incompat-report"><a class="option-anchor" href="#option-cargo-build---future-incompat-report"></a><code>--future-incompat-report</code></dt>

src/doc/src/commands/cargo-check.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,12 @@ Should not be 0.</dd>
390390

391391
<dt class="option-term" id="option-cargo-check---keep-going"><a class="option-anchor" href="#option-cargo-check---keep-going"></a><code>--keep-going</code></dt>
392392
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
393-
the build on the first one that fails to build. Unstable, requires
394-
<code>-Zunstable-options</code>.</dd>
393+
the build on the first one that fails to build.</p>
394+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
395+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
396+
succeeds (depending on which one of the two builds Cargo picked to run first),
397+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
398+
the one run first fails.</dd>
395399

396400

397401
<dt class="option-term" id="option-cargo-check---future-incompat-report"><a class="option-anchor" href="#option-cargo-check---future-incompat-report"></a><code>--future-incompat-report</code></dt>

src/doc/src/commands/cargo-doc.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,12 @@ Should not be 0.</dd>
364364

365365
<dt class="option-term" id="option-cargo-doc---keep-going"><a class="option-anchor" href="#option-cargo-doc---keep-going"></a><code>--keep-going</code></dt>
366366
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
367-
the build on the first one that fails to build. Unstable, requires
368-
<code>-Zunstable-options</code>.</dd>
367+
the build on the first one that fails to build.</p>
368+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
369+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
370+
succeeds (depending on which one of the two builds Cargo picked to run first),
371+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
372+
the one run first fails.</dd>
369373

370374

371375
</dl>

src/doc/src/commands/cargo-fix.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,12 @@ Should not be 0.</dd>
470470

471471
<dt class="option-term" id="option-cargo-fix---keep-going"><a class="option-anchor" href="#option-cargo-fix---keep-going"></a><code>--keep-going</code></dt>
472472
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
473-
the build on the first one that fails to build. Unstable, requires
474-
<code>-Zunstable-options</code>.</dd>
473+
the build on the first one that fails to build.</p>
474+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
475+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
476+
succeeds (depending on which one of the two builds Cargo picked to run first),
477+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
478+
the one run first fails.</dd>
475479

476480

477481
</dl>

src/doc/src/commands/cargo-install.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,12 @@ Should not be 0.</dd>
319319

320320
<dt class="option-term" id="option-cargo-install---keep-going"><a class="option-anchor" href="#option-cargo-install---keep-going"></a><code>--keep-going</code></dt>
321321
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
322-
the build on the first one that fails to build. Unstable, requires
323-
<code>-Zunstable-options</code>.</dd>
322+
the build on the first one that fails to build.</p>
323+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
324+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
325+
succeeds (depending on which one of the two builds Cargo picked to run first),
326+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
327+
the one run first fails.</dd>
324328

325329

326330
</dl>

src/doc/src/commands/cargo-package.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,12 @@ Should not be 0.</dd>
234234

235235
<dt class="option-term" id="option-cargo-package---keep-going"><a class="option-anchor" href="#option-cargo-package---keep-going"></a><code>--keep-going</code></dt>
236236
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
237-
the build on the first one that fails to build. Unstable, requires
238-
<code>-Zunstable-options</code>.</dd>
237+
the build on the first one that fails to build.</p>
238+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
239+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
240+
succeeds (depending on which one of the two builds Cargo picked to run first),
241+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
242+
the one run first fails.</dd>
239243

240244

241245
</dl>

src/doc/src/commands/cargo-publish.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,12 @@ Should not be 0.</dd>
200200

201201
<dt class="option-term" id="option-cargo-publish---keep-going"><a class="option-anchor" href="#option-cargo-publish---keep-going"></a><code>--keep-going</code></dt>
202202
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
203-
the build on the first one that fails to build. Unstable, requires
204-
<code>-Zunstable-options</code>.</dd>
203+
the build on the first one that fails to build.</p>
204+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
205+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
206+
succeeds (depending on which one of the two builds Cargo picked to run first),
207+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
208+
the one run first fails.</dd>
205209

206210

207211
</dl>

src/doc/src/commands/cargo-run.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,12 @@ Should not be 0.</dd>
306306

307307
<dt class="option-term" id="option-cargo-run---keep-going"><a class="option-anchor" href="#option-cargo-run---keep-going"></a><code>--keep-going</code></dt>
308308
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
309-
the build on the first one that fails to build. Unstable, requires
310-
<code>-Zunstable-options</code>.</dd>
309+
the build on the first one that fails to build.</p>
310+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
311+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
312+
succeeds (depending on which one of the two builds Cargo picked to run first),
313+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
314+
the one run first fails.</dd>
311315

312316

313317
</dl>

0 commit comments

Comments
 (0)