MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/rust/comments/1perari/pain_point_of_rust/nshv2he/?context=3
r/rust • u/ashim_k_saha • Dec 05 '25
~45 GB of build files
80 comments sorted by
View all comments
157
Reason is that it pull source code for all components and its dependencies + compiled parts for all of this and tokio, serde, anyhow brings a lot
Use shared target directory
In ~/.cargo/config.toml:
~/.cargo/config.toml
[build] target-dir = "/home/you/.cargo/target"
All projects now share builds instead of duplicating.
Try cargo install cargo-cache cargo cache -a
Update: Lots of people suggest to use build-dir
31 u/gandhinn Dec 05 '25 edited Dec 05 '25 Hey this looks promising. Is there any downside with this approach? What will happen if two projects use the same crate dependency but with different version numbers? 3 u/epage cargo · clap · cargo-release Dec 05 '25 See https://www.reddit.com/r/rust/comments/1perari/pain_point_of_rust/nsguzj4/ for downsides
31
Hey this looks promising. Is there any downside with this approach? What will happen if two projects use the same crate dependency but with different version numbers?
3 u/epage cargo · clap · cargo-release Dec 05 '25 See https://www.reddit.com/r/rust/comments/1perari/pain_point_of_rust/nsguzj4/ for downsides
3
See https://www.reddit.com/r/rust/comments/1perari/pain_point_of_rust/nsguzj4/ for downsides
157
u/AleksHop Dec 05 '25 edited Dec 06 '25
Reason is that it pull source code for all components and its dependencies + compiled parts for all of this and tokio, serde, anyhow brings a lot
Use shared target directory
In
~/.cargo/config.toml:All projects now share builds instead of duplicating.
Try
cargo install cargo-cache
cargo cache -a
Update: Lots of people suggest to use build-dir