You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/doc/rustc-dev-guide/src/building/bootstrapping/writing-tools-in-bootstrap.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,22 @@ There are three types of tools you can write in bootstrap:
4
4
5
5
-**`Mode::ToolBootstrap`**
6
6
Use this for tools that don’t need anything from the in-tree compiler and can run with the stage0 `rustc`.
7
-
The output is placed in the "bootstrap-tools" directory. This mode is for general-purpose tools built
8
-
entirely with the stage0 compiler, including target libraries and only works for stage 0.
7
+
The output is placed in the "bootstrap-tools" directory.
8
+
This mode is for general-purpose tools built entirely with the stage0 compiler,
9
+
including target libraries and only works for stage 0.
9
10
10
11
-**`Mode::ToolStd`**
11
-
Use this for tools that rely on the locally built std. The output goes into the "stageN-tools" directory.
12
+
Use this for tools that rely on the locally built std.
13
+
The output goes into the "stageN-tools" directory.
12
14
This mode is rarely used, mainly for `compiletest` which requires `libtest`.
13
15
14
16
-**`Mode::ToolRustcPrivate`**
15
-
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
16
-
returned by the tool's [`Step`].
17
+
Use this for tools that use the `rustc_private` mechanism,
18
+
and thus depend on the locally built `rustc` and its rlib artifacts.
19
+
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.
20
+
When you choose `Mode::ToolRustcPrivate`, `ToolBuild` implementation takes care of this automatically.
21
+
If you need to use the builder’s compiler for something specific,
22
+
you can get it from `ToolBuildResult`, which is returned by the tool's [`Step`].
17
23
18
24
Regardless of the tool type you must return `ToolBuildResult` from the tool’s [`Step`] implementation and use `ToolBuild` inside it.
0 commit comments