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

cargo install with specific yanked version gives confusing "not found" error #8171

Closed
ehuss opened this issue Apr 28, 2020 · 2 comments · Fixed by #8565
Closed

cargo install with specific yanked version gives confusing "not found" error #8171

ehuss opened this issue Apr 28, 2020 · 2 comments · Fixed by #8565
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-install

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 28, 2020

cargo install with a specific version that has been yanked gives a slightly confusing error:

> cargo install cargo-tarpaulin --version 0.10.1
error: could not find `cargo-tarpaulin` in registry `https://github.com/rust-lang/crates.io-index` with version `=0.10.1`

I think maybe it would be good to at least mention that it is yanked.

This is similar to #4260, where specified as a dependency also says "no matching version". In general, the yanked crates become invisible to resolution, and I'm wondering if maybe it should at least provide a hint.

@ehuss ehuss added A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-install labels Apr 28, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Apr 28, 2020

This is going to be hard to fix. The code literally filters out yanked crates. So the resolver code has know way to know that the yanked crates existit. This is done that way because the resolver is already too complicated and hard to understand, it has to intrinsically solve NP-Hard problems. So a O(n) filter is a grate win on the code complexity budget.

The one thought I had while writing this up is that in making the error message we re-query the registry several times to generate the versions found section. Maybe we can have that query include yanked versions, somehow.

@ehuss
Copy link
Contributor Author

ehuss commented Apr 28, 2020

For install, I was specifically thinking the install code could re-query, similar to what it does here. I agree that #4260 would be much harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-install
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants