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

Mismatch against yanked version doesn't inform user about yank #4260

Open
crumblingstatue opened this issue Jul 8, 2017 · 4 comments
Open
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-diagnostics Area: Error and warning messages generated by Cargo itself. S-triage Status: This issue is waiting on initial triage.

Comments

@crumblingstatue
Copy link

Depending on bincode = "1.0.0-alpha7" produces the following error:

no matching version `^1.0.0-alpha7` found for package `bincode` (required by `whatever`)
location searched: registry https://github.com/rust-lang/crates.io-index
versions found: 0.8.0, 0.7.0, 0.6.1, ...

It doesn't mention the fact that there is a 1.0.0-alpha7, but it has been yanked.

This can leave the user confused about whether they mistyped something, or they are just trying to depend on a yanked version.

Semi-related: https://github.com/onur/docs.rs/issues/112#issuecomment-313868337

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Jul 10, 2017
@epage epage added A-dependency-resolution Area: dependency resolution and the resolver S-triage Status: This issue is waiting on initial triage. labels Oct 13, 2023
@epage
Copy link
Contributor

epage commented Oct 14, 2023

Looks like the error hasn't improved in the intervening time

#!/usr/bin/env nargo
```cargo
[dependencies]
bincode = "=1.0.0-alpha7"

fn main () {}

```console
$ ./cargo-4260.rs
warning: `package.edition` is unspecified, defaulting to `2021`
    Updating crates.io index
error: failed to select a version for the requirement `bincode = "=1.0.0-alpha7"`
candidate versions found which didn't match: 2.0.0-rc.3, 2.0.0-rc.2, 2.0.0-rc.1, ...
location searched: crates.io index
required by package `cargo-4260 v0.0.0 (/home/epage/src/personal/dump)`
if you are looking for the prerelease package it needs to be specified explicitly
    bincode = { version = "2.0.0-rc.3" }
perhaps a crate was updated and forgotten to be re-vendored?

@Eh2406 how bad would this be to improve the error in this case?

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 14, 2023

The resolver is reporting that the package doesn't exist, because it got filtered out and a much lower level of abstraction.
This is part of the work in https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/better.20error.20messages.20for.20filtered.20versions.2E

@glandium
Copy link
Contributor

glandium commented Feb 13, 2024

Not sure I should open a separate issue, but relatedly, the error from cargo update -p crate --precise yanked-version says error: no matching package named "crate" found, which is confusing.

@epage
Copy link
Contributor

epage commented Feb 13, 2024

Allowing --precise with yanked packages was implemented in #13333. It is currently unstable but we expect to stabilize it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-diagnostics Area: Error and warning messages generated by Cargo itself. S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

5 participants