r/rust • u/pilpulon • 5d ago
A cargo fork that attempts to solve disk usage
I bumped into this interesting cargo fork -- has anyone used it? https://huacnlee.github.io/cargo/why/
It's apparently by the guy who built https://gpui-kit.com/
I wonder why this issue is not more upfront and center nowadays as I see many complaining about it.
0
Upvotes
12
u/avsaase 5d ago edited 5d ago
It's not clear to me what this does differently than kache which wraps rustc.
7
u/Proximyst 5d ago
We had a post just yesterday by the very same guy who forked cargo, complaining about the cargo cache sizes. The same posts have been happening and inspiring discussions for years. It does feel like it is pretty front-and-center of an issue in this community/sub, at least. What else would you expect?
5
u/xd009642 cargo-tarpaulin 5d ago
> why this issue is not more upfront and center nowadays
The Rust project has a lot of people working in a lot of areas often on a volunteer basis (so based on their own interests). But there is a project goal looking for funding on this so there should be progress coming https://goals.rust-lang.org/2026/target-dir-size.html
1
u/bitemyapp 5d ago
41.7 GiB? That's it?
Anyway, anyone interested in this issue might want to look at this fork of buck2 I've been experimenting with for my Linux distribution and desktop environment built in Rust: http://github.com/bitemyapp/shikka
1
u/tanmaynargas2901 4d ago
Read through their page. A decent chunk of the first-build win is just deps not carrying debug info, and you can get that on stock cargo today:
The shared deps across worktrees part is the more interesting bit. A shared CARGO_TARGET_DIR kind of does it already, but then worktrees block on each other's build lock and nothing ever gets evicted.
The size cap with day-old eviction is what I'd actually want upstream.
What would stop me installing it: it replaces ~/.cargo/bin/cargo and silently self-updates once a day by default. For the thing that runs every build.rs on my machine I'd want that off (CARGO_FORK_AUTO_UPDATE=0) or pinned.
-14
u/_filmil_ 5d ago
Disk is dirt cheap. Buy more disk, and done.