From 6b0f46f40303911448ff3e8d6a0c00570829ea82 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 24 Nov 2022 22:32:07 -0500 Subject: [PATCH 1/3] Link directly to the section on `--keep-stage` --- src/building/how-to-build-and-run.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/building/how-to-build-and-run.md b/src/building/how-to-build-and-run.md index c5cf3166d..934254619 100644 --- a/src/building/how-to-build-and-run.md +++ b/src/building/how-to-build-and-run.md @@ -152,7 +152,9 @@ is what you need to build other Rust programs (unless you use `#![no_std]` or You will probably find that building the stage1 `std` is a bottleneck for you, but fear not, there is a (hacky) workaround... -see [the section on "recommended workflows"](./suggested.md) below. +see [the section on avoiding rebuilds for std][keep-stage]. + +[keep-stage]: ./suggested.md#incremental-builds-with---keep-stage Note that this whole command just gives you a subset of the full `rustc` build. The **full** `rustc` build (what you get with `./x.py build From e4a309867bd56d5f9d07372d79b8aac1288bcf24 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sat, 26 Nov 2022 17:32:50 -0500 Subject: [PATCH 2/3] Don't use "incremental" to refer to `--keep-stage` `-C incremental` is sound and --keep-stage is not. --- src/building/suggested.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/building/suggested.md b/src/building/suggested.md index 2b1bc24c0..09e470188 100644 --- a/src/building/suggested.md +++ b/src/building/suggested.md @@ -136,13 +136,13 @@ lets you use `cargo fmt`. [the section on vscode]: suggested.md#configuring-rust-analyzer-for-rustc [the section on rustup]: how-to-build-and-run.md?highlight=rustup#creating-a-rustup-toolchain -## Incremental builds with `--keep-stage`. +## Faster builds with `--keep-stage`. Sometimes just checking whether the compiler builds is not enough. A common example is that you need to add a `debug!` statement to inspect the value of some state or better understand the problem. In that case, you really need -a full build. By leveraging incremental, though, you can often get +a full build. By bypassing bootstrap's cache invalidation, you can often get these builds to complete very fast (e.g., around 30 seconds). The only catch is this requires a bit of fudging and may produce compilers that don't work (but that is easily detected and fixed). From 6984d77ed8cb22002a0af437109304f426b3b038 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 27 Nov 2022 00:31:11 -0500 Subject: [PATCH 3/3] Fix broken link Co-authored-by: Noah Lev --- src/building/how-to-build-and-run.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/building/how-to-build-and-run.md b/src/building/how-to-build-and-run.md index 934254619..46d4b9c04 100644 --- a/src/building/how-to-build-and-run.md +++ b/src/building/how-to-build-and-run.md @@ -154,7 +154,7 @@ You will probably find that building the stage1 `std` is a bottleneck for you, but fear not, there is a (hacky) workaround... see [the section on avoiding rebuilds for std][keep-stage]. -[keep-stage]: ./suggested.md#incremental-builds-with---keep-stage +[keep-stage]: ./suggested.md#faster-builds-with---keep-stage Note that this whole command just gives you a subset of the full `rustc` build. The **full** `rustc` build (what you get with `./x.py build