Re:Zig, Rust, and Other Languages
by ViewTrick1002 on Saturday March 16, 2024 @08:07AM
(#39725177)
Automatic GC of the cargo cache is available on nightly. Really looking forward to it landing on stable. For large projects I've seen the cache grow to hundreds of GB, and not noticing it until the compilation fails because the disk is full...
https://blog.rust-lang.org/2023/12/11/cargo-cache-cleaning.h...
Re:Zig, Rust, and Other Languages
by galangalalgol on Saturday March 16, 2024 @12:09PM
(#39727094)
I've had the same issue with conan, and realizing only the. That is why our pipeline took so long, copying tens of GB to the runner. Cargo is mild by comparison.
Just w.r.t the issue of size (not of scale) - cargo caches sources in ~/.cargo so they're not shared by every project on the system. Additionally, rustc uses dead code elimination by design so there's not nearly as bad an issue as in JS where it's not possible to tree shake out every unused class or method.
Most of the bloat of target directories are stale incremental build artifacts, because cargo does not do any automatic cleanup.