Skip to content

Commit 6f13353

Browse files
committed
---
yaml --- r: 273005 b: refs/heads/beta c: 6a54193 h: refs/heads/master i: 273003: 6769498
1 parent 45a75cb commit 6f13353

File tree

5 files changed

+60
-5
lines changed

5 files changed

+60
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 063e68b0b6db5bd732f1719c5fcfa8837837eb1a
26+
refs/heads/beta: 6a541937dc314cc9e71062a82119b170dd27e995
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/bootstrap/build/doc.rs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fs::{self, File};
1313
use std::io::prelude::*;
1414

1515
use build::{Build, Compiler};
16-
use build::util::up_to_date;
16+
use build::util::{up_to_date, cp_r};
1717

1818
pub fn rustbook(build: &Build, stage: u32, host: &str, name: &str, out: &Path) {
1919
t!(fs::create_dir_all(out));
@@ -102,3 +102,40 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
102102
build.run(&mut cmd);
103103
}
104104
}
105+
106+
pub fn std(build: &Build, stage: u32, host: &str, out: &Path) {
107+
println!("Documenting stage{} std ({})", stage, host);
108+
let compiler = Compiler::new(stage, host);
109+
let out_dir = build.stage_out(stage, host, true)
110+
.join(host).join("doc");
111+
let rustdoc = build.tool(&compiler, "rustdoc");
112+
if !up_to_date(&rustdoc, &out_dir.join("std/index.html")) {
113+
t!(fs::remove_dir_all(&out_dir));
114+
}
115+
116+
let mut cargo = build.cargo(stage, &compiler, true, host,
117+
"doc");
118+
cargo.arg("--manifest-path")
119+
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"))
120+
.arg("--features").arg(build.std_features());
121+
build.run(&mut cargo);
122+
cp_r(&out_dir, out)
123+
}
124+
125+
pub fn rustc(build: &Build, stage: u32, host: &str, out: &Path) {
126+
println!("Documenting stage{} compiler ({})", stage, host);
127+
let compiler = Compiler::new(stage, host);
128+
let out_dir = build.stage_out(stage, host, false)
129+
.join(host).join("doc");
130+
let rustdoc = build.tool(&compiler, "rustdoc");
131+
if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) {
132+
t!(fs::remove_dir_all(&out_dir));
133+
}
134+
let mut cargo = build.cargo(stage, &compiler, false, host,
135+
"doc");
136+
cargo.arg("--manifest-path")
137+
.arg(build.src.join("src/rustc/Cargo.toml"))
138+
.arg("--features").arg(build.rustc_features(stage));
139+
build.run(&mut cargo);
140+
cp_r(&out_dir, out)
141+
}

branches/beta/src/bootstrap/build/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,15 @@ impl Build {
179179
DocStandalone { stage } => {
180180
doc::standalone(self, stage, target.target, &doc_out);
181181
}
182-
Doc { .. } => {} // pseudo-step
182+
DocStd { stage } => {
183+
doc::std(self, stage, target.target, &doc_out);
184+
}
185+
DocRustc { stage } => {
186+
doc::rustc(self, stage, target.target, &doc_out);
187+
}
188+
189+
Doc { .. } | // pseudo-steps
190+
Check { .. } => {}
183191
}
184192
}
185193
}

branches/beta/src/bootstrap/build/step.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ macro_rules! targets {
6262
(doc_nomicon, DocNomicon { stage: u32 }),
6363
(doc_style, DocStyle { stage: u32 }),
6464
(doc_standalone, DocStandalone { stage: u32 }),
65+
(doc_std, DocStd { stage: u32 }),
66+
(doc_rustc, DocRustc { stage: u32 }),
6567

6668
// Steps for running tests. The 'check' target is just a pseudo
6769
// target to depend on a bunch of others.
@@ -182,6 +184,8 @@ fn add_steps<'a>(build: &'a Build,
182184
"doc-standalone" => targets.push(host.doc_standalone(stage)),
183185
"doc-nomicon" => targets.push(host.doc_nomicon(stage)),
184186
"doc-book" => targets.push(host.doc_book(stage)),
187+
"doc-std" => targets.push(host.doc_std(stage)),
188+
"doc-rustc" => targets.push(host.doc_rustc(stage)),
185189
"doc" => targets.push(host.doc(stage)),
186190
"check" => targets.push(host.check(stage, compiler)),
187191
_ => panic!("unknown build target: `{}`", step),
@@ -239,15 +243,22 @@ impl<'a> Step<'a> {
239243
vec![self.llvm(()).target(&build.config.build)]
240244
}
241245
Source::Llvm { _dummy } => Vec::new(),
246+
Source::DocStd { stage } => {
247+
vec![self.libstd(stage, self.compiler(stage))]
248+
}
242249
Source::DocBook { stage } |
243250
Source::DocNomicon { stage } |
244251
Source::DocStyle { stage } |
245252
Source::DocStandalone { stage } => {
246253
vec![self.rustc(stage)]
247254
}
255+
Source::DocRustc { stage } => {
256+
vec![self.doc_std(stage)]
257+
}
248258
Source::Doc { stage } => {
249259
vec![self.doc_book(stage), self.doc_nomicon(stage),
250-
self.doc_style(stage), self.doc_standalone(stage)]
260+
self.doc_style(stage), self.doc_standalone(stage),
261+
self.doc_std(stage)]
251262
}
252263
Source::Check { stage, compiler: _ } => {
253264
vec![]

branches/beta/src/bootstrap/build/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub fn mtime(path: &Path) -> FileTime {
3030
}).unwrap_or(FileTime::zero())
3131
}
3232

33-
#[allow(dead_code)] // this will be used soon
3433
pub fn cp_r(src: &Path, dst: &Path) {
3534
for f in t!(fs::read_dir(src)) {
3635
let f = t!(f);

0 commit comments

Comments
 (0)