Skip to content

Commit 179cb10

Browse files
committed
Improve keep-going docs
1 parent bc4d1d9 commit 179cb10

39 files changed

+264
-21
lines changed

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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +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.
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
419424

420425
ENVIRONMENT
421426
See the reference

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,13 @@ OPTIONS
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.
350350

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.
357+
351358
--future-incompat-report
352359
Displays a future-incompat report for any future-incompatible
353360
warnings produced during execution of this command

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,13 @@ OPTIONS
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.
335335

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.
342+
336343
--future-incompat-report
337344
Displays a future-incompat report for any future-incompatible
338345
warnings produced during execution of this command

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,13 @@ OPTIONS
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.
306306

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.
313+
307314
ENVIRONMENT
308315
See the reference
309316
<https://doc.rust-lang.org/cargo/reference/environment-variables.html>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ OPTIONS
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.
408408

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.
415+
409416
ENVIRONMENT
410417
See the reference
411418
<https://doc.rust-lang.org/cargo/reference/environment-variables.html>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ OPTIONS
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.
283283

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.
290+
284291
Display Options
285292
-v, --verbose
286293
Use verbose output. May be specified twice for “very verbose”

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ OPTIONS
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.
200200

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.
207+
201208
Display Options
202209
-v, --verbose
203210
Use verbose output. May be specified twice for “very verbose”

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ OPTIONS
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.
166166

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.
173+
167174
Display Options
168175
-v, --verbose
169176
Use verbose output. May be specified twice for “very verbose”

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ OPTIONS
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.
254254

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.
261+
255262
ENVIRONMENT
256263
See the reference
257264
<https://doc.rust-lang.org/cargo/reference/environment-variables.html>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,13 @@ OPTIONS
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.
352352

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.
359+
353360
--future-incompat-report
354361
Displays a future-incompat report for any future-incompatible
355362
warnings produced during execution of this command

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ OPTIONS
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.
322322

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.
329+
323330
ENVIRONMENT
324331
See the reference
325332
<https://doc.rust-lang.org/cargo/reference/environment-variables.html>

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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{{#option "`--keep-going`"}}
22
Build as many crates in the dependency graph as possible, rather than aborting
33
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.
410
{{/option}}

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +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.</dd>
484+
</dl>
487485

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:
488490

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

491494
## ENVIRONMENT
492495

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +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.</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>
413418

414419

415420
<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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +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.</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>
394399

395400

396401
<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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +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.</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>
368373

369374

370375
</dl>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +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.</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>
474479

475480

476481
</dl>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +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.</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>
323328

324329

325330
</dl>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +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.</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>
238243

239244

240245
</dl>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +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.</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>
204209

205210

206211
</dl>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +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.</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>
310315

311316

312317
</dl>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,12 @@ Should not be 0.</dd>
403403

404404
<dt class="option-term" id="option-cargo-rustc---keep-going"><a class="option-anchor" href="#option-cargo-rustc---keep-going"></a><code>--keep-going</code></dt>
405405
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
406-
the build on the first one that fails to build.</dd>
406+
the build on the first one that fails to build.</p>
407+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
408+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
409+
succeeds (depending on which one of the two builds Cargo picked to run first),
410+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
411+
the one run first fails.</dd>
407412

408413

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

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,12 @@ Should not be 0.</dd>
383383

384384
<dt class="option-term" id="option-cargo-rustdoc---keep-going"><a class="option-anchor" href="#option-cargo-rustdoc---keep-going"></a><code>--keep-going</code></dt>
385385
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
386-
the build on the first one that fails to build.</dd>
386+
the build on the first one that fails to build.</p>
387+
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
388+
one of which fails to build, <code>cargo check -j1</code> may or may not build the one that
389+
succeeds (depending on which one of the two builds Cargo picked to run first),
390+
whereas <code>cargo check -j1 --keep-going</code> would definitely run both builds, even if
391+
the one run first fails.</dd>
387392

388393

389394
</dl>

0 commit comments

Comments
 (0)