Live data from Hacker News

“You meant to install ripgrep”

crates.io

121–130 of 165 posts

Re: “You meant to install ripgrep”

#121
It would be nice if crates supported being signed with GPG or minisign or whatever.

I can imagine for example, importing keys from only the authors that I think I can trust, and passing a flag to cargo that only allows using those packages for cargo install or cargo add.

In this case I think just checking the top level crates signature (and not dependencies) would be enough to mitigate a lot of issues including typo squatting.

Re: “You meant to install ripgrep”

#122

Can't tell you how often I've run: `pip install aws` This installs a library by some authors not affiliated with AWS. Instead of: `pip install awscli` Which is what you expect.

I'm frequently worried that I'm going to install malware on my machine doing this one of these days.

Re: “You meant to install ripgrep”

#124

Earlier quoted context omitted.

"gron | rg", because life is too short to learn jq. Amazing work on rg!

Wait, does ripgrep understand json or something??

No. `gron` understands JSON and flattens it, effectively turning it into line oriented data.

Re: “You meant to install ripgrep”

#125

It would be nice if crates supported being signed with GPG or minisign or whatever. I can imagine for example, importing keys from only the authors that I think I can trust, and passing a flag to cargo that only allows using those packages for cargo install or cargo add. In this case I think just checking the top level crates signature (and not dependencies) would be enough to mitigate a lot of issues including typo…

'cargo crev' makes this kind of workflow possible: https://github.com/crev-dev/cargo-crev

Re: “You meant to install ripgrep”

#126

If a package manager is starting from zero, and wants to have a privileged namespace such that a short name has a canonical value, it would make sense for those packages to be able to include a list of strings which the package should also reserve. That way "ripgrep" could include "rg", searching cargo for "rg" brings back "ripgrep", not a second package named "rg", and an install could tell the user the correct name…

While (afaik) this is not supposed to be used for typos, Arch Linux' provides enables 'synonyms' to be registered.

https://wiki.archlinux.org/title/PKGBUILD#provides

Re: “You meant to install ripgrep”

#127
post #8

Earlier quoted context omitted.

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

Yes, `cargo publish` has the `--no-verify` flag if you want to force this. I think all the verification is client-side.

There is some server side verification, mostly around checking that the dependencies all exist, the file isn't too large, etc. But 99% of the testing happens on the client.

Eg:

https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a...

https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a...

https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a...

https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a...

Re: “You meant to install ripgrep”

#128

If a package manager is starting from zero, and wants to have a privileged namespace such that a short name has a canonical value, it would make sense for those packages to be able to include a list of strings which the package should also reserve. That way "ripgrep" could include "rg", searching cargo for "rg" brings back "ripgrep", not a second package named "rg", and an install could tell the user the correct name…

I use fzf with an text file which lists all files installed by a package with the package name. That way if I know the header name, I can get the package name. If I know the package name, I can get all its files.

Re: “You meant to install ripgrep”

#129
post #64

Earlier quoted context omitted.

Because you hardly ever want to grep through your build artifacts or node modules? I don’t remember any one time I had to explicitly tell ripgrep to search through all the files in a repository

Ah, someone who hasn't experienced the... experience of working on a project that does very esoteric autotools magic. I will agree that in a sane project setup you don't need to search through all files including build artifacts ignored by git.

Even in an insane setup you generally don't want to search both at once. I find the pattern of first grepping non-ignored files and then cd-ing into my build directory or whatever and rerunning more helpful anyway.
Post reply on HN