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

cargo publish --dry-run finishes very early #11514

Closed
JulianKnodt opened this issue Dec 28, 2022 · 3 comments
Closed

cargo publish --dry-run finishes very early #11514

JulianKnodt opened this issue Dec 28, 2022 · 3 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@JulianKnodt
Copy link

Problem

I wanted to know what I was missing before running cargo publish, but did not accidentally want to publish a crate. When I ran cargo publish --dry-run it terminated before the upload, but it does not actually reach the point where it checks the Cargo.toml for validation errors. Thus, it seems to me that --dry-run is kind of pointless.

Proposed Solution

Make --dry-run error out only right before a crate is actually published, rather than before upload.

Notes

I'd be willing to implement this, if it is acceptable.

@JulianKnodt JulianKnodt added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 28, 2022
@ehuss
Copy link
Contributor

ehuss commented Dec 29, 2022

Can you say more about which validation errors did not seem to run?

If this is related to validation done on the server side, that would require implementing a new publishing API which is outlined in rust-lang/crates-io-cargo-teams#82. That is likely a large project that would require working mostly with the crates.io team, and possibly an RFC outlining the design.

@JulianKnodt
Copy link
Author

Specifically it was:

Caused by:
  the remote server responded with an error: missing or empty metadata fields: description, license. Please see https://doc.rust-lang.org/cargo/reference/manifest.html for how to upload metadata

Just checked the other issues and I understand why this is not something that can be resolved client-side, but maybe it would be worth it to differentiate server-side and client-side validation, even if there is an API for doing so?

@weihanglo
Copy link
Member

Thank you for the reply! crates.io is only one implementation of remote registries. Other registries may have different validations and requirements. Cargo at this moment sticks to a common minimal set of validations across different registries. I feel like it might break other registries publishing process for such kind of change.

Going to close this in favor of #5941, as more discussions happened there. If it is wrong, comment below and we can re-open this.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2022
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`
Projects
None yet
Development

No branches or pull requests

3 participants