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

Display yank reason once you can provide one via cargo #1153

Closed
colindean opened this issue Oct 30, 2017 · 2 comments
Closed

Display yank reason once you can provide one via cargo #1153

colindean opened this issue Oct 30, 2017 · 2 comments
Labels
A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Comments

@colindean
Copy link

I learned about rustfmt today and learned that it has cargo integration to enable cargo fmt. I searched cargo from the command line and got this output:

± (master *%) $ cargo search rustfmt
    Updating registry `https://github.com/rust-lang/crates.io-index`
rustfmt = "0.9.0"             # Tool to find and fix Rust formatting issues
rustfmt-nightly = "0.2.13"    # Tool to find and fix Rust formatting issues
rfmt = "0.1.0"                # Another Rust source code formatter.
scout = "1.1.0"               # Small fuzzy finder for the command line
cargo-make = "0.7.3"          # Rust task runner and build tool.
bcc-sys = "0.3.1"             # Rust binding to BPF Compiler Collection (BCC)
cargo-fmt = "0.1.0"           # Allows `rustfmt` to be called through `cargo`
imgui = "0.0.16"              # High-level Rust bindings to dear imgui
harbor = "0.1.0"              # Project manager for CoreOS fleets.
aries = "0.1.0"               # a web framwork for rust-lang.
... and 29 crates more (use --limit N to see more)

Ah ha! cargo-fmt is what I want, right? RIGHT?

± (master *%) $ cargo install cargo-fmt
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: could not find `cargo-fmt` in `registry https://github.com/rust-lang/crates.io-index`

That's odd, it just showed up in the search!

I resort to the browser: https://crates.io/crates/cargo-fmt

screen shot 2017-10-30 at 10 59 10 am

Yanked. I think what I want is rustfmt. I installed it, and sure enough:

  Installing /Users/colin/.cargo/bin/cargo-fmt
  Installing /Users/colin/.cargo/bin/rustfmt

I think my confusion could be avoided by:

  1. Convey in 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."
  2. Have the crate page for cargo-fmt have some kind of text explaining why it was yanked and perhaps suggesting a next step (e.g. "Package X has superseded this package" or "This package was erroneously published" or something like that).

That second one is probably the task for crates.io to tackle, although searching through the cargo repo for "yanked" shows that I'm not the first person to encounter a problem like this:

  1. Start requiring a reason for all yanks #2608
  2. Mismatch against yanked version doesn't inform user about yank #4260

I think I'm going to file a similar issue with cargo since there's potentially work to be done there, too.

@carols10cents
Copy link
Member

  1. is a duplicate of Yanked crates should be discounted/de-emphasized/demarcated somehow in search results #145 as far as the crates.io side, and then your Yanked crate shows in search list but is not installable cargo#4679 would cover displaying the yanked info in the results of cargo search (that change would need to be made in cargo).

I'm going to leave this issue open for crates.io displaying a yank reason to go with rust-lang/cargo#2608.

@carols10cents carols10cents changed the title Yanked crate shows in search list but is not installable Display yank reason once you can provide one via cargo Jun 28, 2018
@Turbo87
Copy link
Member

Turbo87 commented Jun 12, 2020

since rust-lang/cargo#2608 does not seem to have any movement I'm going to close this issue for now. should such a mechanism ever be implemented in cargo we can reopen the issue :)

@Turbo87 Turbo87 closed this as completed Jun 12, 2020
@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works and removed C-feature-request labels Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

No branches or pull requests

3 participants