-
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 --dry-run
doesn't fail on invalid keywords
#14426
Comments
Note that the limitations are set by a single registry (crates.io), while Cargo needs to support different registries. |
Yep, that makes sense -- I think the idea marked (2) above would address that case, or (1) provided that (And thank you for triaging! Based on the set that's closed/still open, it seems like #4377 is the most immediately relevant to this piece of metadata.) |
Problem
First of all, thanks for maintaining
cargo
! I'm a very happy user.I've noticed a case where
cargo publish --dry-run
completes successfully, butcargo publish
will fail (forcrates.io
, and likely for other indices running the same stack).In particular: if the
keywords
field contains an entry longer than 20 characters,crates.io
will reject it. However,--dry-run
reports no issue with such a keyword.For example, the following
keywords
set will cause a publish failure:...because the last member (
static-site-generator
) is 21 characters long.The error message returned by
crates.io
suggests that a 20 character long keyword would also fail:Steps
keywords
member that's longer than 20 charscargo publish --dry-run
and observe that it succeedscargo publish
and observe that it failsPossible Solution(s)
Two possible solutions come to mind:
cargo publish --dry-run
's behavior so that these overlength keywords cause a failure with an appropriate error message. This would potentially cause overly eager error messages against other indices (i.e. other thancrates.io
), if those indices support longer keywords.crates.io
. This will prevent unexpected breakage against other indices, while still providing more of a heads up to users.There are probably other solutions, however!
Notes
No other notes.
Version
The text was updated successfully, but these errors were encountered: