5 ms·
sccache 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 CARG
by wongarsu 3y ago
sccache 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.