Live data from Hacker News

“You meant to install ripgrep”

crates.io

1–10 of 165 posts

Re: “You meant to install ripgrep”

#5
post #2

`rg` has only one version, and one line of code: println!("You meant to install ripgrep: type `cargo uninstall rg` followed by `cargo install ripgrep`");

Seems like it would be better to contain:

    compile_error!("You meant to …");
so that the install would fail and `cargo uninstall rg` wouldn't be needed.

Re: “You meant to install ripgrep”

#6
post #4

Is there no way to have a package mirror, or alias or something? Unless I'm missing a joke or something, this seems like an easily solvable problem.

I think you would rather have explicitly named dependencies. I don't want a bunch of aliased dependencies redirecting to wherever

Re: “You meant to install ripgrep”

#7
post #4

Is there no way to have a package mirror, or alias or something? Unless I'm missing a joke or something, this seems like an easily solvable problem.

It is likely better to get the error and fix the mistake than be relying on an redirect owned and operated by who-knows-who indefinitely.

Re: “You meant to install ripgrep”

#8
post #5
post #2

`rg` has only one version, and one line of code: println!("You meant to install ripgrep: type `cargo uninstall rg` followed by `cargo install ripgrep`");

Seems like it would be better to contain: compile_error!("You meant to …"); so that the install would fail and `cargo uninstall rg` wouldn't be needed.

Can always-failing-to-compile crates be deployed to the registry?

Re: “You meant to install ripgrep”

#9
post #4

Is there no way to have a package mirror, or alias or something? Unless I'm missing a joke or something, this seems like an easily solvable problem.

Aliases turn a flat namespace into a potentially cyclical graph, and introduce all kinds of permission considerations (Should a non-owner be able to alias a project? If so, should they be allowed to update it?).

The solutions here are non-flat namespacing (which has worse UX, since `cargo install some-tool` now becomes `cargo install whats-their-handle-again/some-tool`) or some kind of content addressing (which is similarly bad for UX, if not worse). Most package indices choose neither, and "solve" the problem by playing whac-a-mole with abuse instead.

Re: “You meant to install ripgrep”

#10

Hah! TIL. I had no idea someone did this. But it's smart. I should have thought of it! (I'm the author of ripgrep.)

You should not have done this unless you want to further normalize the practice of namespace squatting. This is the same type of behavior leads to domain squatting. While arguably being slightly more benign in the sense of hedging against typosquatting, if everyone started going things like that, we'd quickly begin to run into namespace exhaustion problems as people started ballooning their package namespace footprint.

Before you do something like that, always ask yourself: "What if everyone else started doing this?"

If the result feels like a nightmare in the making, don't do it.

Post reply on HN