top | item 41408980

(no title)

sp1rit | 1 year ago

Still, if you include transitive dependencies you end up with a total of 90 dependencies[0] which is unheard of in systems programming. This for some reason includes stuff like "winapi-i686-pc-windows-gnu" which really has no place for a set of linux software tools.

[0]:https://github.com/gentoo/gentoo/blob/master/sys-fs/bcachefs...

discuss

order

SkiFire13|1 year ago

> with a total of 90 dependencies[0] which is unheard of in systems programming

If the comparison is with C/C++ then the comparison is flawed:

- some you would never see in C/C++ because there's no point to them (e.g. safe bindings to system libraries)

- some are the same dependency but split in multiple crates to improve compile times (e.g. `anstyle`, `clap` and `regex`)

- some in C/C++ would just be vendored due to the difficulty of package management (see for example [0])

> This for some reason includes stuff like "winapi-i686-pc-windows-gnu" which really has no place for a set of linux software tools.

I don't know how Gentoo's build system works, but Cargo resolves the versions for *all dependencies*, including those that are conditionally compiled (e.g. based on the target OS). This is because the `Cargo.lock` file, which contains the actual dependencies versions used, is supposed to be versioned in e.g. git, and thus needs to be cross platform and be the same for everyone compiling the crate.

[0]:https://wiki.alopex.li/LetsBeRealAboutDependencies#gotta-go-...

est31|1 year ago

The winapi dependency comes from the rust tooling (cargo specifically) putting a great value on portability, and practical concerns like people collaborating from different platforms on the same project. Many Rust projects check their Cargo.lock into git (recommended for binaries, and also many libraries do it). Now imagine if the Cargo.lock changes depending on the platform, which one would you track in git?

Now, there is the separate concern of cargo-vendor downloading the winapi crate, which it does, also on Linux. It doesn't have to because winapi is never built, yet it still does it. That one I agree is a bit wasteful, but it's a known issue.