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

Can't publish from workspace root, no -p option #7345

Closed
Riateche opened this issue Sep 9, 2019 · 2 comments · Fixed by #9559
Closed

Can't publish from workspace root, no -p option #7345

Riateche opened this issue Sep 9, 2019 · 2 comments · Fixed by #9559
Assignees
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-publish E-easy Experience: Easy

Comments

@Riateche
Copy link

Riateche commented Sep 9, 2019

Unlike other cargo commands, cargo publish doesn't accept -p or --package option, so cargo publish doesn't work at all at the workspace root:

$ cargo publish
error: manifest path `.../Cargo.toml` is a virtual manifest, but this command requires running against an actual package in this workspace
$ cargo publish -p name 
error: Found argument '-p' which wasn't expected, or isn't valid in this context

Lack of the -p option seems like an oversight.

@Riateche Riateche added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Sep 9, 2019
@sfackler
Copy link
Member

sfackler commented Sep 9, 2019

You can use cargo publish --manifest-path name/Cargo.toml, but a -p flag would be much cleaner.

@tcmal
Copy link
Contributor

tcmal commented Jun 5, 2021

@rustbot claim

bors added a commit that referenced this issue Jul 26, 2021
Allow publishing from workspace root.

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
@bors bors closed this as completed in 8f1f0e4 Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-publish E-easy Experience: Easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants