Skip to content

Commit

Permalink
Stabilize --keep-going
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 26, 2023
1 parent 88d4d94 commit ece5269
Show file tree
Hide file tree
Showing 52 changed files with 293 additions and 115 deletions.
7 changes: 1 addition & 6 deletions src/cargo/util/command_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub trait CommandExt: Sized {
self.arg_jobs()._arg(
flag(
"keep-going",
"Do not abort the build as soon as there is an error (unstable)",
"Do not abort the build as soon as there is an error",
)
.help_heading(heading::COMPILATION_OPTIONS),
)
Expand Down Expand Up @@ -627,11 +627,6 @@ pub trait ArgMatchesExt {
}
}

if build_config.keep_going {
config
.cli_unstable()
.fail_if_stable_opt("--keep-going", 10496)?;
}
if build_config.build_plan {
config
.cli_unstable()
Expand Down
9 changes: 8 additions & 1 deletion src/doc/man/cargo-bench.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,16 @@ Rust test harness runs benchmarks serially in a single thread.

{{#options}}
{{> options-jobs }}
{{> options-keep-going }}
{{/options}}

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

cargo build --benches --release --keep-going
cargo bench --no-fail-fast

{{> section-environment }}

{{> section-exit-status }}
Expand Down
8 changes: 8 additions & 0 deletions src/doc/man/cargo-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ includes an option to control the number of threads used:

{{/options}}

While `cargo test` involves compilation, it does not provide a `--keep-going`
flag. Use `--no-fail-fast` to run as many tests as possible without stopping at
the first failure. To "compile" as many tests as possible, use `--tests` to
build test binaries separately. For example:

cargo build --tests --keep-going
cargo test --tests --no-fail-fast

{{> section-environment }}

{{> section-exit-status }}
Expand Down
12 changes: 8 additions & 4 deletions src/doc/man/generated_txt/cargo-bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,14 @@ OPTIONS
If a string default is provided, it sets the value back to defaults.
Should not be 0.

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

cargo build --benches --release --keep-going
cargo bench --no-fail-fast

ENVIRONMENT
See the reference
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo build -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo build -j1
--keep-going would definitely run both builds, even if the one run
first fails.

--future-incompat-report
Displays a future-incompat report for any future-incompatible
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo check -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo check -j1
--keep-going would definitely run both builds, even if the one run
first fails.

--future-incompat-report
Displays a future-incompat report for any future-incompatible
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo doc -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo doc -j1
--keep-going would definitely run both builds, even if the one run
first fails.

ENVIRONMENT
See the reference
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-fix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo fix -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo fix -j1
--keep-going would definitely run both builds, even if the one run
first fails.

ENVIRONMENT
See the reference
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo install -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo install -j1
--keep-going would definitely run both builds, even if the one run
first fails.

Display Options
-v, --verbose
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-package.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo package -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo package -j1
--keep-going would definitely run both builds, even if the one run
first fails.

Display Options
-v, --verbose
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-publish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo publish -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo publish -j1
--keep-going would definitely run both builds, even if the one run
first fails.

Display Options
-v, --verbose
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-run.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo run -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo run -j1
--keep-going would definitely run both builds, even if the one run
first fails.

ENVIRONMENT
See the reference
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-rustc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo rustc -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo rustc -j1
--keep-going would definitely run both builds, even if the one run
first fails.

--future-incompat-report
Displays a future-incompat report for any future-incompatible
Expand Down
8 changes: 7 additions & 1 deletion src/doc/man/generated_txt/cargo-rustdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,13 @@ OPTIONS
--keep-going
Build as many crates in the dependency graph as possible, rather
than aborting the build on the first one that fails to build.
Unstable, requires -Zunstable-options.

For example if the current package depends on dependencies fails and
works, one of which fails to build, cargo rustdoc -j1 may or may not
build the one that succeeds (depending on which one of the two
builds Cargo picked to run first), whereas cargo rustdoc -j1
--keep-going would definitely run both builds, even if the one run
first fails.

ENVIRONMENT
See the reference
Expand Down
8 changes: 8 additions & 0 deletions src/doc/man/generated_txt/cargo-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,14 @@ OPTIONS

See cargo-report(1)

While cargo test involves compilation, it does not provide a
--keep-going flag. Use --no-fail-fast to run as many tests as possible
without stopping at the first failure. To “compile” as many tests as
possible, use --tests to build test binaries separately. For example:

cargo build --tests --keep-going
cargo test --tests --no-fail-fast

ENVIRONMENT
See the reference
<https://doc.rust-lang.org/cargo/reference/environment-variables.html>
Expand Down
9 changes: 7 additions & 2 deletions src/doc/man/includes/options-keep-going.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{{#option "`--keep-going`"}}
Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
`-Zunstable-options`.
the build on the first one that fails to build.

For example if the current package depends on dependencies `fails` and `works`,
one of which fails to build, `cargo {{command}} -j1` may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas `cargo {{command}} -j1 --keep-going` would definitely run both
builds, even if the one run first fails.
{{/option}}
12 changes: 7 additions & 5 deletions src/doc/src/commands/cargo-bench.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,15 @@ a string <code>default</code> is provided, it sets the value back to defaults.
Should not be 0.</dd>


<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
</dl>

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

</dl>
cargo build --benches --release --keep-going
cargo bench --no-fail-fast

## ENVIRONMENT

Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo build -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo build -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


<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>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo check -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo check -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


<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>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo doc -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo doc -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


</dl>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo fix -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo fix -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


</dl>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo install -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo install -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


</dl>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo package -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo package -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


</dl>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo publish -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo publish -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


</dl>
Expand Down
8 changes: 6 additions & 2 deletions src/doc/src/commands/cargo-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,12 @@ Should not be 0.</dd>

<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>
<dd class="option-desc">Build as many crates in the dependency graph as possible, rather than aborting
the build on the first one that fails to build. Unstable, requires
<code>-Zunstable-options</code>.</dd>
the build on the first one that fails to build.</p>
<p>For example if the current package depends on dependencies <code>fails</code> and <code>works</code>,
one of which fails to build, <code>cargo run -j1</code> may or may not build the
one that succeeds (depending on which one of the two builds Cargo picked to run
first), whereas <code>cargo run -j1 --keep-going</code> would definitely run both
builds, even if the one run first fails.</dd>


</dl>
Expand Down
Loading

0 comments on commit ece5269

Please sign in to comment.