I'm curious why `npm` is used to install a `rust` binary?
I found that strange as well. My guess is that `npm` is just the package manager people are most likely to already have installed and doing it this way makes it easy. They might think asking people to install Cargo is too much effort. Wonder if the pattern of using npm to install non-node tools will keep gaining traction.
Google Workspace CLI
41–50 of 316 posts
Re: Google Workspace CLI
#42Haha in the world of AI/MCPs, all of a sudden we have a push for companies to properly build out APIs/CLI tools.
Re: Google Workspace CLI
#43Re: Google Workspace CLI
#44Haha in the world of AI/MCPs, all of a sudden we have a push for companies to properly build out APIs/CLI tools.
Re: Google Workspace CLI
#45I'm curious why `npm` is used to install a `rust` binary?
Re: Google Workspace CLI
#46Earlier quoted context omitted.
No package manager is. But of the ones that are installed by users, npm is probably the most popular.
What about pip? It's either installed or immediately available on many OSes
Re: Google Workspace CLI
#47I'm curious why `npm` is used to install a `rust` binary?
NPM as a cross platform package distribution system works really well. The install script checks the OS and Arch, and pulls the right Rust binary. Then, they get upgrade mechanism out of the box too, and an uninstall mechanism. NPM has become the de facto standard for installing any software these days, because it is present on every OS.
That's the arbitrary code execution at install time aspect of npm that developers should be extra wary of in this day and age. Saner node package managers like pnpm ignore the build script and you have to explicitly approve it on a case-by-case basis.
That said, you can execute code with build.rs with cargo too. Cargo is just not a build artifact distribution mechanism.
Re: Google Workspace CLI
#48Re: Google Workspace CLI
#49Interesting post from the main contributor about this (at least I assume it’s what he’s referencing) https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-ag...