Skip to content

Commit 0d18bd0

Browse files
committed
docs(faq): Include an entry on disk space
Seen a lot of threads where people are asking this question so I figured it would help if we had an official answer. Example: https://www.reddit.com/r/rust/comments/1perari/pain_point_of_rust/nseoj9p/
1 parent 5e7b660 commit 0d18bd0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/doc/src/faq.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,16 @@ causes and provide diagnostic techniques to help you out there:
294294
[conventions in place]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages
295295
[`direct-minimal-versions`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#direct-minimal-versions
296296
[custom merge tool]: https://github.com/rust-lang/cargo/issues/1818
297+
298+
## Why does my build take up so much space?
299+
300+
Cargo trades off disk space for faster builds including:
301+
- Maintaining a [cache] of intermediate build artifacts to avoid rebuilding everything when making changes to one package
302+
- Maintaining distinct [cache] entries for different combinations of toolchain versions, package versions, features, etc to avoid rebuilding packages when switching back and forth between configurations
303+
- Enabling [incremental compilation] for local packages for faster rebuilds for the package that changed
304+
- Enabling [debuginfo] in the [`dev` profile] in case you use a debugger
305+
306+
[incremental compilation]: reference/profiles.md#incremental
307+
[debuginfo]: reference/profiles.md#debug
308+
[`dev` profile]: reference/profiles.md#dev
309+
[cache]: reference/build-cache.md

0 commit comments

Comments
 (0)