Skip to content

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented May 27, 2022

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.

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).
@rust-highfive
Copy link

@ehuss: no appropriate reviewer found, use r? to override

@rust-highfive
Copy link

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against rust-1.62.0. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 27, 2022
@weihanglo
Copy link
Member

Make sense

@bors r+

@bors
Copy link
Contributor

bors commented May 27, 2022

📌 Commit 735f2c8 has been approved by weihanglo

@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 27, 2022
@bors
Copy link
Contributor

bors commented May 27, 2022

⌛ Testing commit 735f2c8 with merge 4751950...

@bors
Copy link
Contributor

bors commented May 27, 2022

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing 4751950 to rust-1.62.0...

@bors bors merged commit 4751950 into rust-lang:rust-1.62.0 May 27, 2022
@ehuss ehuss added this to the 1.62.0 milestone Jun 1, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 2, 2022
[beta] Beta backports

* Allow the unused_macro_rules lint for now rust-lang#97032
* Fix some typos in arg checking algorithm rust-lang#97303
* rustc: Fix ICE in native library error reporting rust-lang#97328
* Cargo:
    * Fix `cargo publish -p spec` rust-lang/cargo#10707
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.

4 participants