From: Peter Marheine Date: Mon, 8 Jan 2018 05:29:07 +0000 (+1100) Subject: Recover non-virtual default-members doc X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~55^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=27d4195d301ccb7c78da7481d1e8fc119c4f6f7f;p=cargo.git Recover non-virtual default-members doc First changed in f9a27fc1f7ef0e4360c878a0209370a86b310b5e which failed to update the book and was replaced in 1271bb4de0c0e0a085be239c2418af9c673ffc87. --- diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md index 95b120e4a..be69f9679 100644 --- a/src/doc/src/reference/manifest.md +++ b/src/doc/src/reference/manifest.md @@ -536,21 +536,24 @@ crate will be treated as a normal package, as well as a workspace. If the `package` table is not present in a workspace manifest, it is called a *virtual manifest*. -When working with *virtual manifests*, package-related cargo commands, like -`cargo build`, default to the set of packages specified by the `default-members` -configuration: +#### Package selection + +In a workspace, package-related cargo commands like `cargo build` apply to +packages selected by `-p` / `--package` or `--all` command-line parameters. +When neither is specified, the optional `default-members` configuration is used: ```toml [workspace] members = ["path/to/member1", "path/to/member2", "path/to/member3/*"] - -# The members that commands like `cargo build` apply to by deault. -# This must expand to a subset of `members`. -# Optional key, defaults to the same as `members` -# (as if `--all` were used on the command line). -default-members = ["path/to/member2", "path/to/member3/*"] +default-members = ["path/to/member2", "path/to/member3/foo"] ``` +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 +on the command-line) for virtual workspaces. + #TODO: move this to a more appropriate place ### The project layout