Skip to content

Commit ebaea3d

Browse files
committed
handle crates when they are not specified for std json docs
This fixes a regression from rust-lang#128182. Signed-off-by: onur-ozkan <[email protected]>
1 parent 5367673 commit ebaea3d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ 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+
106107
builder.ensure(crate::core::build_steps::doc::Std::new(
107108
builder.top_stage,
108109
host,

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,16 @@ impl Step for Std {
599599
fn run(self, builder: &Builder<'_>) {
600600
let stage = self.stage;
601601
let target = self.target;
602+
let crates = if self.crates.is_empty() {
603+
builder
604+
.in_tree_crates("sysroot", Some(target))
605+
.into_iter()
606+
.map(|c| c.name.to_string())
607+
.collect()
608+
} else {
609+
self.crates
610+
};
611+
602612
let out = match self.format {
603613
DocumentationFormat::Html => builder.doc_out(target),
604614
DocumentationFormat::Json => builder.json_doc_out(target),
@@ -627,7 +637,7 @@ impl Step for Std {
627637
extra_args.push("--disable-minification");
628638
}
629639

630-
doc_std(builder, self.format, stage, target, &out, &extra_args, &self.crates);
640+
doc_std(builder, self.format, stage, target, &out, &extra_args, &crates);
631641

632642
// Don't open if the format is json
633643
if let DocumentationFormat::Json = self.format {
@@ -639,7 +649,7 @@ impl Step for Std {
639649
let index = out.join("std").join("index.html");
640650
builder.open_in_browser(index);
641651
} else {
642-
for requested_crate in &*self.crates {
652+
for requested_crate in crates {
643653
if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) {
644654
let index = out.join(requested_crate).join("index.html");
645655
builder.open_in_browser(index);

0 commit comments

Comments
 (0)