Skip to content

Commit 384de54

Browse files
committed
precompute the std crates before documenting for rust-docs-json
This fixes a regression from rust-lang#128182. Signed-off-by: onur-ozkan <[email protected]>
1 parent 5367673 commit 384de54

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ impl Step for JsonDocs {
103103
/// Builds the `rust-docs-json` installer component.
104104
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
105105
let host = self.host;
106-
builder.ensure(crate::core::build_steps::doc::Std::new(
106+
107+
let crates = builder
108+
.in_tree_crates("sysroot", Some(host))
109+
.into_iter()
110+
.map(|krate| krate.name.to_string())
111+
.collect();
112+
113+
builder.ensure(crate::core::build_steps::doc::Std::new_with_crates(
107114
builder.top_stage,
108115
host,
109116
DocumentationFormat::Json,
117+
crates,
110118
));
111119

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

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

+9
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,15 @@ impl Std {
567567
pub(crate) fn new(stage: u32, target: TargetSelection, format: DocumentationFormat) -> Self {
568568
Std { stage, target, format, crates: vec![] }
569569
}
570+
571+
pub(crate) fn new_with_crates(
572+
stage: u32,
573+
target: TargetSelection,
574+
format: DocumentationFormat,
575+
crates: Vec<String>,
576+
) -> Self {
577+
Std { stage, target, format, crates }
578+
}
570579
}
571580

572581
impl Step for Std {

0 commit comments

Comments
 (0)