-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(publish): add more check when use publish -p <SPEC>
#10677
Conversation
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. |
@ehuss PTAL~ |
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 think it would be good to add a test for the original issue. That is, you have a package with no [workspace]
, and that package has a path-dependency on bar
, and in the root you try to run cargo publish -p bar
. That I think should be an error for now.
Co-authored-by: Eric Huss <[email protected]>
Thanks! @bors r+ |
📌 Commit b486ada has been approved by |
☀️ Test successful - checks-actions |
@ehuss Thank you for your patient guidance these days! Wish the cargo community better and better! |
fix(publish): add more check when use `publish -p <SPEC>` ### Main issue As issue say rust-lang#10536 , we need add more check when user use `cargo publish -p <SPEC>` >`@ehuss` point outs: >From a behavior standpoint, here are some things to check: > - In the root of a virtual workspace, it should be an error to run without -p. >- It should be an error to pass -p for a non-workspace member. >- It should be an error for -p to match multiple packages. >- When using -p, it should publish that package, not the one in the current directory (which can be different).
[beta] Backport `cargo publish` fixes Beta backport of #10677. I think it is a serious regression where `cargo publish` may publish the wrong package in some circumstances. I think it warrants a beta backport to get the fix out asap.
Update cargo 5 commits in 39ad1039d9e3e1746177bf5d134af4c164f95528..38472bc19f2f76e245eba54a6e97ee6821b3c1db 2022-05-25 00:50:02 +0000 to 2022-05-31 02:03:24 +0000 - Emit warning upon encountering multiple packages with the same name (rust-lang/cargo#10701) - Guide new users to add use `super::*;` to `mod test` (rust-lang/cargo#10706) - Document how to debug change detection events (rust-lang/cargo#10708) - fix(publish): add more check when use `publish -p <SPEC>` (rust-lang/cargo#10677) - fix key formatting when switching to a dotted `WorkspaceSource` (rust-lang/cargo#10705)
Main issue
As issue say #10536 , we need add more check when user use
cargo publish -p <SPEC>