'Why is the target/debug/deps directory so big in rust
Today when I check the rust(1.54) folder, I found the target/debug/deps folder using 9.6GB .
➜ debug git:(main) ✗ du -sh deps
9.6G deps
why the rust target/debug/deps using so much space? is it possible to limit the space using? what should I do to optimize it. There is many files look like this:
reddwarf_admin-2f9d6d6d595f65af.2m9e5nlrurh2eiv4.rcgu.o
Solution 1:[1]
Cargo stores there all the results of the compilation (which is already quite big, since Rust's binaries are quite big already), but also much more information (all the incremental build information, as pointed out by @BailpointBen). Their purpose is to not have to recompile everything when making small changes. You can think of them as cache: you can freely delete it, but then the compiler is going to have to make these computations aggain. My advice would be to leave them be while you work on a project, and when you stop clean them, so you got ~10G space usage at most due to Rust cache, instead of piling up in each project you have.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
