-
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
Cargo add support for workspace inheritance #10606
Conversation
…g from a workspace dependency
… different source
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.
I reviewed this in smaller pieces in muscraft's fork.
While nothing is explicitly put behind the feature flag, any of this working presupposes the feature flag, so that should be fine.
This is only additive and doesn't have real difference of behavior from what was merged already.
We do some re-parsing of files multiple times but this is not a performance sensitive command, so it should be fine. We can see if/when people have an issue.
@bors r+ |
📌 Commit aa7d116 has been approved by |
☀️ Test successful - checks-actions |
Update cargo 8 commits in edffc4ada3d77799e5a04eeafd9b2f843d29fc23..f63f23ff1f1a12ede8585bbd1bbf0c536e50293d 2022-04-19 17:38:29 +0000 to 2022-04-28 03:15:50 +0000 - move workspace inheritance untable docs to the correct place (rust-lang/cargo#10609) - Cargo add support for workspace inheritance (rust-lang/cargo#10606) - chore: Upgrade toml_edit (rust-lang/cargo#10603) - Mark .cargo/git and .cargo/registry as cache dirs (rust-lang/cargo#10553) - fix(yank): Use '--version' like install (rust-lang/cargo#10575) - Disallow setting registry tokens with --config (rust-lang/cargo#10580) - Set cargo --version git hash length to 9 (rust-lang/cargo#10579) - Prefer `key.workspace = true` to `key = { workspace = true }` (rust-lang/cargo#10584)
Tracking issue: #8415
RFC: rust-lang/rfcs#2906
This PR adds all the required support for workspace inheritance within
cargo-add
. It was split up across a few different PRs as it requiredsnapbox
support from #10581 and a newtoml_edit
version from #10603. @epage and I decided to go ahead with this PR and add in some of the changes those PRs made. @epage's name on the commits is from helping to rewrite commits and some very minor additions.Changes:
cargo add foo
when afoo.workspace = true
already exists #10585cargo add foo
will inherit a workspace dependency Muscraft/cargo#3foo.workspace = true
with a dependency from a… Muscraft/cargo#4r? @epage