From f7ab42f98f1478842463b0149b9f726e9be8ef4c Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 16 Nov 2022 21:39:29 -0500 Subject: [PATCH 1/2] Rename sysroot directories in docs --- src/building/bootstrapping.md | 22 +++++++++++----------- src/building/how-to-build-and-run.md | 4 ++-- src/building/suggested.md | 2 +- src/closure.md | 2 +- src/conventions.md | 2 +- src/rustdoc.md | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index 3bacc21d3..bdef1ebe3 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -401,7 +401,7 @@ manually. Otherwise, you get an error like the following: thread 'main' panicked at 'RUSTC_STAGE was not set: NotPresent', library/core/src/result.rs:1165:5 ``` -If `./stageN/bin/rustc` gives an error about environment variables, that +If `./stageN-sysroot/bin/rustc` gives an error about environment variables, that usually means something is quite wrong -- or you're trying to compile e.g. `rustc` or `std` or something that depends on environment variables. In the unlikely case that you actually need to invoke rustc in such a situation, @@ -413,7 +413,7 @@ This is an incomplete reference for the outputs generated by bootstrap: | Stage 0 Action | Output | |-----------------------------------------------------------|----------------------------------------------| -| `beta` extracted | `build/HOST/stage0` | +| `beta` extracted | `build/HOST/bootstrap-sysroot` | | `stage0` builds `bootstrap` | `build/bootstrap` | | `stage0` builds `test`/`std` | `build/HOST/stage0-std/TARGET` | | copy `stage0-std` (HOST only) | `build/HOST/stage0-sysroot/lib/rustlib/HOST` | @@ -427,24 +427,24 @@ This is an incomplete reference for the outputs generated by bootstrap: | Stage 1 Action | Output | |-----------------------------------------------------|---------------------------------------| -| copy (uplift) `stage0-rustc` executable to `stage1` | `build/HOST/stage1/bin` | -| copy (uplift) `stage0-codegen` to `stage1` | `build/HOST/stage1/lib` | -| copy (uplift) `stage0-sysroot` to `stage1` | `build/HOST/stage1/lib` | +| copy (uplift) `stage0-rustc` executable to `stage1` | `build/HOST/stage1-sysroot/bin` | +| copy (uplift) `stage0-codegen` to `stage1` | `build/HOST/stage1-sysroot/lib` | +| copy (uplift) `stage0-sysroot` to `stage1` | `build/HOST/stage1-sysroot/lib` | | `stage1` builds `test`/`std` | `build/HOST/stage1-std/TARGET` | -| copy `stage1-std` (HOST only) | `build/HOST/stage1/lib/rustlib/HOST` | +| copy `stage1-std` (HOST only) | `build/HOST/stage1-sysroot/lib/rustlib/HOST` | | `stage1` builds `rustc` | `build/HOST/stage1-rustc/HOST` | -| copy `stage1-rustc` (except executable) | `build/HOST/stage1/lib/rustlib/HOST` | +| copy `stage1-rustc` (except executable) | `build/HOST/stage1-sysroot/lib/rustlib/HOST` | | `stage1` builds `codegen` | `build/HOST/stage1-codegen/HOST` | `--stage=1` stops here. | Stage 2 Action | Output | |--------------------------------------------------------|-----------------------------------------------------------------| -| copy (uplift) `stage1-rustc` executable | `build/HOST/stage2/bin` | -| copy (uplift) `stage1-sysroot` | `build/HOST/stage2/lib and build/HOST/stage2/lib/rustlib/HOST` | +| copy (uplift) `stage1-rustc` executable | `build/HOST/stage2-sysroot/bin` | +| copy (uplift) `stage1-sysroot` | `build/HOST/stage2-sysroot/lib and build/HOST/stage2/lib/rustlib/HOST` | | `stage2` builds `test`/`std` (not HOST targets) | `build/HOST/stage2-std/TARGET` | -| copy `stage2-std` (not HOST targets) | `build/HOST/stage2/lib/rustlib/TARGET` | +| copy `stage2-std` (not HOST targets) | `build/HOST/stage2-sysroot/lib/rustlib/TARGET` | | `stage2` builds `rustdoc`, `clippy`, `miri` | `build/HOST/stage2-tools/HOST` | -| copy `rustdoc` | `build/HOST/stage2/bin` | +| copy `rustdoc` | `build/HOST/stage2-sysroot/bin` | `--stage=2` stops here. diff --git a/src/building/how-to-build-and-run.md b/src/building/how-to-build-and-run.md index c5cf3166d..156b47aaa 100644 --- a/src/building/how-to-build-and-run.md +++ b/src/building/how-to-build-and-run.md @@ -186,8 +186,8 @@ you will likely need to build at some point; for example, if you want to run the entire test suite). ```bash -rustup toolchain link stage1 build//stage1 -rustup toolchain link stage2 build//stage2 +rustup toolchain link stage1 build//stage1-sysroot +rustup toolchain link stage2 build//stage2-sysroot ``` The `` would typically be one of the following: diff --git a/src/building/suggested.md b/src/building/suggested.md index 2b1bc24c0..1e91debc5 100644 --- a/src/building/suggested.md +++ b/src/building/suggested.md @@ -34,7 +34,7 @@ you can write: `--edition=2021` argument yourself when calling `rustfmt` directly. diff --git a/src/rustdoc.md b/src/rustdoc.md index 23428efd6..5e6a6a2bd 100644 --- a/src/rustdoc.md +++ b/src/rustdoc.md @@ -46,7 +46,7 @@ does is call the `main()` that's in this crate's `lib.rs`, though.) * Use `./x.py build` to make a usable rustdoc you can run on other projects. * Add `library/test` to be able to use `rustdoc --test`. - * Run `rustup toolchain link stage2 build/$TARGET/stage2` to add a + * Run `rustup toolchain link stage2 build/$TARGET/stage2-sysroot` to add a custom toolchain called `stage2` to your rustup environment. After running that, `cargo +stage2 doc` in any directory will build with your locally-compiled rustdoc. From c4b4dd0b473b949ec756f1720a20a76edc616668 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 16 Nov 2022 23:22:43 -0500 Subject: [PATCH 2/2] Fix typo Co-authored-by: Tshepang Mbambo --- src/closure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/closure.md b/src/closure.md index 5cf13e8d8..1f90435d1 100644 --- a/src/closure.md +++ b/src/closure.md @@ -155,7 +155,7 @@ This uses the stage1 compiler and enables `debug!` logging for the The other option is to step through the code using lldb or gdb. -1. `rust-lldb $(rustup which rustc --toolchain stage1)` +1. `rust-lldb $(rustup which rustc --toolchain stage1) test.rs` 2. In lldb: 1. `b upvar.rs:134` // Setting the breakpoint on a certain line in the upvar.rs file` 2. `r` // Run the program until it hits the breakpoint