#gentoo question for all you beautiful intelligent #gentoo mains out there: is installing rust packages via portage pointless? I installed media-sound/wiremix thinking ooo no new dependencies and it installed a zillion "crates" out of band. or is that probably why the package is masked currently?

EDIT: winning answer: that is normal, but portage will update it at least (among other things)

@aeva if you install a rust package via portage it will download the whole rust dependency tree and compile it, just like if you had done `cargo install`. however, because it's a system package now you get automatic updates instead of forgetting about it forever, if you want that. also for some apps like app-editors/helix, the `cargo install` version leaves you with a somewhat broken setup out of the box until you take some extra manual steps to put its runtime files where it needs them. whereas if you install with portage it's actually set up correctly on your system
@aeva portage managing the rust package also confers some benefits that you probably don't care about, like the build is network isolated (some people care about this). And also cross-compilation will usually just work if you were say using gentoo to build a raspberry pi image from an x86 machine.

so basically there is a lot of nice things it can provide, but none of them are "saving you from compile times". this is true of golang packages as well, just the nature of those languages really
@artemis that makes sense. is there a way to mask these all by default so I don't install them on accident?
@aeva mask all rust applications you mean?
@artemis just so I know that there's some extra care to be taken if I want to inspect dependencies and such
@aeva In a short answer, not *directly* like you're asking.

In a longer answer, the masking system allows you to mask all things from an overlay, all things from a package *category* (which doesnt help since "is written in rust" isnt a category), or specific packages / versions of packages

What you *could* do is run `equery depends --all-packages -F '$cp' dev-lang/rust | sort -u` to generate a list of every package that depends on rust, and write it to a file in /etc/portage/package.mask/

I think you can then unmask one by one with /etc/portage/package.unmask/ without having to remove them from this auto-generated file (but I might be wrong about this).

equery comes from the "app-portage/gentoolkit" package

You would also need to make this run after syncing... They added a way to put a post-sync hook for a script to run after syncing I know, but I dont know how you do that I've never done it myself
@aeva note that any `depends --all-packages` query will take awhile to run since it has to partially process every package in the repository but it does not take so long as to be unusable. (without --all-packages it only checks packages you have installed)
@artemis probably not worth it. it seems like only rust applications actually use rust libraries though, so tbh it shouldn't be much of a problem because i'm not installing unfamiliar applications without a little advanced research
@artemis like i was surprised that i didn't pull in rust-bin sooner
@aeva this is partially true I would say. There are some libraries being written in rust that expose a C-ABI interface, so that other applications can link against them, this I know. The one off the top of my head I can think of that are a bit common is gstreamer (which I believe is seeing some components ported to rust?), and librsvg (which is a gnome project, and a lot of core libraries use for their svg support). These may in turn have dependencies on rust crates. I can't recall others off the top of my head.