From ee3b8b70adb97264f69feb84aba0dd64b51ba36a Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Mon, 8 Sep 2025 06:48:10 +0200 Subject: [PATCH 1/3] sembr --- .../bootstrapping/writing-tools-in-bootstrap.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/building/bootstrapping/writing-tools-in-bootstrap.md b/src/building/bootstrapping/writing-tools-in-bootstrap.md index c3660e24b..f5f4dfadc 100644 --- a/src/building/bootstrapping/writing-tools-in-bootstrap.md +++ b/src/building/bootstrapping/writing-tools-in-bootstrap.md @@ -4,16 +4,22 @@ There are three types of tools you can write in bootstrap: - **`Mode::ToolBootstrap`** Use this for tools that don’t need anything from the in-tree compiler and can run with the stage0 `rustc`. - The output is placed in the "bootstrap-tools" directory. This mode is for general-purpose tools built - entirely with the stage0 compiler, including target libraries and only works for stage 0. + The output is placed in the "bootstrap-tools" directory. + This mode is for general-purpose tools built entirely with the stage0 compiler, + including target libraries and only works for stage 0. - **`Mode::ToolStd`** - Use this for tools that rely on the locally built std. The output goes into the "stageN-tools" directory. + Use this for tools that rely on the locally built std. + The output goes into the "stageN-tools" directory. This mode is rarely used, mainly for `compiletest` which requires `libtest`. - **`Mode::ToolRustcPrivate`** - Use this for tools that use the `rustc_private` mechanism, and thus depend on the locally built `rustc` and its rlib artifacts. This is more complex than the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools" directory. When you choose `Mode::ToolRustcPrivate`, `ToolBuild` implementation takes care of this automatically. If you need to use the builder’s compiler for something specific, you can get it from `ToolBuildResult`, which is - returned by the tool's [`Step`]. + Use this for tools that use the `rustc_private` mechanism, + and thus depend on the locally built `rustc` and its rlib artifacts. + This is more complex than the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools" directory. + When you choose `Mode::ToolRustcPrivate`, `ToolBuild` implementation takes care of this automatically. + If you need to use the builder’s compiler for something specific, + you can get it from `ToolBuildResult`, which is returned by the tool's [`Step`]. Regardless of the tool type you must return `ToolBuildResult` from the tool’s [`Step`] implementation and use `ToolBuild` inside it. From 1453fa42ed28ba218d48885f4d367749f188c57b Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Mon, 8 Sep 2025 06:50:14 +0200 Subject: [PATCH 2/3] fix markup --- src/building/bootstrapping/writing-tools-in-bootstrap.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/building/bootstrapping/writing-tools-in-bootstrap.md b/src/building/bootstrapping/writing-tools-in-bootstrap.md index f5f4dfadc..8bda22575 100644 --- a/src/building/bootstrapping/writing-tools-in-bootstrap.md +++ b/src/building/bootstrapping/writing-tools-in-bootstrap.md @@ -3,17 +3,20 @@ There are three types of tools you can write in bootstrap: - **`Mode::ToolBootstrap`** + Use this for tools that don’t need anything from the in-tree compiler and can run with the stage0 `rustc`. The output is placed in the "bootstrap-tools" directory. This mode is for general-purpose tools built entirely with the stage0 compiler, including target libraries and only works for stage 0. - **`Mode::ToolStd`** + Use this for tools that rely on the locally built std. The output goes into the "stageN-tools" directory. This mode is rarely used, mainly for `compiletest` which requires `libtest`. - **`Mode::ToolRustcPrivate`** + Use this for tools that use the `rustc_private` mechanism, and thus depend on the locally built `rustc` and its rlib artifacts. This is more complex than the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools" directory. From e6dbd25bbf34f607ebae8835cdff67c0317a582b Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Mon, 8 Sep 2025 06:54:04 +0200 Subject: [PATCH 3/3] readability --- src/building/bootstrapping/writing-tools-in-bootstrap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/building/bootstrapping/writing-tools-in-bootstrap.md b/src/building/bootstrapping/writing-tools-in-bootstrap.md index 8bda22575..8250a6f3b 100644 --- a/src/building/bootstrapping/writing-tools-in-bootstrap.md +++ b/src/building/bootstrapping/writing-tools-in-bootstrap.md @@ -7,7 +7,7 @@ There are three types of tools you can write in bootstrap: Use this for tools that don’t need anything from the in-tree compiler and can run with the stage0 `rustc`. The output is placed in the "bootstrap-tools" directory. This mode is for general-purpose tools built entirely with the stage0 compiler, - including target libraries and only works for stage 0. + including target libraries, and it only works for stage 0. - **`Mode::ToolStd`**