-
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
Allow publishing from workspace root. #9559
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR! I think for now, there should not be a |
I'm not sure why it's failing, I'm going to rebase and see if that fixes it EDIT: Nevermind, I see the issue. |
src/cargo/ops/registry.rs
Outdated
let specs = opts.to_publish.to_package_id_specs(root_ws)?; | ||
let mut pkgs = root_ws.members_with_features(&specs, &opts.cli_features)?; | ||
|
||
anyhow::ensure!(pkgs.len() == 1, "can only publish one package at a time."); |
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.
Am I correct in reading this in that this will support many -p
flags and and --workspace
, but we'll just return an error if they get matched? If so, can this error be elaborated a bit as to why multiple packages aren't supported at this time? (perhaps linking to a tracking issue?)
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.
It won't take --workspace, but it will take multiple -p flags. Like @ehuss said this is due to an issue with crates.io, I couldn't find any tracking issue on their repo.
☔ The latest upstream changes (presumably #9645) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Sorry about the long delay.
Thanks! @bors r+ |
📌 Commit ae44e7cd6fb43a30b43080c8292d21c1dee0ff4f has been approved by |
⌛ Testing commit ae44e7cd6fb43a30b43080c8292d21c1dee0ff4f with merge 0f6642d170827f55f00eff5e537faf59f7b35ebd... |
💔 Test failed - checks-actions |
adds -p, --workspace, and --exclude to package command, and -p to publish command, as well as tests for both. closes #7345
Thanks! I pushed a small change to remove the unnecessary @bors r+ |
📌 Commit 30ff842 has been approved by |
☀️ Test successful - checks-actions |
Update cargo 8 commits in cebef2951ee69617852844894164b54ed478a7da..d21c22870e58499d6c31f1bef3bf1255eb021666 2021-07-22 13:01:52 +0000 to 2021-07-26 20:23:21 +0000 - Fix version string. (rust-lang/cargo#9727) - Allow publishing from workspace root. (rust-lang/cargo#9559) - Better msg for wrong position (rust-lang/cargo#9723) - Stabilize the rustc-link-arg option (rust-lang/cargo#9557) - Warning when using features in replace (rust-lang/cargo#9681) - Refactor if let chains to matches! macro (rust-lang/cargo#9721) - Weather is not nice today.. (rust-lang/cargo#9720) - Update should_use_metadata function (rust-lang/cargo#9653)
Update cargo 8 commits in cebef2951ee69617852844894164b54ed478a7da..d21c22870e58499d6c31f1bef3bf1255eb021666 2021-07-22 13:01:52 +0000 to 2021-07-26 20:23:21 +0000 - Fix version string. (rust-lang/cargo#9727) - Allow publishing from workspace root. (rust-lang/cargo#9559) - Better msg for wrong position (rust-lang/cargo#9723) - Stabilize the rustc-link-arg option (rust-lang/cargo#9557) - Warning when using features in replace (rust-lang/cargo#9681) - Refactor if let chains to matches! macro (rust-lang/cargo#9721) - Weather is not nice today.. (rust-lang/cargo#9720) - Update should_use_metadata function (rust-lang/cargo#9653)
Some minor updates for package/publish package selection. This is just a few small things I missed in the review of #9559. * Don't include the deprecated `--all` flag in `cargo package`. * Update the man pages for the new flags.
Adds -p, --workspace, and --exclude to package and publish commands.
Uses ephemeral workspaces to avoid changing the existing functions too much.
There might be more
Finished dev [unoptimized + debuginfo] target
messages when packaging than there should be, I couldn't figure out what was generating them.The tests aren't super extensive, as all the specs from arguments code should already be tested elsewhere.
Closes #7345