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

--dry-run does not validate dependencies #5941

Closed
VictorKoenders opened this issue Aug 27, 2018 · 4 comments
Closed

--dry-run does not validate dependencies #5941

VictorKoenders opened this issue Aug 27, 2018 · 4 comments
Labels
A-interacts-with-crates.io Area: interaction with registries C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-publish

Comments

@VictorKoenders
Copy link

Currently running cargo publish --dry-run succeeds if the crate has wildcard dependencies. It would be nice if --dry-run would fail or give a warning if there are wildcard dependencies

When running cargo publish, the user then gets (correctly) prompted this error:

error: api errors: wildcard (`*`) dependency constraints are not allowed on crates.io. See https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies for more information

Possibly other validations could be performed on a dry run as well

@alexcrichton alexcrichton added Command-publish C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Aug 27, 2018
joelgallant added a commit to joelgallant/cargo that referenced this issue Oct 7, 2018
@eminence
Copy link
Contributor

Triage: a cargo publish --dry-run today will still not give an error.

But I'm wondering: as best I can tell, the decision to reject packages with wildcard dependencies is a policy decision by crates.io, not cargo. Given that cargo can work with other registries, it doesn't seem like cargo itself should be checking this. In order to implement this feature, we could imagine an extension to the /api/v1/crates/new API could be used to ask the registry to do its own dry-run validation and return the results (but this obviously would require a bit of design work and coordination).

@ehuss
Copy link
Contributor

ehuss commented Nov 24, 2022

Yea, there's a brief overview of what a new publish API should handle at rust-lang/crates-io-cargo-teams#82. Dry-run and staged publishing would all be nice things to have.

@epage
Copy link
Contributor

epage commented Nov 24, 2022

Another perspective on this is that from cargo-release. I'd like everything validated before I've prompted the user on whether to release or not. It can be frustrating for users to get part way through to find an error, even if its recoverable (revert the release commit); its still speed bumps they have to deal with.

No idea what the right answer is though.

@epage
Copy link
Contributor

epage commented Oct 24, 2023

Added to #4377 and closing in favor of that

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interacts-with-crates.io Area: interaction with registries C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-publish
Projects
None yet
Development

No branches or pull requests

6 participants