Skip to content

Commit db44fe7

Browse files
committed
Update Standalone and Releases doc steps
1 parent 2824572 commit db44fe7

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
@@ -328,7 +328,7 @@ fn invoke_rustdoc(
328328

329329
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
330330
pub struct Standalone {
331-
compiler: Compiler,
331+
build_compiler: Compiler,
332332
target: TargetSelection,
333333
}
334334

@@ -343,7 +343,11 @@ impl Step for Standalone {
343343

344344
fn make_run(run: RunConfig<'_>) {
345345
run.builder.ensure(Standalone {
346-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
346+
build_compiler: prepare_doc_compiler(
347+
run.builder,
348+
run.builder.host_target,
349+
run.builder.top_stage,
350+
),
347351
target: run.target,
348352
});
349353
}
@@ -358,8 +362,8 @@ impl Step for Standalone {
358362
/// In the end, this is just a glorified wrapper around rustdoc!
359363
fn run(self, builder: &Builder<'_>) {
360364
let target = self.target;
361-
let compiler = self.compiler;
362-
let _guard = builder.msg_doc(compiler, "standalone", target);
365+
let build_compiler = self.build_compiler;
366+
let _guard = builder.msg_doc(build_compiler, "standalone", target);
363367
let out = builder.doc_out(target);
364368
t!(fs::create_dir_all(&out));
365369

@@ -378,7 +382,7 @@ impl Step for Standalone {
378382
}
379383

380384
let html = out.join(filename).with_extension("html");
381-
let rustdoc = builder.rustdoc_for_compiler(compiler);
385+
let rustdoc = builder.rustdoc_for_compiler(build_compiler);
382386
if up_to_date(&path, &html)
383387
&& up_to_date(&footer, &html)
384388
&& up_to_date(&favicon, &html)
@@ -389,7 +393,7 @@ impl Step for Standalone {
389393
continue;
390394
}
391395

392-
let mut cmd = builder.rustdoc_cmd(compiler);
396+
let mut cmd = builder.rustdoc_cmd(build_compiler);
393397

394398
cmd.arg("--html-after-content")
395399
.arg(&footer)
@@ -426,11 +430,15 @@ impl Step for Standalone {
426430
builder.open_in_browser(index);
427431
}
428432
}
433+
434+
fn metadata(&self) -> Option<StepMetadata> {
435+
Some(StepMetadata::doc("standalone", self.target).built_by(self.build_compiler))
436+
}
429437
}
430438

431439
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
432440
pub struct Releases {
433-
compiler: Compiler,
441+
build_compiler: Compiler,
434442
target: TargetSelection,
435443
}
436444

@@ -445,7 +453,11 @@ impl Step for Releases {
445453

446454
fn make_run(run: RunConfig<'_>) {
447455
run.builder.ensure(Releases {
448-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
456+
build_compiler: prepare_doc_compiler(
457+
run.builder,
458+
run.builder.host_target,
459+
run.builder.top_stage,
460+
),
449461
target: run.target,
450462
});
451463
}
@@ -457,15 +469,12 @@ impl Step for Releases {
457469
/// the headline added. In the end, the conversion is done by Rustdoc.
458470
fn run(self, builder: &Builder<'_>) {
459471
let target = self.target;
460-
let compiler = self.compiler;
461-
let _guard = builder.msg_doc(compiler, "releases", target);
472+
let build_compiler = self.build_compiler;
473+
let _guard = builder.msg_doc(build_compiler, "releases", target);
462474
let out = builder.doc_out(target);
463475
t!(fs::create_dir_all(&out));
464476

465-
builder.ensure(Standalone {
466-
compiler: builder.compiler(builder.top_stage, builder.config.host_target),
467-
target,
468-
});
477+
builder.ensure(Standalone { build_compiler, target });
469478

470479
let version_info = builder.ensure(SharedAssets { target: self.target }).version_info;
471480

@@ -476,7 +485,7 @@ impl Step for Releases {
476485
let html = out.join("releases.html");
477486
let tmppath = out.join("releases.md");
478487
let inpath = builder.src.join("RELEASES.md");
479-
let rustdoc = builder.rustdoc_for_compiler(compiler);
488+
let rustdoc = builder.rustdoc_for_compiler(build_compiler);
480489
if !up_to_date(&inpath, &html)
481490
|| !up_to_date(&footer, &html)
482491
|| !up_to_date(&favicon, &html)
@@ -489,7 +498,7 @@ impl Step for Releases {
489498
t!(tmpfile.write_all(b"% Rust Release Notes\n\n"));
490499
t!(io::copy(&mut t!(fs::File::open(&inpath)), &mut tmpfile));
491500
mem::drop(tmpfile);
492-
let mut cmd = builder.rustdoc_cmd(compiler);
501+
let mut cmd = builder.rustdoc_cmd(build_compiler);
493502

494503
cmd.arg("--html-after-content")
495504
.arg(&footer)
@@ -522,6 +531,10 @@ impl Step for Releases {
522531
builder.open_in_browser(&html);
523532
}
524533
}
534+
535+
fn metadata(&self) -> Option<StepMetadata> {
536+
Some(StepMetadata::doc("releases", self.target).built_by(self.build_compiler))
537+
}
525538
}
526539

527540
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)