the current package is benchmarked. For more information on SPEC and its format,
see the `cargo help pkgid` command.
-All packages in the workspace are benchmarked if the `--all` flag is supplied. The
-`--all` flag is automatically assumed for a virtual manifest.
-Note that `--exclude` has to be specified in conjunction with the `--all` flag.
+All packages in the workspace are benchmarked if the `--workspace` flag is supplied. The
+`--workspace` flag is automatically assumed for a virtual manifest.
+Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.
The `--jobs` argument affects the building of the benchmark executable but does
not affect how many jobs are used when running the benchmarks.
.arg_build_plan()
.after_help(
"\
-All packages in the workspace are built if the `--all` flag is supplied. The
-`--all` flag is automatically assumed for a virtual manifest.
-Note that `--exclude` has to be specified in conjunction with the `--all` flag.
+All packages in the workspace are built if the `--workspace` flag is supplied. The
+`--workspace` flag is automatically assumed for a virtual manifest.
+Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.
Compilation can be configured via the use of profiles which are configured in
the manifest. The default profile for this command is `dev`, but passing
current package is built. For more information on SPEC and its format, see the
`cargo help pkgid` command.
-All packages in the workspace are checked if the `--all` flag is supplied. The
-`--all` flag is automatically assumed for a virtual manifest.
-Note that `--exclude` has to be specified in conjunction with the `--all` flag.
+All packages in the workspace are checked if the `--workspace` flag is supplied. The
+`--workspace` flag is automatically assumed for a virtual manifest.
+Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.
Compilation can be configured via the use of profiles which are configured in
the manifest. The default profile for this command is `dev`, but passing
current package is built. For more information on SPEC and its format, see the
`cargo help pkgid` command.
-All packages in the workspace are checked if the `--all` flag is supplied. The
-`--all` flag is automatically assumed for a virtual manifest.
-Note that `--exclude` has to be specified in conjunction with the `--all` flag.
+All packages in the workspace are checked if the `--workspace` flag is supplied. The
+`--workspace` flag is automatically assumed for a virtual manifest.
+Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.
To allow or deny a lint from the command line you can use `cargo clippy --`
with:
current package is tested. For more information on SPEC and its format, see the
`cargo help pkgid` command.
-All packages in the workspace are tested if the `--all` flag is supplied. The
-`--all` flag is automatically assumed for a virtual manifest.
-Note that `--exclude` has to be specified in conjunction with the `--all` flag.
+All packages in the workspace are tested if the `--workspace` flag is supplied. The
+`--workspace` flag is automatically assumed for a virtual manifest.
+Note that `--exclude` has to be specified in conjunction with the `--workspace` flag.
The `--jobs` argument affects the building of the test executable but does
not affect how many jobs are used when running the tests. The default value
exclude: &'static str,
) -> Self {
self.arg_package_spec_simple(package)
- ._arg(opt("all", all))
+ ._arg(opt(
+ "all",
+ "Will be changed to 'workspace' option (deprecated)",
+ ))
+ ._arg(opt("workspace", all))
._arg(multi_opt("exclude", "SPEC", exclude))
}
workspace: Option<&Workspace<'a>>,
) -> CargoResult<CompileOptions<'a>> {
let spec = Packages::from_flags(
- self._is_present("all"),
+ // TODO Integrate into 'workspace'
+ self._is_present("workspace") || self._is_present("all"),
self._values_of("exclude"),
self._values_of("package"),
)?;
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
+<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
<p>Benchmark only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
-<dt class="hdlist1"><strong>--all</strong></dt>
+<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Benchmark all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>…​</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
-<code>--all</code> flag. This flag may be specified multiple times.</p>
+<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-test.html">cargo-test(1)</a></p>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
+<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
<p>Build only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
-<dt class="hdlist1"><strong>--all</strong></dt>
+<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Build all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>…​</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
-<code>--all</code> flag. This flag may be specified multiple times.</p>
+<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-rustc.html">cargo-rustc(1)</a></p>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
+<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
<p>Check only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
-<dt class="hdlist1"><strong>--all</strong></dt>
+<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Check all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>…​</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
-<code>--all</code> flag. This flag may be specified multiple times.</p>
+<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-build.html">cargo-build(1)</a></p>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
+<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
<p>Document only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
-<dt class="hdlist1"><strong>--all</strong></dt>
+<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Document all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>…​</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
-<code>--all</code> flag. This flag may be specified multiple times.</p>
+<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-rustdoc.html">cargo-rustdoc(1)</a>, <a href="https://doc.rust-lang.org/rustdoc/index.html">rustdoc(1)</a></p>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
+<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
<p>Fix only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
-<dt class="hdlist1"><strong>--all</strong></dt>
+<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Fix all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>…​</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
-<code>--all</code> flag. This flag may be specified multiple times.</p>
+<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-check.html">cargo-check(1)</a></p>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
<p>The default members of a workspace can be set explicitly with the
<code>workspace.default-members</code> key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-<code>--all</code>), and a non-virtual workspace will include only the root crate itself.</p>
+<code>--workspace</code>), and a non-virtual workspace will include only the root crate itself.</p>
</div>
<div class="dlist">
<dl>
<p>Test only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
-<dt class="hdlist1"><strong>--all</strong></dt>
+<dt class="hdlist1"><strong>--workspace</strong></dt>
<dd>
<p>Test all members in the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--exclude</strong> <em>SPEC</em>…​</dt>
<dd>
<p>Exclude the specified packages. Must be used in conjunction with the
-<code>--all</code> flag. This flag may be specified multiple times.</p>
+<code>--workspace</code> flag. This flag may be specified multiple times.</p>
</dd>
</dl>
</div>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-bench.html">cargo-bench(1)</a></p>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
The default members of a workspace can be set explicitly with the
`workspace.default-members` key in the root manifest. If this is not set, a
virtual workspace will include all workspace members (equivalent to passing
-`--all`), and a non-virtual workspace will include only the root crate itself.
+`--workspace`), and a non-virtual workspace will include only the root crate itself.
*-p* _SPEC_...::
*--package* _SPEC_...::
{actionverb} only the specified packages. See man:cargo-pkgid[1] for the
SPEC format. This flag may be specified multiple times.
-*--all*::
+*--workspace*::
{actionverb} all members in the workspace.
*--exclude* _SPEC_...::
Exclude the specified packages. Must be used in conjunction with the
- `--all` flag. This flag may be specified multiple times.
+ `--workspace` flag. This flag may be specified multiple times.
#### Package selection
In a workspace, package-related cargo commands like [`cargo build`] apply to
-packages selected by `-p` / `--package` or `--all` command-line parameters.
+packages selected by `-p` / `--package` or `--workspace` command-line parameters.
When neither is specified, the optional `default-members` configuration is used:
```toml
When specified, `default-members` must expand to a subset of `members`.
When `default-members` is not specified, the default is the root manifest
-if it is a package, or every member manifest (as if `--all` were specified
+if it is a package, or every member manifest (as if `--workspace` were specified
on the command-line) for virtual workspaces.
### The project layout
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("bar/src/lib.rs", r"")
.build();
- p.cargo("build --all")
+ p.cargo("build --workspace")
.with_stderr(
"\
[WARNING] [..]/foo/Cargo.toml: unused manifest key: workspace.bulid
)
.build();
- p.cargo("bench --all")
+ p.cargo("bench --workspace")
.with_stderr_contains("[RUNNING] target/release/deps/bar-[..][EXE]")
.with_stdout_contains("test bench_bar ... bench: [..]")
.with_stderr_contains("[RUNNING] target/release/deps/foo-[..][EXE]")
)
.build();
- p.cargo("bench --all --exclude baz")
+ p.cargo("bench --workspace --exclude baz")
.with_stdout_contains(
"\
running 1 test
.build();
// The order in which bar and baz are built is not guaranteed
- p.cargo("bench --all")
+ p.cargo("bench --workspace")
.with_stderr_contains("[RUNNING] target/release/deps/baz-[..][EXE]")
.with_stdout_contains("test bench_baz ... bench: [..]")
.with_stderr_contains("[RUNNING] target/release/deps/bar-[..][EXE]")
fn cargo_compile_with_workspace_excluded() {
let p = project().file("src/main.rs", "fn main() {}").build();
- p.cargo("build --all --exclude foo")
+ p.cargo("build --workspace --exclude foo")
.with_stderr_does_not_contain("[..]virtual[..]")
.with_stderr_contains("[..]no packages to compile")
.with_status(101)
.file("bar/src/lib.rs", "pub fn bar() {}")
.build();
- p.cargo("build --all")
+ p.cargo("build --workspace")
.with_stderr(
"[..] Compiling bar v0.1.0 ([..])\n\
[..] Compiling foo v0.1.0 ([..])\n\
.file("baz/src/lib.rs", "pub fn baz() { break_the_build(); }")
.build();
- p.cargo("build --all --exclude baz")
+ p.cargo("build --workspace --exclude baz")
.with_stderr_contains("[..]Compiling foo v0.1.0 [..]")
.with_stderr_contains("[..]Compiling bar v0.1.0 [..]")
.with_stderr_does_not_contain("[..]Compiling baz v0.1.0 [..]")
.file("bar/examples/h.rs", "fn main() {}")
.build();
- p.cargo("build --all --examples")
+ p.cargo("build --workspace --examples")
.with_stderr(
"[..] Compiling bar v0.1.0 ([..])\n\
[..] Compiling foo v0.1.0 ([..])\n\
.build();
// The order in which bar and baz are built is not guaranteed
- p.cargo("build --all")
+ p.cargo("build --workspace")
.with_stderr_contains("[..] Compiling baz v0.1.0 ([..])")
.with_stderr_contains("[..] Compiling bar v0.1.0 ([..])")
.with_stderr(
.build();
// The order in which bar and baz are built is not guaranteed
- p.cargo("build --all --examples")
+ p.cargo("build --workspace --examples")
.with_stderr_contains("[..] Compiling baz v0.1.0 ([..])")
.with_stderr_contains("[..] Compiling bar v0.1.0 ([..])")
.with_stderr(
Package::new("a", "0.1.0").publish();
- p.cargo("build --all")
+ p.cargo("build --workspace")
.with_stderr(
"[UPDATING] `[..]` index\n\
[DOWNLOADING] crates ...\n\
.file("src/bar.rs", r#"fn main() { println!("bar"); }"#)
.build();
- p.cargo("build --all").run();
+ p.cargo("build --workspace").run();
p.process(&p.bin("foo")).with_stdout("foo\n").run();
p.process(&p.bin("bar")).with_stdout("bar\n").run();
}
.file("src/main.rs", r#"fn main() { println!("main"); }"#)
.build();
- p.cargo("build --all").run();
+ p.cargo("build --workspace").run();
p.process(&p.bin("foo")).with_stdout("main\n").run();
p.process(&p.bin("bar")).with_stdout("main\n").run();
}
.file("b/src/lib.rs", "")
.build();
- p.cargo("check --all -v")
+ p.cargo("check --workspace -v")
.with_stderr_contains("[..] --crate-name foo src/lib.rs [..]")
.with_stderr_contains("[..] --crate-name foo src/main.rs [..]")
.with_stderr_contains("[..] --crate-name b b/src/lib.rs [..]")
#[cargo_test]
fn exclude_warns_on_non_existing_package() {
let p = project().file("src/lib.rs", "").build();
- p.cargo("check --all --exclude bar")
+ p.cargo("check --workspace --exclude bar")
.with_stdout("")
.with_stderr(
r#"[WARNING] excluded package(s) bar not found in workspace `[CWD]`
)
.build();
- p.cargo("build -Z package-features --all --features main")
+ p.cargo("build -Z package-features --workspace --features main")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr_contains("[ERROR] cannot specify features for more than one package")
.with_stderr_contains("[ERROR] cannot specify features for packages outside of workspace")
.run();
- p.cargo("build -Z package-features --all --all-features")
+ p.cargo("build -Z package-features --workspace --all-features")
.masquerade_as_nightly_cargo()
.run();
p.cargo("run -Z package-features --package bar --features main")
.file("bar/build.rs", "fn main() {}")
.build();
- p.cargo("build --all").run();
+ p.cargo("build --workspace").run();
// This should not recompile!
p.cargo("build -p foo -v")
.with_stderr(
)
.build();
- p.cargo("build -vv --all")
+ p.cargo("build -vv --workspace")
.masquerade_as_nightly_cargo()
.with_stdout_contains("[member1 0.0.1] Hello mb1 [..]member1")
.with_stdout_contains("[member1 0.0.1] Hello mb2 [..]member1")
)
.build();
- p.cargo("build -vv --all")
+ p.cargo("build -vv --workspace")
.masquerade_as_nightly_cargo()
.with_stdout_contains("[member1 0.0.1] Hello mb1 [..]member1")
.with_stdout_contains("[member2 0.0.1] Hello mb2 [..]member2")
.file("bar/src/lib.rs", "#[test] fn bar_test() {}")
.build();
- p.cargo("test --all")
+ p.cargo("test --workspace")
.with_stdout_contains("test foo_test ... ok")
.with_stdout_contains("test bar_test ... ok")
.run();
.file("baz/src/lib.rs", "#[test] pub fn baz() { assert!(false); }")
.build();
- p.cargo("test --all --exclude baz")
+ p.cargo("test --workspace --exclude baz")
.with_stdout_contains(
"running 1 test
test bar ... ok",
.file("b/src/lib.rs", "#[test] fn b() {}")
.build();
- p.cargo("test --all")
+ p.cargo("test --workspace")
.with_stdout_contains("test a ... ok")
.with_stdout_contains("test b ... ok")
.run();
Package::new("a", "0.1.0").publish();
- p.cargo("test --all")
+ p.cargo("test --workspace")
.with_stdout_contains("test a ... ok")
.run();
}
Package::new("b", "0.1.0").publish();
- p.cargo("test --all -v").run();
+ p.cargo("test --workspace -v").run();
}
#[cargo_test]
.file("tests/z.rs", "#[test] fn test_z() {}")
.build();
- p.cargo("test --all")
+ p.cargo("test --workspace")
.with_stdout_contains(
"
running 1 test
.file("tests/foo.rs", "extern crate foo;")
.build();
- p.cargo("test --all").run();
+ p.cargo("test --workspace").run();
}
#[cargo_test]
.dep("bar", "0.1")
.file("src/lib.rs", "extern crate bar;")
.publish();
- p.cargo("test --all --target").arg(rustc_host()).run();
+ p.cargo("test --workspace --target").arg(rustc_host()).run();
}
#[cargo_test]
.file("a/src/lib.rs", "#[test] fn t1() {assert!(false)}")
.build();
- p.cargo("test --all")
+ p.cargo("test --workspace")
.with_stderr_contains("[ERROR] test failed, to rerun pass '-p a --lib'")
.with_status(101)
.run();
let p = p.build();
// Build the entire workspace.
- p.cargo("build --all")
+ p.cargo("build --workspace")
.with_stderr(
"\
[..]Compiling feat_lib v0.1.0 ([..])