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

Rejects publishing packages with wildcard version constraints (#5941) #6150

Closed
wants to merge 4 commits into from

Conversation

joelgallant
Copy link
Contributor

This should reject both --dry-run and a full cargo publish. It also only applies for the crates.io registry, which is probably fine, but easy to change.

@rust-highfive
Copy link

r? @matklad

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Thanks for the PR! I'm not really sure what the best way is to handle this though. These types of checks are left to be server-side on crates.io intentionally so crates.io can curate packages as necessary (and allow for different behavior across different registries). I'm wary about duplicating this sort of work across multiple locations, and if we want this to be a guarantee on crates.io we must implement it in on crates.io at least.

To that end I definitely agree that it's not great that --dry-run doesn't perform 100% of the checks of cargo publish, but I'm not sure it ever realistically can as crates.io can tweak various heuristics over time

@alexcrichton alexcrichton assigned alexcrichton and unassigned matklad Oct 8, 2018
@sfackler
Copy link
Member

sfackler commented Oct 8, 2018

One option could be to add a dry-run API to crates.io itself - the crate is still uploaded but crates.io only runs its checks and doesn't actually commit the publish.

@alexcrichton
Copy link
Member

That sounds like a great idea to me!

@joelgallant
Copy link
Contributor Author

Note that @sgrif has opened rust-lang/crates.io#1517, so once that lands this would be doable via hitting the API with dry_run=1 instead.

@sgrif
Copy link
Contributor

sgrif commented Oct 13, 2018

If, not when :)

@alexcrichton
Copy link
Member

Ok for now I'm going to close this as I think we probably won't want to take this particular strategy, but rust-lang/crates.io#1522 should hopefully provide a number of improvements for Cargo here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants