3 ms·
> It's my go-to solution for sharing build artifacts between rust projects Could you expand a bit please? As somebody who is too cheap to get more than the 256
by MuffinFlavored 3y ago
> It's my go-to solution for sharing build artifacts between rust projects
Could you expand a bit please? As somebody who is too cheap to get more than the 256gb MacBook, those heavy ~1gb random target/ directories add up over time. Didn't know there was an easy/cheap way around this?
- wongarsu 3y agosccache mostly helps to cut down build times. For saving space, the simplest trick is to use the same target/ for all your projects, by setting export CARGO_TARGET_DIR=/absolute/path/to/target Then you can just periodically nuke it once it grows too big. You can combine that with sccache (two-line setup as elsewhere in this thread) so nuking your target dir isn't as big of an impact on your build times. Though beware that projects that share a target dir can't build simultaneously. If you have multiple projects open that can get annoying, because it can also effect the language server. I'm that case you can use gentler measures like cargo-sweep.