-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(ref): Clarify workspace settings #11082
Conversation
In looking over rust-lang#10625, I remembered we've been having growing pains with the workspace documentation. It was originally written when there were a lot fewer workspace features. As more workspace features have been added, they've been tacked on to the documentation. This re-thinks the documentation by focusing on the schema, much like `manifest.md` does.
This is a part of the schema we were missing. A first step before encouraging people to use it is to document it!
In a workspace, only the workspace's profile is respected. This is already documented in the profile documentation but we should raise visibility of it within the workspace documentation.
The workspace behavior doesn't seem to be documented at all, so a blurb was brought in that is like the profile blurb. The workspace docs then link out to it so users can be aware of this special workspace behavior.
r? @weihanglo (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make it much easier to read!
* All packages share a common `Cargo.lock` file which resides in the | ||
*workspace root*. | ||
* All packages share a common [output directory], which defaults to a | ||
directory named `target` in the *workspace root*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the benefits of sharing a Cargo.lock
and one target
dir be explained?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For output, let's rely on the information in that link. For cargo.lock, let's mirror output and provide a link for more details.
This is a frequent reason I use them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link needs an update as well.
cargo/src/doc/src/reference/resolver.md
Line 431 in aaadab6
[virtual workspace]: workspaces.md#virtual-manifest |
It seems good if we can ship this doc enhancement in 1.64. Should we send a PR to beta as well? |
4411d28
to
4ea5dce
Compare
Thank you! @bors r+ |
☀️ Test successful - checks-actions |
3 commits in 4bcb3c65e440a12044092b85ffea8fac6cb96f42..387270bc7f446d17869c7f208207c73231d6a252 2022-08-17 21:01:34 +0000 to 2022-09-16 20:18:27 +0000 - Beta backport rust-lang/cargo#11082 (rust-lang/cargo#11097) - [Beta] Run `reach_max_unpack_size` test only on debug build (rust-lang/cargo#11090) - [beta] Fix for CVE-2022-36113 and CVE-2022-36114 (rust-lang/cargo#11088)
8 commits in 082503982ea0fb7a8fd72210427d43a2e2128a63..73ba3f35e0205844418260722c11602113179c4a 2022-09-13 17:49:38 +0000 to 2022-09-18 06:38:16 +0000 - Revert "Clarify when cargo detects changes" (rust-lang/cargo#11107) - Fix links to workspace inheritance headings in workspace docs (rust-lang/cargo#11103) - docs(ref): Clarify workspace settings (rust-lang/cargo#11082) - Update comment about ResolveVersion default version (rust-lang/cargo#11095) - [master] Run `reach_max_unpack_size` test only on debug build (rust-lang/cargo#11091) - Clarify when cargo detects changes (rust-lang/cargo#11092) - [master] Fix for CVE-2022-36113 and CVE-2022-36114 (rust-lang/cargo#11089) - Expose cargo add internals as edit API (rust-lang/cargo#11059)
3 commits in 4bcb3c65e440a12044092b85ffea8fac6cb96f42..387270bc7f446d17869c7f208207c73231d6a252 2022-08-17 21:01:34 +0000 to 2022-09-16 20:18:27 +0000 - Beta backport rust-lang/cargo#11082 (rust-lang/cargo#11097) - [Beta] Run `reach_max_unpack_size` test only on debug build (rust-lang/cargo#11090) - [beta] Fix for CVE-2022-36113 and CVE-2022-36114 (rust-lang/cargo#11088)
Update cargo (CVE fixes included) 8 commits in 082503982ea0fb7a8fd72210427d43a2e2128a63..73ba3f35e0205844418260722c11602113179c4a 2022-09-13 17:49:38 +0000 to 2022-09-18 06:38:16 +0000 - Revert "Clarify when cargo detects changes" (rust-lang/cargo#11107) - Fix links to workspace inheritance headings in workspace docs (rust-lang/cargo#11103) - docs(ref): Clarify workspace settings (rust-lang/cargo#11082) - Update comment about ResolveVersion default version (rust-lang/cargo#11095) - [master] Run `reach_max_unpack_size` test only on debug build (rust-lang/cargo#11091) - Clarify when cargo detects changes (rust-lang/cargo#11092) - [master] Fix for GHSA-rfj2-q3h3-hm5j and GHSA-2hvr-h6gw-qrxp (rust-lang/cargo#11089) - Expose cargo add internals as edit API (rust-lang/cargo#11059)
What does this PR try to resolve?
In reviewing the status of #10625, I was reminded
workspace.resolver
isn't documentedSo I re-organized the workspace docs to have a high level intro / behavior description and then to focus on being a field reference, much like
manifest.md
. I could see splitting it specifically into tutorial/reference like the overriding dependencies document does it.When adding
workspace.resolver
, I remembered in the nested workspace discussion there were other workspace related sections that are not present. We now link out toprofile
,patch
, andreplace
. In doing this, I realized thatpatch
andreplace
do not specify their workspace behavior, so I do that.How should we test and review this PR?
Look at it commit by commit to get more digestible chunks. Unfortunately, the first commit didn't split up so easily.
Additional information
Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->