Skip to content

Update the reference #128215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
ehuss committed Jul 25, 2024
commit ee75f24945a4e7d614b25c89d70b3eb88dc20ccd
6 changes: 0 additions & 6 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
12 changes: 11 additions & 1 deletion src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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";
Expand All @@ -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,
Expand Down