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.
This commit is contained in:
Eric Huss 2024-07-25 16:26:21 -07:00
parent 6a449d97fe
commit ee75f24945
2 changed files with 11 additions and 7 deletions

View file

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

View file

@ -241,6 +241,7 @@ macro_rules! bootstrap_tool {
$(,is_external_tool = $external:expr)*
$(,is_unstable_tool = $unstable:expr)*
$(,allow_features = $allow_features:expr)?
$(,submodules = $submodules:expr)?
;
)+) => {
#[derive(PartialEq, Eq, Clone)]
@ -287,6 +288,11 @@ macro_rules! bootstrap_tool {
}
fn run(self, builder: &Builder<'_>) -> PathBuf {
$(
for submodule in $submodules {
builder.update_submodule(Path::new(submodule));
}
)*
builder.ensure(ToolBuild {
compiler: self.compiler,
target: self.target,
@ -314,7 +320,7 @@ macro_rules! bootstrap_tool {
}
bootstrap_tool!(
Rustbook, "src/tools/rustbook", "rustbook";
Rustbook, "src/tools/rustbook", "rustbook", submodules = SUBMODULES_FOR_RUSTBOOK;
UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen";
Tidy, "src/tools/tidy", "tidy";
Linkchecker, "src/tools/linkchecker", "linkchecker";
@ -340,6 +346,10 @@ bootstrap_tool!(
WasmComponentLd, "src/tools/wasm-component-ld", "wasm-component-ld", is_unstable_tool = true, allow_features = "min_specialization";
);
/// These are the submodules that are required for rustbook to work due to
/// depending on mdbook plugins.
pub static SUBMODULES_FOR_RUSTBOOK: &[&str] = &["src/doc/book"];
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct OptimizedDist {
pub compiler: Compiler,