Skip to content
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: raise awareness of resolver used inside workspace #12388

Merged
merged 4 commits into from
Jul 26, 2023

Conversation

zvolin
Copy link
Contributor

@zvolin zvolin commented Jul 21, 2023

Workspaces by default use the resolver in version 1. It's been some time already since the 2021 edition which made version 2 a default for alone packages, but yet most of the projects that make a use of the workspaces still depends on an old resolver.

By being explicit about the resolver tag inside the workspace we can lower the usage of older resolver for the new projects.

This can raise the awareness of this behavior and prevent issues like #12387. I also wasn't aware of this behavior before while not being so new to Rust, and we have the resolver 2 for good reasons, so I think we should be more explicit about it in the documentation.
When someone looks for the 'how to make cargo workspace' answers, he's unlikely to get to the Dependency Resolution section at the same time, he'll likely just copy paste the workspace example from the Workspaces and call it a day, yet extending the usage of an old resolver and not benefiting from the new one.

Workspaces by default use the resolver in version 1. It's been
some time already since the 2021 edition which made version 2
a default for the alone packages, but yet most of the projects
that make a use of the workspaces still depends on an old resolver.

By being explicit about the resolver tag inside the workspace
we can lower the usage of older resolver for the new projects.
@rustbot
Copy link
Collaborator

rustbot commented Jul 21, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 21, 2023
@epage
Copy link
Contributor

epage commented Jul 21, 2023

I feel like there was another PR that did something similar that I wanted to reference for comparing but so far I can't find it.

As for raising awareness of this, in 1.72 we'll have a warning for this (#10910)

@weihanglo
Copy link
Member

@epage are you looking for this #10625?

@zvolin
Copy link
Contributor Author

zvolin commented Jul 21, 2023

Thanks, wasn't aware of #10910. It's great that there will be a warning, however I'm not sure if it makes changes to the documentation unneeded. Anyone who just goes through the Workspaces section and tries to use the examples will now face the warning right after

@epage
Copy link
Contributor

epage commented Jul 21, 2023

#10625 is what I intended and the comments won't translate 100% because we did do some documentation updates in #11082.

@epage
Copy link
Contributor

epage commented Jul 26, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 26, 2023

📌 Commit ddfa20b has been approved by epage

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2023
@bors
Copy link
Collaborator

bors commented Jul 26, 2023

⌛ Testing commit ddfa20b with merge 263d24b...

@epage
Copy link
Contributor

epage commented Jul 26, 2023

Thanks!

@bors
Copy link
Collaborator

bors commented Jul 26, 2023

☀️ Test successful - checks-actions
Approved by: epage
Pushing 263d24b to master...

@bors bors merged commit 263d24b into rust-lang:master Jul 26, 2023
18 checks passed
@zvolin zvolin deleted the docs-workspace-resolver branch July 26, 2023 17:51
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 31, 2023
Update cargo

14 commits in 7ac9416d82cd4fc5e707c9ec3574d22dff6466e5..c91a693e7977e33a1064b63a5daf5fb689f01651
2023-07-24 14:29:38 +0000 to 2023-07-31 00:26:46 +0000
- fix: align `cargo --help` text (rust-lang/cargo#12418)
- fix: normalize relative git submodule urls with `ssh://` (rust-lang/cargo#12411)
- test: relax help text assertion (rust-lang/cargo#12416)
- test: relax assertions of panic handler message format (rust-lang/cargo#12413)
- fix(package): Recognize and normalize `cargo.toml` (rust-lang/cargo#12399)
- Clarify `lto` setting passing `-Clinker-plugin-lto` (rust-lang/cargo#12407)
- doc: add missing reference to `CARGO_PROFILE_<name>_STRIP` in environment variables docs (rust-lang/cargo#12408)
- Update curl-sys to pull in curl 8.2.1 (rust-lang/cargo#12406)
- docs: raise awareness of resolver used inside workspace (rust-lang/cargo#12388)
- chore: update `home` to 0.5.7 (rust-lang/cargo#12401)
- Update curl-sys to pull in curl 8.2.0 (rust-lang/cargo#12400)
- test(cli): Track --help output (rust-lang/cargo#11912)
- refactor(test): Move cargo-config into a dir (rust-lang/cargo#12398)
- refactor(tests): Name init ui tests more consistently (rust-lang/cargo#12397)

r? `@ghost`
@ehuss ehuss added this to the 1.73.0 milestone Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants