Skip to content

Commit fe56d43

Browse files
committed
Auto merge of #4376 - behnam:virtual, r=alexcrichton
[docs/manifest] Add Virtual Manifest section Current documentation does not mention Virtual Manifests at all, which can be confusing because they appear in error messages. Here we add the definition, and provide a hint about `--all` option for most cargo commands, which allow the command to work in the way most probably expected. Fixes <#3526>
2 parents 287c028 + 3f5ca7b commit fe56d43

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/doc/manifest.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,18 @@ and also be a member crate of another workspace (contain `package.workspace`).
492492
Most of the time workspaces will not need to be dealt with as `cargo new` and
493493
`cargo init` will handle workspace configuration automatically.
494494

495+
## Virtual Manifest
496+
497+
In workspace manifests, if the `package` table is present, the workspace root
498+
crate will be treated as a normal package, as well as a worksapce. If the
499+
`package` table is not present in a worksapce manifest, it is called a *virtual
500+
manifest*.
501+
502+
When working with *virtual manifests*, package-related cargo commands, like
503+
`cargo build`, won't be available anymore. But, most of such commands support
504+
the `--all` option, will execute the command for all the non-virtual manifest in
505+
the workspace.
506+
495507
# The project layout
496508

497509
If your project is an executable, name the main source file `src/main.rs`. If it

0 commit comments

Comments
 (0)