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

fix bugs with workspace key and update_toml #10685

Merged
merged 2 commits into from
May 20, 2022

Conversation

Muscraft
Copy link
Member

@Muscraft Muscraft commented May 20, 2022

Motivations and Context

When working on an external subcommand to help with the switch to workspace inheritance, I found issues with the output Cargo.toml it was creating. When a cargo_add::Dependency would change its source to a WorkspsaceSource, workspace = true would not show up. This lead me to discover that the default-features key was not being removed when the workspace key was set.

This fixes those issues but brought up questions about how to deal with removing keys and clearing conflicting fields in a Dependency. After talking with @epage, it was decided that this was the minimal set of changes to make while the changes to fix the other issues is workshopped.

Changes

  • add default-features to the list of keys to remove when the source is a WorkspaceSource
  • insert a workspace key when the source is a WorkspaceSource

@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2022
@Muscraft Muscraft force-pushed the cargo-add-workspace-source branch from 198f377 to ffc1053 Compare May 20, 2022 21:12
@Muscraft Muscraft changed the title fix WorkspaceSource's issues with rename and default-features fix bugs with workspace key and update_toml May 20, 2022
@epage
Copy link
Contributor

epage commented May 20, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented May 20, 2022

📌 Commit ffc1053 has been approved by epage

@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 May 20, 2022
@bors
Copy link
Collaborator

bors commented May 20, 2022

⌛ Testing commit ffc1053 with merge 83a7983...

@bors
Copy link
Collaborator

bors commented May 20, 2022

☀️ Test successful - checks-actions
Approved by: epage
Pushing 83a7983 to master...

@bors bors merged commit 83a7983 into rust-lang:master May 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2022
Update cargo

10 commits in a4c1cd0eb6b18082a7e693f5a665548fe1534be4..39ad1039d9e3e1746177bf5d134af4c164f95528
2022-05-20 00:55:25 +0000 to 2022-05-25 00:50:02 +0000

* doc: discuss build script instruction order (rust-lang/cargo#10600)
* Require http-registry URLs to end with a '/' (rust-lang/cargo#10698)
* No printing executable names when running tests and benchmarks with json message format (rust-lang/cargo#10691)
* Restore proper error for crate not in local reg (rust-lang/cargo#10683)
* Update libcurl (rust-lang/cargo#10696)
* Fixed small typos (rust-lang/cargo#10693)
* fix bugs with `workspace` key and `update_toml` (rust-lang/cargo#10685)
* Bump to 0.64.0, update changelog (rust-lang/cargo#10687)
* List C compiler as a build dependency in README (rust-lang/cargo#10678)
* Add unstable `rustc-check-cfg` build script output (rust-lang/cargo#10539)

r? `@ehuss`
@ehuss ehuss added this to the 1.63.0 milestone Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants