-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Yanked crate shows in search list but is not installable #4679
Comments
So based on the implementation of let summaries = summaries.iter().filter(|&&(_, yanked)| {
dep.source_id().precise().is_some() || !yanked
}).map(|s| s.0.clone()); I am not quite sure why
...so I reckon it should be something used to handle The following code can quickly reproduce the problem. extern crate cargo;
use cargo::Config;
use cargo::core::Dependency;
use cargo::core::source::SourceId;
use cargo::core::registry::{PackageRegistry, Registry};
fn main() {
let config = Config::default().unwrap();
let source_id =
// to fix it, use SourceId::with_precise()
SourceId::from_url("registry+https://github.com/rust-lang/crates.io-index").unwrap();
println!("{:?}", source_id.precise());
let mut registry = PackageRegistry::new(&config).unwrap();
let query = Dependency::parse_no_deprecated("quickcheck", None, &source_id).unwrap();
let result = registry.query_vec(&query).unwrap();
for summary in result {
println!("{}", summary.version());
}
} |
As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it. I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect? The team would be especially grateful if such a comment included details such as:
Thank you for contributing! (The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.) If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
This is still relevant but I think there is some plumbing that has to be done in other components before this work can be done. |
Since we already have #4260 and #2608,. that just leaves I'm leaning towards proposing to the cargo team that we close this. Currently, we only show what the registry search returned and don't do any other processing. Once we have #948, that seems like the right way to then show more info. Also, a package that has all versions yanked seems like more of an anomaly and the cost/benefit ratio for polishing that corner doesn't seem to be there. |
Second. Thanks for the triage. |
I learned about
rustfmt
today and learned that it has cargo integration to enablecargo fmt
. I searched cargo from the command line and got this output:Ah ha!
cargo-fmt
is what I want, right? RIGHT?That's odd, it just showed up in the search!
I resort to the browser: https://crates.io/crates/cargo-fmt
Yanked. I think what I want is
rustfmt
. I installed it, and sure enough:I think my confusion could be avoided by:
cargo search
results that a package has been yanked. Maybe by highlighting the name in an ANSI color and outputting a colored message at the bottom that says something like "Packages in yellow have been yanked and are not directly installable. See https://somewhere.else for more information."cargo-fmt
have some kind of text explaining why it was yanked and perhaps suggesting a next step (e.g. "PackageX
has superseded this package" or "This package was erroneously published" or something like that).Start requiring a reason for all yanks #2608 is probably a necessity for the second one.
Mismatch against yanked version doesn't inform user about yank #4260 seems related.
I filed an issue with crates.io about its part in this: rust-lang/crates.io#1153
The text was updated successfully, but these errors were encountered: