-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add "resolver = 2" option to workspace manifest examples #10625
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
Changes from 3 commits
a95f7ea
02a9086
2fcc7a8
ac65354
a718439
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ the workspace: | |
[workspace] | ||
members = ["member1", "path/to/member2", "crates/*"] | ||
exclude = ["crates/foo", "path/to/other"] | ||
resolver = "2" | ||
``` | ||
|
||
All [`path` dependencies] residing in the workspace directory automatically | ||
|
@@ -101,6 +102,15 @@ workspace. This can be useful if some path dependencies aren't desired to be | |
in the workspace at all, or using a glob pattern and you want to remove a | ||
directory. | ||
|
||
The [`resolver`] key effects how a package that is depended on in multiple | ||
ways with different features are resolved. Some libraries depend on it being | ||
set to 2. | ||
|
||
An empty `[workspace]` table can be used with a `[package]` to conveniently | ||
create a workspace with the package and all of its path dependencies. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't quite fit within the current section Maybe we should move this into the "virtual workspace" section and only update that example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this paragraph, seems like this concept is explained well enough in the virtual workspace section There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The focus of my concern wasn't so much the duplication of information about virtual workspaces but that we are in the section about members and exclude keys and introducing the resolver key as if it belongs in that section. We then include the resolver key in each further section. I get the point of including the resolver key in each subsequent section, to try to remind people to use it, but it doesn't quite fit seeing an unexplained key and one that is only relevant when its a virtual workspace. This is why I was recommending to make this entire PR only touch the virtual workspace section. This PR does not have to do all of the lifting for helping users. We also have #10910. |
||
|
||
### Workspace selection | ||
|
||
Comment on lines
+110
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove |
||
When inside a subdirectory within the workspace, Cargo will automatically | ||
search the parent directories for a `Cargo.toml` file with a `[workspace]` | ||
definition to determine which workspace to use. The [`package.workspace`] | ||
|
@@ -128,6 +138,7 @@ used: | |
[workspace] | ||
members = ["path/to/member1", "path/to/member2", "path/to/member3/*"] | ||
default-members = ["path/to/member2", "path/to/member3/foo"] | ||
resolver = "2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove |
||
``` | ||
|
||
When specified, `default-members` must expand to a subset of `members`. | ||
|
@@ -225,6 +236,7 @@ configuration in `Cargo.toml`. For example: | |
```toml | ||
[workspace] | ||
members = ["member1", "member2"] | ||
resolver = "2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove |
||
|
||
[workspace.metadata.webcontents] | ||
root = "path/to/webproject" | ||
|
@@ -243,6 +255,7 @@ if that makes sense for the tool in question. | |
[`Cargo.lock`]: ../guide/cargo-toml-vs-cargo-lock.md | ||
[package-metadata]: manifest.md#the-metadata-table | ||
[output directory]: ../guide/build-cache.md | ||
[`resolver`]: resolver.md#feature-resolver-version-2 | ||
[patch]: overriding-dependencies.md#the-patch-section | ||
[replace]: overriding-dependencies.md#the-replace-section | ||
[profiles]: profiles.md | ||
|
Uh oh!
There was an error while loading. Please reload this page.