Skip to content

pkgid spec confusion #7725

Open
Open

Description

The documentation for the package id spec (https://doc.rust-lang.org/1.40.0/cargo/reference/pkgid-spec.html) does not seem to be correct in several ways.

  • The proto is not optional. Cargo defaults to cargo:// which is not a scheme Cargo understands anywhere.
  • crates.io as a host does not work. It looks like you can only give the full path to the index, like https://github.com/rust-lang/crates.io-index#bitflags:1.2.1
  • host/name doesn't work. It looks like the matching code requires the entire scheme/host/path to match.

The question is, what should we do? Should we just remove all the things that don't work from the documentation? Or should we try to enhance the parsing/matching code to work better.

  • Should crates.io work as an alias for https://github.com/rust-lang/crates.io-index?
  • Missing proto probably shouldn't default to anything, and should probably match any proto.
  • Should host/name match host/path#name?

EDIT: #9188 and #9249 fixed the broken parts, but leaving this open to consider adding abbreviated forms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-bugCategory: bugCategory: bugCommand-pkgidS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions