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/building/bootstrapping/writing-tools-in-bootstrap.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,8 @@ There are three types of tools you can write in bootstrap:
11
11
Use this for tools that rely on the locally built std. The output goes into the "stageN-tools" directory.
12
12
This mode is rarely used, mainly for `compiletest` which requires `libtest`.
13
13
14
-
-**`Mode::ToolRustc`**
15
-
Use this for tools that depend on both the locally built `rustc` and the target `std`. This is more complex than
16
-
the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools"
17
-
directory. When you choose `Mode::ToolRustc`, `ToolBuild` implementation takes care of this automatically.
18
-
If you need to use the builder’s compiler for something specific, you can get it from `ToolBuildResult`, which is
14
+
-**`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
19
16
returned by the tool's [`Step`].
20
17
21
18
Regardless of the tool type you must return `ToolBuildResult` from the tool’s [`Step`] implementation and use `ToolBuild` inside it.
|`aux-bin`| Build a aux binary, made available in `auxiliary/bin` relative to test directory | All except `run-make`| Path to auxiliary `.rs` file |
58
-
|`aux-build`| Build a separate crate from the named source file | All except `run-make`| Path to auxiliary `.rs` file |
59
-
|`aux-crate`| Like `aux-build` but makes available as extern prelude | All except `run-make`|`<extern_prelude_name>=<path/to/aux/file.rs>`|
60
-
|`aux-codegen-backend`| Similar to `aux-build` but pass the compiled dylib to `-Zcodegen-backend` when building the main file |`ui-fulldeps`| Path to codegen backend file |
61
-
|`proc-macro`| Similar to `aux-build`, but for aux forces host and don't use `-Cprefer-dynamic`[^pm]. | All except `run-make`| Path to auxiliary proc-macro `.rs` file |
62
-
|`build-aux-docs`| Build docs for auxiliaries as well. Note that this only works with `aux-build`, not `aux-crate`. | All except `run-make`| N/A |
55
+
| Directive | Explanation | Supported test suites | Possible values |
|`aux-bin`| Build a aux binary, made available in `auxiliary/bin` relative to test directory | All except `run-make`/`run-make-cargo`| Path to auxiliary `.rs` file |
58
+
|`aux-build`| Build a separate crate from the named source file | All except `run-make`/`run-make-cargo`| Path to auxiliary `.rs` file |
59
+
|`aux-crate`| Like `aux-build` but makes available as extern prelude | All except `run-make`/`run-make-cargo`|`<extern_prelude_name>=<path/to/aux/file.rs>`|
60
+
|`aux-codegen-backend`| Similar to `aux-build` but pass the compiled dylib to `-Zcodegen-backend` when building the main file |`ui-fulldeps`| Path to codegen backend file |
61
+
|`proc-macro`| Similar to `aux-build`, but for aux forces host and don't use `-Cprefer-dynamic`[^pm]. | All except `run-make`/`run-make-cargo`| Path to auxiliary proc-macro `.rs` file |
62
+
|`build-aux-docs`| Build docs for auxiliaries as well. Note that this only works with `aux-build`, not `aux-crate`. | All except `run-make`/`run-make-cargo`| N/A |
63
63
64
64
[^pm]: please see the [Auxiliary proc-macro section](compiletest.html#auxiliary-proc-macro) in the compiletest chapter for specifics.
65
65
@@ -243,18 +243,18 @@ ignoring debuggers.
243
243
244
244
### Affecting how tests are built
245
245
246
-
| Directive | Explanation | Supported test suites | Possible values |
|`compile-flags`| Flags passed to `rustc` when building the test or aux file | All except for `run-make`| Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition`|
249
-
|`edition`| The edition used to build the test | All except for `run-make`| Any valid `--edition` value |
250
-
|`rustc-env`| Env var to set when running `rustc`| All except for `run-make`|`<KEY>=<VALUE>`|
251
-
|`unset-rustc-env`| Env var to unset when running `rustc`| All except for `run-make`| Any env var name |
252
-
|`incremental`| Proper incremental support for tests outside of incremental test suite |`ui`, `crashes`| N/A |
253
-
|`no-prefer-dynamic`| Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag |`ui`, `crashes`| N/A |
246
+
| Directive | Explanation | Supported test suites | Possible values |
|`compile-flags`| Flags passed to `rustc` when building the test or aux file | All except for `run-make`/`run-make-cargo`| Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition`|
249
+
|`edition`| The edition used to build the test | All except for `run-make`/`run-make-cargo`| Any valid `--edition` value |
250
+
|`rustc-env`| Env var to set when running `rustc`| All except for `run-make`/`run-make-cargo`|`<KEY>=<VALUE>`|
251
+
|`unset-rustc-env`| Env var to unset when running `rustc`| All except for `run-make`/`run-make-cargo`| Any env var name |
252
+
|`incremental`| Proper incremental support for tests outside of incremental test suite |`ui`, `crashes`| N/A |
253
+
|`no-prefer-dynamic`| Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag |`ui`, `crashes`| N/A |
254
254
255
255
<divclass="warning">
256
256
257
-
Tests (outside of `run-make`) that want to use incremental tests not in the
257
+
Tests (outside of `run-make`/`run-make-cargo`) that want to use incremental tests not in the
258
258
incremental test-suite must not pass `-C incremental` via `compile-flags`, and
259
259
must instead use the `//@ incremental` directive.
260
260
@@ -264,9 +264,9 @@ Consider writing the test as a proper incremental test instead.
264
264
265
265
### Rustdoc
266
266
267
-
| Directive | Explanation | Supported test suites | Possible values |
0 commit comments