Skip to content

Enforce in bootstrap that doc must have stage at least 1 #145011

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 13 commits into from
Aug 11, 2025
22 changes: 13 additions & 9 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ impl Step for Docs {

#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
pub struct JsonDocs {
pub host: TargetSelection,
build_compiler: Compiler,
target: TargetSelection,
}

impl Step for JsonDocs {
Expand All @@ -105,24 +106,27 @@ impl Step for JsonDocs {
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(JsonDocs { host: run.target });
run.builder.ensure(JsonDocs {
build_compiler: run.builder.compiler(run.builder.top_stage, run.builder.host_target),
target: run.target,
});
}

/// Builds the `rust-docs-json` installer component.
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let host = self.host;
builder.ensure(crate::core::build_steps::doc::Std::new(
builder.top_stage,
host,
let target = self.target;
builder.ensure(crate::core::build_steps::doc::Std::from_build_compiler(
self.build_compiler,
target,
DocumentationFormat::Json,
));

let dest = "share/doc/rust/json";

let mut tarball = Tarball::new(builder, "rust-docs-json", &host.triple);
let mut tarball = Tarball::new(builder, "rust-docs-json", &target.triple);
tarball.set_product_name("Rust Documentation In JSON Format");
tarball.is_preview(true);
tarball.add_bulk_dir(builder.json_doc_out(host), dest);
tarball.add_bulk_dir(builder.json_doc_out(target), dest);
Some(tarball.generate())
}
}
Expand Down Expand Up @@ -1583,7 +1587,7 @@ impl Step for Extended {
}

add_component!("rust-docs" => Docs { host: target });
add_component!("rust-json-docs" => JsonDocs { host: target });
add_component!("rust-json-docs" => JsonDocs { build_compiler: compiler, target });
add_component!("cargo" => Cargo { build_compiler: compiler, target });
add_component!("rustfmt" => Rustfmt { build_compiler: compiler, target });
add_component!("rust-analyzer" => RustAnalyzer { build_compiler: compiler, target });
Expand Down
Loading
Loading