From ece5269e97b67ee10379f08d4b54fdf943bd3870 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 26 Aug 2023 09:49:49 -0700 Subject: [PATCH] Stabilize --keep-going --- src/cargo/util/command_prelude.rs | 7 +--- src/doc/man/cargo-bench.md | 9 ++++- src/doc/man/cargo-test.md | 8 ++++ src/doc/man/generated_txt/cargo-bench.txt | 12 ++++-- src/doc/man/generated_txt/cargo-build.txt | 8 +++- src/doc/man/generated_txt/cargo-check.txt | 8 +++- src/doc/man/generated_txt/cargo-doc.txt | 8 +++- src/doc/man/generated_txt/cargo-fix.txt | 8 +++- src/doc/man/generated_txt/cargo-install.txt | 8 +++- src/doc/man/generated_txt/cargo-package.txt | 8 +++- src/doc/man/generated_txt/cargo-publish.txt | 8 +++- src/doc/man/generated_txt/cargo-run.txt | 8 +++- src/doc/man/generated_txt/cargo-rustc.txt | 8 +++- src/doc/man/generated_txt/cargo-rustdoc.txt | 8 +++- src/doc/man/generated_txt/cargo-test.txt | 8 ++++ src/doc/man/includes/options-keep-going.md | 9 ++++- src/doc/src/commands/cargo-bench.md | 12 +++--- src/doc/src/commands/cargo-build.md | 8 +++- src/doc/src/commands/cargo-check.md | 8 +++- src/doc/src/commands/cargo-doc.md | 8 +++- src/doc/src/commands/cargo-fix.md | 8 +++- src/doc/src/commands/cargo-install.md | 8 +++- src/doc/src/commands/cargo-package.md | 8 +++- src/doc/src/commands/cargo-publish.md | 8 +++- src/doc/src/commands/cargo-run.md | 8 +++- src/doc/src/commands/cargo-rustc.md | 8 +++- src/doc/src/commands/cargo-rustdoc.md | 8 +++- src/doc/src/commands/cargo-test.md | 8 ++++ src/doc/src/reference/unstable.md | 37 +++---------------- src/etc/man/cargo-bench.1 | 13 +++++-- src/etc/man/cargo-build.1 | 9 ++++- src/etc/man/cargo-check.1 | 9 ++++- src/etc/man/cargo-doc.1 | 9 ++++- src/etc/man/cargo-fix.1 | 9 ++++- src/etc/man/cargo-install.1 | 9 ++++- src/etc/man/cargo-package.1 | 9 ++++- src/etc/man/cargo-publish.1 | 9 ++++- src/etc/man/cargo-run.1 | 9 ++++- src/etc/man/cargo-rustc.1 | 9 ++++- src/etc/man/cargo-rustdoc.1 | 9 ++++- src/etc/man/cargo-test.1 | 12 ++++++ tests/testsuite/cargo_build/help/stdout.log | 2 +- tests/testsuite/cargo_check/help/stdout.log | 2 +- tests/testsuite/cargo_doc/help/stdout.log | 2 +- tests/testsuite/cargo_fix/help/stdout.log | 2 +- tests/testsuite/cargo_install/help/stdout.log | 2 +- tests/testsuite/cargo_package/help/stdout.log | 2 +- tests/testsuite/cargo_publish/help/stdout.log | 2 +- tests/testsuite/cargo_run/help/stdout.log | 2 +- tests/testsuite/cargo_rustc/help/stdout.log | 2 +- tests/testsuite/cargo_rustdoc/help/stdout.log | 2 +- tests/testsuite/check.rs | 3 +- 52 files changed, 293 insertions(+), 115 deletions(-) diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index 84545ae998e..ed470653864 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -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), ) @@ -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() diff --git a/src/doc/man/cargo-bench.md b/src/doc/man/cargo-bench.md index 993076fa22d..a2a60284720 100644 --- a/src/doc/man/cargo-bench.md +++ b/src/doc/man/cargo-bench.md @@ -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 }} diff --git a/src/doc/man/cargo-test.md b/src/doc/man/cargo-test.md index 6d11ecc8fbc..1755ab7ded3 100644 --- a/src/doc/man/cargo-test.md +++ b/src/doc/man/cargo-test.md @@ -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 }} diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt index 9610b72f040..796fbd11b55 100644 --- a/src/doc/man/generated_txt/cargo-bench.txt +++ b/src/doc/man/generated_txt/cargo-bench.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-build.txt b/src/doc/man/generated_txt/cargo-build.txt index e396410d329..06a7a6b3ca7 100644 --- a/src/doc/man/generated_txt/cargo-build.txt +++ b/src/doc/man/generated_txt/cargo-build.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-check.txt b/src/doc/man/generated_txt/cargo-check.txt index 9814f445d2d..b447455eec5 100644 --- a/src/doc/man/generated_txt/cargo-check.txt +++ b/src/doc/man/generated_txt/cargo-check.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt index 09f9b68c975..773d600c6d7 100644 --- a/src/doc/man/generated_txt/cargo-doc.txt +++ b/src/doc/man/generated_txt/cargo-doc.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-fix.txt b/src/doc/man/generated_txt/cargo-fix.txt index b83c360eb3d..3e7910ca50e 100644 --- a/src/doc/man/generated_txt/cargo-fix.txt +++ b/src/doc/man/generated_txt/cargo-fix.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-install.txt b/src/doc/man/generated_txt/cargo-install.txt index a5b696111c8..02790f1d092 100644 --- a/src/doc/man/generated_txt/cargo-install.txt +++ b/src/doc/man/generated_txt/cargo-install.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-package.txt b/src/doc/man/generated_txt/cargo-package.txt index 1201f3d07e0..195b35144cd 100644 --- a/src/doc/man/generated_txt/cargo-package.txt +++ b/src/doc/man/generated_txt/cargo-package.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-publish.txt b/src/doc/man/generated_txt/cargo-publish.txt index e8850e3d417..2918da3e21f 100644 --- a/src/doc/man/generated_txt/cargo-publish.txt +++ b/src/doc/man/generated_txt/cargo-publish.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-run.txt b/src/doc/man/generated_txt/cargo-run.txt index 5fcfe66b422..495a08a6c92 100644 --- a/src/doc/man/generated_txt/cargo-run.txt +++ b/src/doc/man/generated_txt/cargo-run.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-rustc.txt b/src/doc/man/generated_txt/cargo-rustc.txt index 7a70c5363ef..af6ad9d59d4 100644 --- a/src/doc/man/generated_txt/cargo-rustc.txt +++ b/src/doc/man/generated_txt/cargo-rustc.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-rustdoc.txt b/src/doc/man/generated_txt/cargo-rustdoc.txt index 4db66b3a8f6..5ba20064480 100644 --- a/src/doc/man/generated_txt/cargo-rustdoc.txt +++ b/src/doc/man/generated_txt/cargo-rustdoc.txt @@ -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 diff --git a/src/doc/man/generated_txt/cargo-test.txt b/src/doc/man/generated_txt/cargo-test.txt index dc32bdbf7fe..b992d0d2f62 100644 --- a/src/doc/man/generated_txt/cargo-test.txt +++ b/src/doc/man/generated_txt/cargo-test.txt @@ -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 diff --git a/src/doc/man/includes/options-keep-going.md b/src/doc/man/includes/options-keep-going.md index 034181c0e55..928c7f67a7f 100644 --- a/src/doc/man/includes/options-keep-going.md +++ b/src/doc/man/includes/options-keep-going.md @@ -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}} diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index d09978b0882..45584023eb5 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -478,13 +478,15 @@ 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 diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md index a5be94f152f..8e517bd1f3b 100644 --- a/src/doc/src/commands/cargo-build.md +++ b/src/doc/src/commands/cargo-build.md @@ -407,8 +407,12 @@ 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.
+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 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
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md index fef4e0ef42a..3d7d0a49034 100644 --- a/src/doc/src/commands/cargo-check.md +++ b/src/doc/src/commands/cargo-check.md @@ -388,8 +388,12 @@ 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.
+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 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
diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 987d49b7638..92843838c1b 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -362,8 +362,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md index 669bae6f50e..4dde83d9624 100644 --- a/src/doc/src/commands/cargo-fix.md +++ b/src/doc/src/commands/cargo-fix.md @@ -468,8 +468,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-install.md b/src/doc/src/commands/cargo-install.md index f397244aca1..5640af87a56 100644 --- a/src/doc/src/commands/cargo-install.md +++ b/src/doc/src/commands/cargo-install.md @@ -317,8 +317,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-package.md b/src/doc/src/commands/cargo-package.md index 902f7b114ee..12684aa3cf6 100644 --- a/src/doc/src/commands/cargo-package.md +++ b/src/doc/src/commands/cargo-package.md @@ -231,8 +231,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-publish.md b/src/doc/src/commands/cargo-publish.md index 86cc5adf319..ab364b9ed7c 100644 --- a/src/doc/src/commands/cargo-publish.md +++ b/src/doc/src/commands/cargo-publish.md @@ -198,8 +198,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-run.md b/src/doc/src/commands/cargo-run.md index 98832ce985c..c14ad77dcb9 100644 --- a/src/doc/src/commands/cargo-run.md +++ b/src/doc/src/commands/cargo-run.md @@ -305,8 +305,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md index dd55d62a4a3..6ae52d9657a 100644 --- a/src/doc/src/commands/cargo-rustc.md +++ b/src/doc/src/commands/cargo-rustc.md @@ -401,8 +401,12 @@ 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.
+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 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
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md index aa5fcc6dee2..6635cded58d 100644 --- a/src/doc/src/commands/cargo-rustdoc.md +++ b/src/doc/src/commands/cargo-rustdoc.md @@ -381,8 +381,12 @@ 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.
+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 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. diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md index 75f66e4b049..6a6ae82d2bf 100644 --- a/src/doc/src/commands/cargo-test.md +++ b/src/doc/src/commands/cargo-test.md @@ -521,6 +521,14 @@ produced during execution of this command

