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

Documentation: Package Id Spec kind lists file as an option instead of path #15048

Closed
Skgland opened this issue Jan 10, 2025 · 5 comments · Fixed by #15049
Closed

Documentation: Package Id Spec kind lists file as an option instead of path #15048

Skgland opened this issue Jan 10, 2025 · 5 comments · Fixed by #15049
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@Skgland
Copy link

Skgland commented Jan 10, 2025

Problem

While working on rust-lang/crater#758 in noticed that https://doc.rust-lang.org/cargo/reference/pkgid-spec.html defines kind as

kind = "registry" | "git" | "file"

but based on the examples I think it should be

kind = "registry" | "git" | "path"
@Skgland Skgland added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jan 10, 2025
@Skgland Skgland changed the title Package Id Spec kind lists file as an option instead of path Documentation: Package Id Spec kind lists file as an option instead of path Jan 10, 2025
epage added a commit to epage/cargo that referenced this issue Jan 10, 2025
@epage
Copy link
Contributor

epage commented Jan 10, 2025

I've posted #15049 for the docs but have you considered using PackageIdSpec::parse?

@Skgland
Copy link
Author

Skgland commented Jan 10, 2025

I have not as I wasn't aware of it, that appears to be a better option.

@Skgland
Copy link
Author

Skgland commented Jan 10, 2025

@epage it looks like the sparse kind for the sparse registry protocol is also missing

The index key should be a URL to a git repository with the registry’s index or a Cargo sparse registry URL with the sparse+ prefix.
- https://doc.rust-lang.org/cargo/reference/registries.html#using-an-alternate-registry

Skgland added a commit to Skgland/crater that referenced this issue Jan 10, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 10, 2025
Fixes #15048

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
@epage
Copy link
Contributor

epage commented Jan 10, 2025

iirc we paper over that difference when it comes to PackageIdSpec, e.g. I ran cargo pkgid <registry-dep> and got back a registry+https:// prefix

@Skgland
Copy link
Author

Skgland commented Jan 10, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants