Skip to content

Commit 5c7f4d4

Browse files
committed
Document the rustc-docs step
1 parent 5c73ee9 commit 5c7f4d4

File tree

1 file changed

+18
-9
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+18
-9
lines changed

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ impl Step for Docs {
7575
/// Builds the `rust-docs` installer component.
7676
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
7777
let host = self.host;
78+
// FIXME: explicitly enumerate the steps that should be executed here, and gather their
79+
// documentation, rather than running all default steps and then read their output
80+
// from a shared directory.
7881
builder.run_default_doc_steps();
7982

8083
let dest = "share/doc/rust/html";
@@ -132,13 +135,20 @@ impl Step for JsonDocs {
132135
}
133136
}
134137

138+
/// Builds the `rustc-docs` installer component.
139+
/// Apart from the documentation of the `rustc_*` crates, it also includes the documentation of
140+
/// various in-tree helper tools (bootstrap, build_helper, tidy),
141+
/// and also rustc_private tools like rustdoc, clippy, miri or rustfmt.
142+
///
143+
/// It is currently hosted at https://doc.rust-lang.org/nightly/nightly-rustc
135144
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
136145
pub struct RustcDocs {
137-
pub host: TargetSelection,
146+
target: TargetSelection,
138147
}
139148

140149
impl Step for RustcDocs {
141-
type Output = Option<GeneratedTarball>;
150+
type Output = GeneratedTarball;
151+
142152
const DEFAULT: bool = true;
143153
const IS_HOST: bool = true;
144154

@@ -148,18 +158,17 @@ impl Step for RustcDocs {
148158
}
149159

150160
fn make_run(run: RunConfig<'_>) {
151-
run.builder.ensure(RustcDocs { host: run.target });
161+
run.builder.ensure(RustcDocs { target: run.target });
152162
}
153163

154-
/// Builds the `rustc-docs` installer component.
155-
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
156-
let host = self.host;
164+
fn run(self, builder: &Builder<'_>) -> Self::Output {
165+
let target = self.target;
157166
builder.run_default_doc_steps();
158167

159-
let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple);
168+
let mut tarball = Tarball::new(builder, "rustc-docs", &target.triple);
160169
tarball.set_product_name("Rustc Documentation");
161-
tarball.add_bulk_dir(builder.compiler_doc_out(host), "share/doc/rust/html/rustc");
162-
Some(tarball.generate())
170+
tarball.add_bulk_dir(builder.compiler_doc_out(target), "share/doc/rust/html/rustc");
171+
tarball.generate()
163172
}
164173
}
165174

0 commit comments

Comments
 (0)