-
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
cargo publish
--package
flag is ignored when cargo isn't running in a workspace(?)
#10536
Comments
cargo publish
--package
flag is ignored when cargo isn't running in a workspacecargo publish
--package
flag is ignored when cargo isn't running in a workspace(?)
It seems reasonable to allow publishing a dependency as long as it is a path-dependency. If that is too hard to implement, then it should at least produce an error. |
@rustbot claim |
@ehuss Hi.May i ask. When we run |
Sorry I haven't had time to fix it lately, so I'm unassign myself. |
@ehuss Can you explain more about it? I will complete it.And i find when we publish ,we will chech if cargo/src/cargo/ops/registry.rs Lines 91 to 97 in 6d6dd9d
|
From a behavior standpoint, here are some things to check:
Checking those rules will require some additions to the |
Get. Its clear. I will work on it lately. |
fix(publish): add more check when use `publish -p <SPEC>` ### Main issue As issue say #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).
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).
Should be resolved with #10677. Closing. |
Problem
The
stacker
andpsm
crates are both part of the same repository, but they do not form a workspace. I tried publishingpsm
but cargo went on to try and publish a wrong crate (stacker
).Steps
stacker
repository is structured. 1 crate at the top level (stacker
) and another as a subdirectory (psm
);cd wherever-stacker-is
;cargo publish -p psm
.Possible Solution(s)
Cargo perhaps should return an error, or publish the specified crate.
Notes
Interestingly,
cargo test -p psm
does the right thing despite there being no workspace.Version
The text was updated successfully, but these errors were encountered: