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

Category slugs assignment is not user friendly. #7035

Closed
vi opened this issue Jun 13, 2019 · 2 comments
Closed

Category slugs assignment is not user friendly. #7035

vi opened this issue Jun 13, 2019 · 2 comments
Labels
C-bug Category: bug

Comments

@vi
Copy link
Contributor

vi commented Jun 13, 2019

Problem

package.categories field in Cargo.toml is hard to get right on the first attempt.

Steps

  1. Start a new project: cargo new --lib somelib
  2. Do the code
  3. Fill in license, README and discoverability-related Cargo.toml fields
  4. cargo publish --dry-run
  5. cargo publish. warning: the following are not valid category slugs and were ignored: testing.
  6. Be annoyed that the flawed version got published, but it's too petty to yank or bump-and-reupload; so the discoverability penalty of not having the category will persist for long (because of subsequent versions of this mini-library may never be needed).
  7. Check the resulting crates.io page and discover that readme = "README.md" is also missed.

Possible Solution(s)

  • More comments in template Cargo.toml for libraries. In particular, https://crates.io/category_slugs link is hard to find. You need to fail the quest to get it from the "game over screen" (cargo warning that crate is published, but category ignored).
  • Error instead of warning if category is wrong
  • Real --dry-run. Actually connecting to crates.io and checking for all possible obstacles.
  • Maybe just including the entire list in https://doc.rust-lang.org/cargo/reference/manifest.html instead of just linking it. Or at least making crates.io/category_slugs part an actual, clickable link there.

Notes

Output of cargo version:

cargo 1.37.0-nightly (545f35425 2019-05-23)
@vi vi added the C-bug Category: bug label Jun 13, 2019
@ehuss
Copy link
Contributor

ehuss commented Jun 14, 2019

It was decided in #6881 to keep the new template to just the minimal basics, with a comment pointing to the documentation.

There is a desire to enhance the publish API to support things like dry-run. See rust-lang/crates.io#1522.

I don't know why invalid categories are warnings instead of errors. You'll need to file an issue on /~https://github.com/rust-lang/crates.io/issues.

@ehuss
Copy link
Contributor

ehuss commented Jun 24, 2019

I'm going to close this for now as the requested enhancements already have issues or are already well known, or not something in Cargo's control. We would definitely like to make the publishing process smoother, though!

@ehuss ehuss closed this as completed Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants