4 ms·
I'm a little annoyed that for a Rust based tool the recommended installation command is to use npm. Why? Is Cargo not good enough? Cargo seems exceptionally wel
by giancarlostoro 11mo ago
I'm a little annoyed that for a Rust based tool the recommended installation command is to use npm. Why? Is Cargo not good enough? Cargo seems exceptionally well to me.
- _sinelaw_ 11mo agoI did it because not everybody has cargo installed. I'm using cargo-dist to create this npm package.
- alienpingu 11mo agoi just used npx to try on my working machine where i do not have cargo
- giancarlostoro 11mo agoI've been wanting a generic package manager for a while that is cross-platform. I wonder how one could find funding for such a project. Thinking about users from various OS' installing tools and software from your niche package manager, yeah that bad boy is going to grind to a halt if you have no key funding.
- venturecruelty 11mo agoArtifactory exists. It's not hard to store packages and metadata somewhere.
- freeopinion 11mo agoBy cross-platform, do you really mean Linux/BSD/Mac/Win/ChromeOS/Android? Or do you just mean something like Guix?
- apatheticonion 11mo agoSame. I started writing one as a weekend project and got as far as having a GH repo with releases that mirror the binaries of the tools that I use, normalizing the archives so they can be installed in the same way. It auto-generates a release whenever the project authors update their projects. https://github.com/alshdavid/install-scripts/releases?q=nodejs&expanded=true https://github.com/alshdavid/install-scripts/releases?q=node... https://github.com/alshdavid/install-scripts/releases https://github.com/alshdavid/install-scripts/releases All of the binaries here are expected to be standalone/portable installations, so you can download/extract the archive and just run the binary. curl -L --url https://github.com/alshdavid/install-scripts/releases/download/terraform-1.14.1/terraform-1.14.1-linux-amd64.tar.gz | tar -xvzf - -C $HOME/.local/bin $HOME/.local/bin/terraform --help I haven't yet written a package manager yet, but I was planning for it to just do the same thing as above but figure out your OS/ARCH, handle extraction and also offer a PATH update system so you can run `eval $(xpkg env)` and PATH is updated automatically.
- craftkiller 11mo ago> generic package manager for a while that is cross-platform That would be Nix. Runs on any Linux distro and OSX. Also particularly useful for NixOS and NixBSD. https://nixos.org/download/ https://nixos.org/download/
- baq 11mo agoconsider wget or curl if possible (why not if npm was...)
- LoganDark 11mo agoIs there a way to install it with cargo instead? I won't install npm on my machine just to install a Rust package
- _sinelaw_ 11mo agoSure, cargo install fresh-editor
- ulbu 11mo agoi don’t (and won’t) have npm installed. i do have cargo. strange thinking!
- Barathkanna 11mo agoI get the frustration, but I think the npm option actually makes sense here. A lot of users who’d benefit from a fast Rust tool aren’t Rust developers and won’t have Cargo installed. Shipping it through npm lowers the barrier while still giving everyone the performance benefits. It’s not a knock on Cargo, just a way to make the tool more accessible.
- ljm 11mo agoGiven the fairly shoddy security story with NPM, I genuinely don't understand the hesitation to publish a binary and have a README instruction to curl/wget it into `/usr/local/bin` or `~/.local/bin`. If it's going through NPM that publishing step has to be done already, unless the NPM build is pulling down rust to compile it all as a native extension. Eventually it'd wangle it's way into homebrew or the unstable branch of another package registry. But that's me, because I really dislike installing binaries via a language's package manager, because they don't get updated unless I frequently run the upgrade commands for each package manager.
- _sinelaw_ 11mo agoThat (security ) is something I also worry about. I'd like to get off npm if only for this reason. It's a hack to get started. The other thing it gives you is the ability to easily upgrade and uninstall so just a script to copy stuff is not on par.
- ljm 11mo agoThing is… who is regularly running `npm update` or `cargo update` to keep local software up to date? I wouldn’t, because I might be in a repo and it starts upgrading all my local dependencies, and I’m not gonna add a text editor as a dev dependency. I’ll happily take the binary, or a tar.gz with the binary in it, though. (Btw I love how it’s following the old DOS aesthetic)
- _sinelaw_ 11mo agoThe npm distribution here is just the binary, you run npm install again and it upgrades to the latest binary. That's convenient
- port11 11mo agoCan't it be packaged as a binary/whatever that would install without either cargo or npm?
- _sinelaw_ 11mo agoYou can use: cargo install fresh-editor Or you can use npm Or you can download release binary packages from Github releases. The problem is which option to make more prominent / first
- port11 11mo agoOkay, in my case I like the binary from GitHub, and it's also more likely to end up in Homebrew.
- _sinelaw_ 11mo agoI took the feedback and now you can install binaries in any of these methods: - Homebrew (MacOS) - Arch Linux AUR - Debian/Ubuntu .deb - Fedora/RHEL .rpm as well as cargo install (which builds from source), npm, npx or building from source by cloning
- psvn 11mo agoCan you add to cargo binstall to install directly binary?