Skip to content

Commit 4d36721

Browse files
authored
docs(faq): Include an entry on disk space (#16349)
### What does this PR try to resolve? 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/ ### How to test and review this PR?
2 parents c617965 + 03245aa commit 4d36721

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

src/doc/src/CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,7 +2964,7 @@
29642964
- These settings can be configured in `[registry]` and `[registries]` tables.
29652965
- 🎉 `--keep-going` flag has been stabilized and is now available in each build command
29662966
(except `bench` and `test`, which have `--no-fail-fast` instead).
2967-
([docs](https://doc.rust-lang.org/cargo/commands/cargo-build.html#option-cargo-build---keep-going))
2967+
([docs](commands/cargo-build.md#option-cargo-build---keep-going))
29682968
[#12568](https://github.com/rust-lang/cargo/pull/12568)
29692969
- Added `--dry-run` flag and summary line at the end for `cargo clean`.
29702970
[#12638](https://github.com/rust-lang/cargo/pull/12638)
@@ -4130,7 +4130,7 @@
41304130
### Fixed
41314131
- 🚨 [CVE-2022-46176](https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j):
41324132
Added validation of SSH host keys for git URLs.
4133-
See [the docs](https://doc.rust-lang.org/cargo/appendix/git-authentication.html#ssh-known-hosts) for more information on how to configure the known host keys.
4133+
See [the docs](appendix/git-authentication.md#ssh-known-hosts) for more information on how to configure the known host keys.
41344134

41354135
## Cargo 1.66 (2022-12-15)
41364136
[08250398...rust-1.66.0](https://github.com/rust-lang/cargo/compare/08250398...rust-1.66.0)
@@ -6912,7 +6912,7 @@
69126912
### Added
69136913
- Registries may now display warnings after a successful publish.
69146914
[#6303](https://github.com/rust-lang/cargo/pull/6303)
6915-
- Added a [glossary](https://doc.rust-lang.org/cargo/appendix/glossary.html)
6915+
- Added a [glossary](appendix/glossary.md)
69166916
to the documentation. [#6321](https://github.com/rust-lang/cargo/pull/6321)
69176917
- Added the alias `c` for `cargo check`.
69186918
[#6218](https://github.com/rust-lang/cargo/pull/6218)

src/doc/src/faq.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,20 @@ causes and provide diagnostic techniques to help you out there:
290290
and `Cargo.toml` using a [custom merge tool].
291291

292292

293-
[links]: https://doc.rust-lang.org/cargo/reference/resolver.html#links
294-
[conventions in place]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages
293+
[links]: reference/resolver.md#links
294+
[conventions in place]: reference/build-scripts.md#-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

src/doc/src/reference/semver.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,8 +2033,8 @@ Mitigation strategies:
20332033
mechanism for new features. These are currently unstable and only available
20342034
in the nightly channel.
20352035

2036-
[select older versions of your package]: https://doc.rust-lang.org/cargo/reference/resolver.html#rust-version
2037-
[support expectations]: https://doc.rust-lang.org/cargo/reference/rust-version.html#support-expectations
2036+
[select older versions of your package]: resolver.md#rust-version
2037+
[support expectations]: rust-version.md#support-expectations
20382038

20392039
### Possibly-breaking: changing the platform and environment requirements {#env-change-requirements}
20402040

@@ -2303,7 +2303,7 @@ document what your commitments are.
23032303

23042304
[`cfg` attribute]: ../../reference/conditional-compilation.md#the-cfg-attribute
23052305
[`no_std`]: ../../reference/names/preludes.html#the-no_std-attribute
2306-
[`package.rust-version`]: https://doc.rust-lang.org/cargo/reference/rust-version.html
2306+
[`package.rust-version`]: rust-version.md
23072307
[`pub use`]: ../../reference/items/use-declarations.html
23082308
[Cargo feature]: features.md
23092309
[Cargo features]: features.md

src/doc/src/reference/source-replacement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ registry = "https://example.com/path/to/index"
110110

111111
[protocols]: registries.md#registry-protocols
112112

113-
[crates.io index]: https://doc.rust-lang.org/cargo/reference/registry-index.html
113+
[crates.io index]: registry-index.md
114114

115115
## Local Registry Sources
116116

0 commit comments

Comments
 (0)