Skip to content

Commit 377ba9e

Browse files
committed
Update Standalone and Releases doc steps
1 parent e64180f commit 377ba9e

File tree

1 file changed

+29
-16
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+29
-16
lines changed

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

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fn invoke_rustdoc(
326326

327327
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
328328
pub struct Standalone {
329-
compiler: Compiler,
329+
build_compiler: Compiler,
330330
target: TargetSelection,
331331
}
332332

@@ -341,7 +341,11 @@ impl Step for Standalone {
341341

342342
fn make_run(run: RunConfig<'_>) {
343343
run.builder.ensure(Standalone {
344-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
344+
build_compiler: prepare_doc_compiler(
345+
run.builder,
346+
run.builder.host_target,
347+
run.builder.top_stage,
348+
),
345349
target: run.target,
346350
});
347351
}
@@ -356,8 +360,8 @@ impl Step for Standalone {
356360
/// In the end, this is just a glorified wrapper around rustdoc!
357361
fn run(self, builder: &Builder<'_>) {
358362
let target = self.target;
359-
let compiler = self.compiler;
360-
let _guard = builder.msg_doc(compiler, "standalone", target);
363+
let build_compiler = self.build_compiler;
364+
let _guard = builder.msg_doc(build_compiler, "standalone", target);
361365
let out = builder.doc_out(target);
362366
t!(fs::create_dir_all(&out));
363367

@@ -376,7 +380,7 @@ impl Step for Standalone {
376380
}
377381

378382
let html = out.join(filename).with_extension("html");
379-
let rustdoc = builder.rustdoc_for_compiler(compiler);
383+
let rustdoc = builder.rustdoc_for_compiler(build_compiler);
380384
if up_to_date(&path, &html)
381385
&& up_to_date(&footer, &html)
382386
&& up_to_date(&favicon, &html)
@@ -387,7 +391,7 @@ impl Step for Standalone {
387391
continue;
388392
}
389393

390-
let mut cmd = builder.rustdoc_cmd(compiler);
394+
let mut cmd = builder.rustdoc_cmd(build_compiler);
391395

392396
cmd.arg("--html-after-content")
393397
.arg(&footer)
@@ -424,11 +428,15 @@ impl Step for Standalone {
424428
builder.open_in_browser(index);
425429
}
426430
}
431+
432+
fn metadata(&self) -> Option<StepMetadata> {
433+
Some(StepMetadata::doc("standalone", self.target).built_by(self.build_compiler))
434+
}
427435
}
428436

429437
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
430438
pub struct Releases {
431-
compiler: Compiler,
439+
build_compiler: Compiler,
432440
target: TargetSelection,
433441
}
434442

@@ -443,7 +451,11 @@ impl Step for Releases {
443451

444452
fn make_run(run: RunConfig<'_>) {
445453
run.builder.ensure(Releases {
446-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
454+
build_compiler: prepare_doc_compiler(
455+
run.builder,
456+
run.builder.host_target,
457+
run.builder.top_stage,
458+
),
447459
target: run.target,
448460
});
449461
}
@@ -455,15 +467,12 @@ impl Step for Releases {
455467
/// the headline added. In the end, the conversion is done by Rustdoc.
456468
fn run(self, builder: &Builder<'_>) {
457469
let target = self.target;
458-
let compiler = self.compiler;
459-
let _guard = builder.msg_doc(compiler, "releases", target);
470+
let build_compiler = self.build_compiler;
471+
let _guard = builder.msg_doc(build_compiler, "releases", target);
460472
let out = builder.doc_out(target);
461473
t!(fs::create_dir_all(&out));
462474

463-
builder.ensure(Standalone {
464-
compiler: builder.compiler(builder.top_stage, builder.config.host_target),
465-
target,
466-
});
475+
builder.ensure(Standalone { build_compiler, target });
467476

468477
let version_info = builder.ensure(SharedAssets { target: self.target }).version_info;
469478

@@ -474,7 +483,7 @@ impl Step for Releases {
474483
let html = out.join("releases.html");
475484
let tmppath = out.join("releases.md");
476485
let inpath = builder.src.join("RELEASES.md");
477-
let rustdoc = builder.rustdoc_for_compiler(compiler);
486+
let rustdoc = builder.rustdoc_for_compiler(build_compiler);
478487
if !up_to_date(&inpath, &html)
479488
|| !up_to_date(&footer, &html)
480489
|| !up_to_date(&favicon, &html)
@@ -487,7 +496,7 @@ impl Step for Releases {
487496
t!(tmpfile.write_all(b"% Rust Release Notes\n\n"));
488497
t!(io::copy(&mut t!(fs::File::open(&inpath)), &mut tmpfile));
489498
mem::drop(tmpfile);
490-
let mut cmd = builder.rustdoc_cmd(compiler);
499+
let mut cmd = builder.rustdoc_cmd(build_compiler);
491500

492501
cmd.arg("--html-after-content")
493502
.arg(&footer)
@@ -520,6 +529,10 @@ impl Step for Releases {
520529
builder.open_in_browser(&html);
521530
}
522531
}
532+
533+
fn metadata(&self) -> Option<StepMetadata> {
534+
Some(StepMetadata::doc("releases", self.target).built_by(self.build_compiler))
535+
}
523536
}
524537

525538
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)