+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](../reference/environment-variables.html) for diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index f3a8f162974..84d4d02fe76 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -82,7 +82,6 @@ For the latest nightly, see the [nightly version] of this page. * [build-std-features](#build-std-features) --- Sets features to use with the standard library. * [binary-dep-depinfo](#binary-dep-depinfo) --- Causes the dep-info file to track binary dependencies. * [panic-abort-tests](#panic-abort-tests) --- Allows running tests with the "abort" panic strategy. - * [keep-going](#keep-going) --- Build as much as possible rather than aborting on the first error. * [check-cfg](#check-cfg) --- Compile-time validation of `cfg` expressions. * [host-config](#host-config) --- Allows setting `[target]`-like configuration settings for host build targets. * [target-applies-to-host](#target-applies-to-host) --- Alters whether certain flags will be passed to host build targets. @@ -429,36 +428,6 @@ like to stabilize it somehow! [rust-lang/rust#64158]: https://github.com/rust-lang/rust/pull/64158 -### keep-going -* Tracking Issue: [#10496](https://github.com/rust-lang/cargo/issues/10496) - -`cargo build --keep-going` (and similarly for every command involving compilation, like `check` and `doc`) -will build as many crates in the dependency graph as possible, -rather than aborting the build at 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 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. - -The `-Z unstable-options` command-line option must be used in order to use -`--keep-going` while it is not yet stable: - -```console -cargo check --keep-going -Z unstable-options -``` - -While `cargo test` and `cargo bench` commands involve compilation, they do not provide a `--keep-going` flag. -Both commands already include a similar `--no-fail-fast` flag, allowing running as many tests as possible without stopping at the first failure. -To "compile" as many tests as possible, use target selection flags like `--tests` to build test binaries separately. -For example, - -```console -cargo build --tests --keep-going -Zunstable-options -cargo test --tests --no-fail-fast -``` - ### config-include * Tracking Issue: [#7723](https://github.com/rust-lang/cargo/issues/7723) @@ -1909,3 +1878,9 @@ The `-Z doctest-in-workspace` option for `cargo test` has been stabilized and enabled by default in the 1.72 release. See the [`cargo test` documentation](../commands/cargo-test.md#working-directory-of-tests) for more information about the working directory for compiling and running tests. + +### keep-going + +The `--keep-going` option has been stabilized in the 1.74 release. See the +[`--keep-going` flag](../commands/cargo-build.html#option-cargo-build---keep-going) +in `cargo build` as an example for more details. diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index 993dd3415b8..64498c4d602 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -502,11 +502,16 @@ a string \fBdefault\fR is provided, it sets the value back to defaults. Should not be 0. .RE .sp -\fB\-\-keep\-going\fR +While \fBcargo bench\fR involves compilation, it does not provide a \fB\-\-keep\-going\fR +flag. Use \fB\-\-no\-fail\-fast\fR to run as many benchmarks as possible without +stopping at the first failure. To \[lq]compile\[rq] as many benchmarks as possible, use +\fB\-\-benches\fR to build benchmark binaries separately. For example: +.sp .RS 4 -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 -\fB\-Zunstable\-options\fR\&. +.nf +cargo build \-\-benches \-\-release \-\-keep\-going +cargo bench \-\-no\-fail\-fast +.fi .RE .SH "ENVIRONMENT" See \fIthe reference\fR for diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1 index 4ee6a0d7636..6bcfe8093dc 100644 --- a/src/etc/man/cargo-build.1 +++ b/src/etc/man/cargo-build.1 @@ -420,8 +420,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo build \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo build \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .sp \fB\-\-future\-incompat\-report\fR diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1 index 1aada2a217e..fdbb84647a4 100644 --- a/src/etc/man/cargo-check.1 +++ b/src/etc/man/cargo-check.1 @@ -401,8 +401,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo check \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo check \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .sp \fB\-\-future\-incompat\-report\fR diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index 24621e9f6e2..2bdd8867b2b 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -368,8 +368,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo doc \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo doc \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SH "ENVIRONMENT" See \fIthe reference\fR for diff --git a/src/etc/man/cargo-fix.1 b/src/etc/man/cargo-fix.1 index 7f2a34cda68..61083f21423 100644 --- a/src/etc/man/cargo-fix.1 +++ b/src/etc/man/cargo-fix.1 @@ -496,8 +496,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo fix \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo fix \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SH "ENVIRONMENT" See \fIthe reference\fR for diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1 index 917c0d0e19f..5ca3180fda7 100644 --- a/src/etc/man/cargo-install.1 +++ b/src/etc/man/cargo-install.1 @@ -346,8 +346,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo install \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo install \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SS "Display Options" .sp diff --git a/src/etc/man/cargo-package.1 b/src/etc/man/cargo-package.1 index 8a7b1c191cf..f845cbc04ff 100644 --- a/src/etc/man/cargo-package.1 +++ b/src/etc/man/cargo-package.1 @@ -242,8 +242,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo package \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo package \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SS "Display Options" .sp diff --git a/src/etc/man/cargo-publish.1 b/src/etc/man/cargo-publish.1 index d18f9e6907c..1f36abaa2e7 100644 --- a/src/etc/man/cargo-publish.1 +++ b/src/etc/man/cargo-publish.1 @@ -192,8 +192,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo publish \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo publish \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SS "Display Options" .sp diff --git a/src/etc/man/cargo-run.1 b/src/etc/man/cargo-run.1 index 1c182ad1a2a..2938146743b 100644 --- a/src/etc/man/cargo-run.1 +++ b/src/etc/man/cargo-run.1 @@ -305,8 +305,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo run \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo run \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SH "ENVIRONMENT" See \fIthe reference\fR for diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1 index 50df99656b6..501e9208eb0 100644 --- a/src/etc/man/cargo-rustc.1 +++ b/src/etc/man/cargo-rustc.1 @@ -419,8 +419,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo rustc \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo rustc \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .sp \fB\-\-future\-incompat\-report\fR diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1 index 1792c6e2fbd..0335d6e5484 100644 --- a/src/etc/man/cargo-rustdoc.1 +++ b/src/etc/man/cargo-rustdoc.1 @@ -387,8 +387,13 @@ Should not be 0. \fB\-\-keep\-going\fR .RS 4 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 -\fB\-Zunstable\-options\fR\&. +the build on the first one that fails to build. +.sp +For example if the current package depends on dependencies \fBfails\fR and \fBworks\fR, +one of which fails to build, \fBcargo rustdoc \-j1\fR may or may not build the +one that succeeds (depending on which one of the two builds Cargo picked to run +first), whereas \fBcargo rustdoc \-j1 \-\-keep\-going\fR would definitely run both +builds, even if the one run first fails. .RE .SH "ENVIRONMENT" See \fIthe reference\fR for diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1 index 4ca150dbcb1..8e460e167f6 100644 --- a/src/etc/man/cargo-test.1 +++ b/src/etc/man/cargo-test.1 @@ -542,6 +542,18 @@ produced during execution of this command .sp See \fBcargo\-report\fR(1) .RE +.sp +While \fBcargo test\fR involves compilation, it does not provide a \fB\-\-keep\-going\fR +flag. Use \fB\-\-no\-fail\-fast\fR to run as many tests as possible without stopping at +the first failure. To \[lq]compile\[rq] as many tests as possible, use \fB\-\-tests\fR to +build test binaries separately. For example: +.sp +.RS 4 +.nf +cargo build \-\-tests \-\-keep\-going +cargo test \-\-tests \-\-no\-fail\-fast +.fi +.RE .SH "ENVIRONMENT" See \fIthe reference\fR for details on environment variables that Cargo reads. diff --git a/tests/testsuite/cargo_build/help/stdout.log b/tests/testsuite/cargo_build/help/stdout.log index af906c24f42..e51a3b177dc 100644 --- a/tests/testsuite/cargo_build/help/stdout.log +++ b/tests/testsuite/cargo_build/help/stdout.log @@ -41,7 +41,7 @@ Compilation Options: -r, --release Build artifacts in release mode, with optimizations --profile Build artifacts with the specified profile -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error --target Build for the target triple --target-dir Directory for all generated artifacts --out-dir Copy final artifacts to this directory (unstable) diff --git a/tests/testsuite/cargo_check/help/stdout.log b/tests/testsuite/cargo_check/help/stdout.log index 7c87615cd72..8aee0bcce86 100644 --- a/tests/testsuite/cargo_check/help/stdout.log +++ b/tests/testsuite/cargo_check/help/stdout.log @@ -39,7 +39,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error -r, --release Check artifacts in release mode, with optimizations --profile Check artifacts with the specified profile --target Check for the target triple diff --git a/tests/testsuite/cargo_doc/help/stdout.log b/tests/testsuite/cargo_doc/help/stdout.log index 480e189c10e..d910c960a35 100644 --- a/tests/testsuite/cargo_doc/help/stdout.log +++ b/tests/testsuite/cargo_doc/help/stdout.log @@ -36,7 +36,7 @@ Target Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error -r, --release Build artifacts in release mode, with optimizations --profile Build artifacts with the specified profile --target Build for the target triple diff --git a/tests/testsuite/cargo_fix/help/stdout.log b/tests/testsuite/cargo_fix/help/stdout.log index c0a98218a23..cfd76a4ff07 100644 --- a/tests/testsuite/cargo_fix/help/stdout.log +++ b/tests/testsuite/cargo_fix/help/stdout.log @@ -44,7 +44,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error -r, --release Fix artifacts in release mode, with optimizations --profile Build artifacts with the specified profile --target Fix for the target triple diff --git a/tests/testsuite/cargo_install/help/stdout.log b/tests/testsuite/cargo_install/help/stdout.log index a07fa47f6fd..de23100f42e 100644 --- a/tests/testsuite/cargo_install/help/stdout.log +++ b/tests/testsuite/cargo_install/help/stdout.log @@ -42,7 +42,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error --profile Install artifacts with the specified profile --target Build for the target triple --target-dir Directory for all generated artifacts diff --git a/tests/testsuite/cargo_package/help/stdout.log b/tests/testsuite/cargo_package/help/stdout.log index 35e32f3133d..568cc5796c8 100644 --- a/tests/testsuite/cargo_package/help/stdout.log +++ b/tests/testsuite/cargo_package/help/stdout.log @@ -28,7 +28,7 @@ Compilation Options: --target Build for the target triple --target-dir Directory for all generated artifacts -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error Manifest Options: --manifest-path Path to Cargo.toml diff --git a/tests/testsuite/cargo_publish/help/stdout.log b/tests/testsuite/cargo_publish/help/stdout.log index c02522887a8..7f37ee56c09 100644 --- a/tests/testsuite/cargo_publish/help/stdout.log +++ b/tests/testsuite/cargo_publish/help/stdout.log @@ -26,7 +26,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error --target Build for the target triple --target-dir Directory for all generated artifacts diff --git a/tests/testsuite/cargo_run/help/stdout.log b/tests/testsuite/cargo_run/help/stdout.log index 6ab0e76b13f..c8777eaef56 100644 --- a/tests/testsuite/cargo_run/help/stdout.log +++ b/tests/testsuite/cargo_run/help/stdout.log @@ -30,7 +30,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error -r, --release Build artifacts in release mode, with optimizations --profile Build artifacts with the specified profile --target Build for the target triple diff --git a/tests/testsuite/cargo_rustc/help/stdout.log b/tests/testsuite/cargo_rustc/help/stdout.log index f587c327687..d6394effeab 100644 --- a/tests/testsuite/cargo_rustc/help/stdout.log +++ b/tests/testsuite/cargo_rustc/help/stdout.log @@ -41,7 +41,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error -r, --release Build artifacts in release mode, with optimizations --profile Build artifacts with the specified profile --target Target triple which compiles will be for diff --git a/tests/testsuite/cargo_rustdoc/help/stdout.log b/tests/testsuite/cargo_rustdoc/help/stdout.log index 4cac29e0af3..93c3ba85199 100644 --- a/tests/testsuite/cargo_rustdoc/help/stdout.log +++ b/tests/testsuite/cargo_rustdoc/help/stdout.log @@ -39,7 +39,7 @@ Feature Selection: Compilation Options: -j, --jobs Number of parallel jobs, defaults to # of CPUs. - --keep-going Do not abort the build as soon as there is an error (unstable) + --keep-going Do not abort the build as soon as there is an error -r, --release Build artifacts in release mode, with optimizations --profile Build artifacts with the specified profile --target Build for the target triple diff --git a/tests/testsuite/check.rs b/tests/testsuite/check.rs index 7bc9a38a3ad..b74bd620996 100644 --- a/tests/testsuite/check.rs +++ b/tests/testsuite/check.rs @@ -861,8 +861,7 @@ fn check_keep_going() { .build(); // Due to -j1, without --keep-going only one of the two bins would be built. - foo.cargo("check -j1 --keep-going -Zunstable-options") - .masquerade_as_nightly_cargo(&["keep-going"]) + foo.cargo("check -j1 --keep-going") .with_status(101) .with_stderr_contains("error: ONE") .with_stderr_contains("error: TWO")