Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ee75f24

Browse files
committed
Fix rustbook submodule update location
I put this submodule update in the entirely wrong location. I put it in the `RustcBook` step (for generating src/doc/rustc), when it really should exist for all steps that use the `Rustbook` tool.
1 parent 6a449d9 commit ee75f24

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,12 +1172,6 @@ impl Step for RustcBook {
11721172
/// in the "md-doc" directory in the build output directory. Then
11731173
/// "rustbook" is used to convert it to HTML.
11741174
fn run(self, builder: &Builder<'_>) {
1175-
// These submodules are required to be checked out to build rustbook
1176-
// because they have Cargo dependencies that are needed.
1177-
#[allow(clippy::single_element_loop)] // This will change soon.
1178-
for path in ["src/doc/book"] {
1179-
builder.update_submodule(Path::new(path));
1180-
}
11811175
let out_base = builder.md_doc_out(self.target).join("rustc");
11821176
t!(fs::create_dir_all(&out_base));
11831177
let out_listing = out_base.join("src/lints");

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ macro_rules! bootstrap_tool {
241241
$(,is_external_tool = $external:expr)*
242242
$(,is_unstable_tool = $unstable:expr)*
243243
$(,allow_features = $allow_features:expr)?
244+
$(,submodules = $submodules:expr)?
244245
;
245246
)+) => {
246247
#[derive(PartialEq, Eq, Clone)]
@@ -287,6 +288,11 @@ macro_rules! bootstrap_tool {
287288
}
288289

289290
fn run(self, builder: &Builder<'_>) -> PathBuf {
291+
$(
292+
for submodule in $submodules {
293+
builder.update_submodule(Path::new(submodule));
294+
}
295+
)*
290296
builder.ensure(ToolBuild {
291297
compiler: self.compiler,
292298
target: self.target,
@@ -314,7 +320,7 @@ macro_rules! bootstrap_tool {
314320
}
315321

316322
bootstrap_tool!(
317-
Rustbook, "src/tools/rustbook", "rustbook";
323+
Rustbook, "src/tools/rustbook", "rustbook", submodules = SUBMODULES_FOR_RUSTBOOK;
318324
UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen";
319325
Tidy, "src/tools/tidy", "tidy";
320326
Linkchecker, "src/tools/linkchecker", "linkchecker";
@@ -340,6 +346,10 @@ bootstrap_tool!(
340346
WasmComponentLd, "src/tools/wasm-component-ld", "wasm-component-ld", is_unstable_tool = true, allow_features = "min_specialization";
341347
);
342348

349+
/// These are the submodules that are required for rustbook to work due to
350+
/// depending on mdbook plugins.
351+
pub static SUBMODULES_FOR_RUSTBOOK: &[&str] = &["src/doc/book"];
352+
343353
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
344354
pub struct OptimizedDist {
345355
pub compiler: Compiler,

0 commit comments

Comments
 (0)