-
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
Warning on conflicting keys #10316
Warning on conflicting keys #10316
Conversation
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
I feel like cargo/src/cargo/util/toml/mod.rs Lines 1961 to 1966 in 58790d3
Edit: a few more fields in |
Sent an issue for this. #10317
Yes, I also found it. I will address it later. Thanks for your review. |
AFAIK this also affects |
e4d03ac
to
2a11cf3
Compare
@alexcrichton I'm not quite sure what this effect means? I've added dev-deps to my tests but it doesn't seem to have any effect? |
If we want to go so far as to warn on duplicate manifest keys like this (which I'm not 100% sold on but I won't block the effort) then there are other keys which can be duplicated, such as |
@alexcrichton I have created an issue to track other keys. #10317 |
dc3a4a3
to
2a11cf3
Compare
Sorry I'm kind of confused, this PR is addressing some conflicting keys but not others? Is there a reason to not address the known ones here all using the same infrastructure? |
My original thought was to warn only about the fields mentioned in the issue in this PR. So let me change them all in this PR. |
6b88b7d
to
4b3f2d4
Compare
@rustbot ready |
This comment was marked as outdated.
This comment was marked as outdated.
588e92b
to
c0bf37e
Compare
@alexcrichton Friendly Ping~ |
Thanks for the PR, but I'm going to be stepping down from the Cargo team so I'm going to un-assign myself from this. The Cargo team will help review this when they get a chance. |
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 would love to reuse a function to remove code duplication (though it helps little 🥲). And the warning message should point out that the old field is ignored. Something like
fn warn_on_deprecated(new_path: &str, name: &str, kind: &str, warnings: &mut Vec<String>) {
let old_path = new_path.replace("-", "_");
warnings.push(format!(
"conflicting between `{new_path}` and `{old_path}` in the `{name}` {kind}.\n
`{old_path}` is ignored and not recommended for use in the future"
))
}
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
486c771
to
961f0da
Compare
Added. Thanks for your review! 💚 💙 💜 💛 ❤️ |
Signed-off-by: hi-rustin <[email protected]>
961f0da
to
8b895cc
Compare
@bors r+ Thanks! |
📌 Commit 8b895cc has been approved by |
☀️ Test successful - checks-actions |
Update cargo 9 commits in 65c82664263feddc5fe2d424be0993c28d46377a..109bfbd055325ef87a6e7f63d67da7e838f8300b 2022-03-09 02:32:56 +0000 to 2022-03-17 21:43:09 +0000 - Refactor RegistryData::load to handle management of the index cache (rust-lang/cargo#10482) - Separate VCS command paths with "--" (rust-lang/cargo#10483) - Fix panic when artifact target is used for `[target.'cfg(<target>)'.dependencies` (rust-lang/cargo#10433) - Bump [email protected] and [email protected] (rust-lang/cargo#10479) - vendor: Don't allow multiple values for --sync (rust-lang/cargo#10448) - Use types to make clere (credential process || token) (rust-lang/cargo#10471) - Warning on conflicting keys (rust-lang/cargo#10316) - Registry functions return Poll to enable parallel fetching of index data (rust-lang/cargo#10064) - Refine the contributor guide (rust-lang/cargo#10468)
Signed-off-by: hi-rustin [email protected]
What does this PR try to resolve?
close #10299 and close #10317
How should we test and review this PR?