Skip to content

Commit

Permalink
Make it more clear we have two types of workspaces
Browse files Browse the repository at this point in the history
It needed a few rereads before I discovered the two flavours. Hope this helps.
  • Loading branch information
clemens-tolboom authored Aug 31, 2020
1 parent 6585cda commit ae28555
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/doc/src/reference/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@
A *workspace* is a collection of one or more packages that share common
dependency resolution (with a shared `Cargo.lock`), output directory, and
various settings such as profiles. Packages that are part of a workspaces are
called *workspace members*.
called *workspace members*. There are two flavours of workspaces: as root
package or as virtual manifest.

### Root package

A workspace can be created by adding a [`[workspace]`
section](#the-workspace-section) to `Cargo.toml`. This can be added to a
`Cargo.toml` that already defines a `[package]`, in which case the package is
the *root package* of the workspace. The *workspace root* is the directory
where the workspace's `Cargo.toml` is located.

### Virtual manifest

Alternatively, a `Cargo.toml` file can be created with a `[workspace]` section
but without a [`[package]` section][package]. This is called a *virtual
manifest*. This is typically useful when there isn't a "primary" package, or
you want to keep all the packages organized in separate directories.

### Key features

The key points of workspaces are:

* All packages share a common `Cargo.lock` file which resides in the
Expand Down

0 comments on commit ae28555

Please sign in to comment.