Skip to content

Commit 75f3c2d

Browse files
authored
Unrolled build for #147172
Rollup merge of #147172 - notriddle:tooldoc, r=Kobzol bootstrap: build bootstrap docs with in-tree rustdoc All of the docs need to be built with the same rustdoc. Otherwise, any change to the search index breaks everything, because the two rustdocs don't agree on the format. Fixes #147142
2 parents 42d009c + ba13b6e commit 75f3c2d

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,12 +1024,9 @@ macro_rules! tool_doc {
10241024
run.builder.ensure(Rustc::from_build_compiler(run.builder, compilers.build_compiler(), target));
10251025
compilers.build_compiler()
10261026
}
1027-
Mode::ToolBootstrap => {
1028-
// bootstrap/host tools should be documented with the stage 0 compiler
1029-
prepare_doc_compiler(run.builder, run.builder.host_target, 1)
1030-
}
10311027
Mode::ToolTarget => {
1032-
// target tools should be documented with the in-tree compiler
1028+
// when shipping multiple docs together in one folder,
1029+
// they all need to use the same rustdoc version
10331030
prepare_doc_compiler(run.builder, run.builder.host_target, run.builder.top_stage)
10341031
}
10351032
_ => {
@@ -1132,7 +1129,11 @@ macro_rules! tool_doc {
11321129
tool_doc!(
11331130
BuildHelper,
11341131
"src/build_helper",
1135-
mode = Mode::ToolBootstrap,
1132+
// ideally, this would use ToolBootstrap,
1133+
// but we distribute these docs together in the same folder
1134+
// as a bunch of stage1 tools, and you can't mix rustdoc versions
1135+
// because that breaks cross-crate data (particularly search)
1136+
mode = Mode::ToolTarget,
11361137
is_library = true,
11371138
crates = ["build_helper"]
11381139
);
@@ -1175,25 +1176,25 @@ tool_doc!(
11751176
// "specialization" feature in its build script when it detects a nightly toolchain.
11761177
allow_features: "specialization"
11771178
);
1178-
tool_doc!(Tidy, "src/tools/tidy", mode = Mode::ToolBootstrap, crates = ["tidy"]);
1179+
tool_doc!(Tidy, "src/tools/tidy", mode = Mode::ToolTarget, crates = ["tidy"]);
11791180
tool_doc!(
11801181
Bootstrap,
11811182
"src/bootstrap",
1182-
mode = Mode::ToolBootstrap,
1183+
mode = Mode::ToolTarget,
11831184
is_library = true,
11841185
crates = ["bootstrap"]
11851186
);
11861187
tool_doc!(
11871188
RunMakeSupport,
11881189
"src/tools/run-make-support",
1189-
mode = Mode::ToolBootstrap,
1190+
mode = Mode::ToolTarget,
11901191
is_library = true,
11911192
crates = ["run_make_support"]
11921193
);
11931194
tool_doc!(
11941195
Compiletest,
11951196
"src/tools/compiletest",
1196-
mode = Mode::ToolBootstrap,
1197+
mode = Mode::ToolTarget,
11971198
is_library = true,
11981199
crates = ["compiletest"]
11991200
);

src/bootstrap/src/core/builder/tests.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,13 +1158,12 @@ mod snapshot {
11581158
[doc] embedded-book (book) <host>
11591159
[doc] edition-guide (book) <host>
11601160
[doc] style-guide (book) <host>
1161-
[build] rustdoc 0 <host>
1162-
[doc] rustc 0 <host> -> Tidy 1 <host>
1163-
[doc] rustc 0 <host> -> Bootstrap 1 <host>
1161+
[doc] rustc 1 <host> -> Tidy 2 <host>
1162+
[doc] rustc 1 <host> -> Bootstrap 2 <host>
11641163
[doc] rustc 1 <host> -> releases 2 <host>
1165-
[doc] rustc 0 <host> -> RunMakeSupport 1 <host>
1166-
[doc] rustc 0 <host> -> BuildHelper 1 <host>
1167-
[doc] rustc 0 <host> -> Compiletest 1 <host>
1164+
[doc] rustc 1 <host> -> RunMakeSupport 2 <host>
1165+
[doc] rustc 1 <host> -> BuildHelper 2 <host>
1166+
[doc] rustc 1 <host> -> Compiletest 2 <host>
11681167
[build] rustc 0 <host> -> RustInstaller 1 <host>
11691168
"
11701169
);
@@ -2686,8 +2685,11 @@ mod snapshot {
26862685
.path("src/tools/compiletest")
26872686
.stage(2)
26882687
.render_steps(), @r"
2689-
[build] rustdoc 0 <host>
2690-
[doc] rustc 0 <host> -> Compiletest 1 <host>
2688+
[build] llvm <host>
2689+
[build] rustc 0 <host> -> rustc 1 <host>
2690+
[build] rustc 1 <host> -> std 1 <host>
2691+
[build] rustdoc 1 <host>
2692+
[doc] rustc 1 <host> -> Compiletest 2 <host>
26912693
");
26922694
}
26932695

0 commit comments

Comments
 (0)