From baf5c020a3e4b4ce8e450a273627d8a94a293868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:11:47 +0800 Subject: [PATCH] Add remark on required free disk space (#2073) --- src/building/how-to-build-and-run.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/building/how-to-build-and-run.md b/src/building/how-to-build-and-run.md index 893a524d1..5df76584d 100644 --- a/src/building/how-to-build-and-run.md +++ b/src/building/how-to-build-and-run.md @@ -367,4 +367,18 @@ everything up then you only need to run one command! `rm -rf build` works too, but then you have to rebuild LLVM, which can take a long time even on fast computers. +## Remarks on disk space + +Building the compiler (especially if beyond stage 1) can require significant amounts of free disk +space, possibly around 100GB. This is compounded if you have a separate build directory for +rust-analyzer (e.g. `build-rust-analyzer`). This is easy to hit with dev-desktops which have a [set +disk +quota](https://github.com/rust-lang/simpleinfra/blob/8a59e4faeb75a09b072671c74a7cb70160ebef50/ansible/roles/dev-desktop/defaults/main.yml#L7) +for each user, but this also applies to local development as well. Occassionally, you may need to: + +- Remove `build/` directory. +- Remove `build-rust-analyzer/` directory (if you have a separate rust-analyzer build directory) +- Uninstall unnecessary toolchains if you use `cargo-bisect-rustc`. You can check which toolchains + are installed with `rustup toolchain list`. + [^1]: issue[#1707](https://github.com/rust-lang/rustc-dev-guide/issues/1707)