Skip to content

Commit 3f5ca7b

Browse files
committed
[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>
1 parent 37d12a5 commit 3f5ca7b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/doc/manifest.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ This field specifies a URL to a website hosting the crate's documentation.
4848
If no URL is specified in the manifest file, [crates.io][cratesio] will
4949
automatically link your crate to the corresponding [docs.rs][docsrs] page.
5050

51-
Documentation links from specific hosts are blacklisted. Hosts are added
52-
to the blacklist if they are known to not be hosting documentation and are
53-
possibly of malicious intent e.g. ad tracking networks. URLs from the
51+
Documentation links from specific hosts are blacklisted. Hosts are added
52+
to the blacklist if they are known to not be hosting documentation and are
53+
possibly of malicious intent e.g. ad tracking networks. URLs from the
5454
following hosts are blacklisted:
5555
- rust-ci.org
5656

@@ -485,6 +485,18 @@ and also be a member crate of another workspace (contain `package.workspace`).
485485
Most of the time workspaces will not need to be dealt with as `cargo new` and
486486
`cargo init` will handle workspace configuration automatically.
487487

488+
## Virtual Manifest
489+
490+
In workspace manifests, if the `package` table is present, the workspace root
491+
crate will be treated as a normal package, as well as a worksapce. If the
492+
`package` table is not present in a worksapce manifest, it is called a *virtual
493+
manifest*.
494+
495+
When working with *virtual manifests*, package-related cargo commands, like
496+
`cargo build`, won't be available anymore. But, most of such commands support
497+
the `--all` option, will execute the command for all the non-virtual manifest in
498+
the workspace.
499+
488500
# The project layout
489501

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

0 commit comments

Comments
 (0)