Skip to content

Category slugs assignment is not user friendly. #7035

Closed
@vi

Description

@vi

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions