Hacker News new | ask | show | jobs
by plmu 2363 days ago
Installation with yay/crate can be slow. This small tool took 4 minutes of compile time, the Rust crates seem to be very fine granular (like node.js vor example) and require much compile time. 204 crates needed to be compiled.

I found that, using yay or another aur helper on arch linux, having a few rust utilities installed that have regular updates, significantly slows down the average system upgrade time. I tend to avoid Rust programs for that reason.

4 comments

That's the nature of these spare time one (wo)man side projects: packaging a piece of software for a wide variety of distributions and platforms is tedious and boring, so unless there's a large community (or money) involved, you have to compile it from source.

Of course, you can always package your favourite utility for your favourite distribution. I'm sure the author would be thrilled to endorse your package in the Readme.

Note also that Rust can compile to portable static binaries. This tool is available as such from the releases page on GH (it's in the readme)

How is that musl based binary built ? I saw the repositories travis configuration and wasn't able to find anything relevant.
The simplest way is to pass the —target flag with the musl target; that should work unless you’re also including C code, and then it may Just Work or may need you to do something special.
I've been using `nethogs` for this for a long time, and it is already in most Linux repos and can be installed quickly.

https://github.com/raboof/nethogs

Not at my computer atm, but nethogs won't list the process name/PID, will it?
Yes it does. That's the whole point
RPM and DEB packaging are going to help make it available to about 90% of Enterprise and cloud based Linux environments respectively. It's well worth the effort IMHO.
I added a package that uses the pre-built binaries, `what-bin` in the AUR.
204 depedencies?! Is that normal for a Rust project?
Depends on the size. It’s not unheard of.
Rust has a really good package manager, so it's pretty standard for projects to depend on a lot of things just from that.
Not too many direct deps

Networking: pnet, ipnetwork, trust-dns-resolver,

UI: tui, termion, structopt (CLI is UI)

Utility: signal-hook, failure, chrono, regex, lazy_static,

Async: tokio, async-trait

None of those seem egregious.

Direct dependencies is irrelevant, I could create a single dependency that wraps all of these and the problem being discussed remains unchanged.