Skip to content

Commit 4df0c4c

Browse files
committed
---
yaml --- r: 276976 b: refs/heads/try c: d78063d h: refs/heads/master
1 parent 69c3602 commit 4df0c4c

File tree

4 files changed

+47
-36
lines changed

4 files changed

+47
-36
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 4e758722f4f9ccf9054ebf179b8630a37ce954f1
4+
refs/heads/try: d78063dd8459f71b9bd87d6a59a142598ba79573
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/bootstrap/build/dist.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn docs(build: &Build, stage: u32, host: &str) {
5252
.arg(format!("--image-dir={}", sanitize_sh(&image)))
5353
.arg(format!("--work-dir={}", sanitize_sh(&tmpdir(build))))
5454
.arg(format!("--output-dir={}", sanitize_sh(&distdir(build))))
55-
.arg(format!("--package-name={}", name))
55+
.arg(format!("--package-name={}-{}", name, host))
5656
.arg("--component-name=rust-docs")
5757
.arg("--legacy-manifest-dirs=rustlib,cargo")
5858
.arg("--bulk-dirs=share/doc/rust/html");
@@ -61,9 +61,11 @@ pub fn docs(build: &Build, stage: u32, host: &str) {
6161

6262
// As part of this step, *also* copy the docs directory to a directory which
6363
// buildbot typically uploads.
64-
let dst = distdir(build).join("doc").join(&build.package_vers);
65-
t!(fs::create_dir_all(&dst));
66-
cp_r(&src, &dst);
64+
if host == build.config.build {
65+
let dst = distdir(build).join("doc").join(&build.package_vers);
66+
t!(fs::create_dir_all(&dst));
67+
cp_r(&src, &dst);
68+
}
6769
}
6870

6971
pub fn mingw(build: &Build, host: &str) {

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

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ use std::process::Command;
1616
use build::{Build, Compiler, Mode};
1717
use build::util::{up_to_date, cp_r};
1818

19-
pub fn rustbook(build: &Build, stage: u32, host: &str, name: &str, out: &Path) {
19+
pub fn rustbook(build: &Build, stage: u32, target: &str, name: &str, out: &Path) {
2020
t!(fs::create_dir_all(out));
2121

2222
let out = out.join(name);
23-
let compiler = Compiler::new(stage, host);
23+
let compiler = Compiler::new(stage, &build.config.build);
2424
let src = build.src.join("src/doc").join(name);
2525
let index = out.join("index.html");
2626
let rustbook = build.tool(&compiler, "rustbook");
2727
if up_to_date(&src, &index) && up_to_date(&rustbook, &index) {
2828
return
2929
}
30-
println!("Rustbook stage{} ({}) - {}", stage, host, name);
30+
println!("Rustbook stage{} ({}) - {}", stage, target, name);
3131
let _ = fs::remove_dir_all(&out);
3232
build.run(build.tool_cmd(&compiler, "rustbook")
3333
.arg("build")
3434
.arg(&src)
3535
.arg(out));
3636
}
3737

38-
pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
39-
println!("Documenting stage{} standalone ({})", stage, host);
38+
pub fn standalone(build: &Build, stage: u32, target: &str, out: &Path) {
39+
println!("Documenting stage{} standalone ({})", stage, target);
4040
t!(fs::create_dir_all(out));
4141

42-
let compiler = Compiler::new(stage, host);
42+
let compiler = Compiler::new(stage, &build.config.build);
4343

4444
let favicon = build.src.join("src/doc/favicon.inc");
4545
let footer = build.src.join("src/doc/footer.inc");
@@ -105,59 +105,61 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
105105
}
106106
}
107107

108-
pub fn std(build: &Build, stage: u32, host: &str, out: &Path) {
109-
println!("Documenting stage{} std ({})", stage, host);
110-
let compiler = Compiler::new(stage, host);
108+
pub fn std(build: &Build, stage: u32, target: &str, out: &Path) {
109+
println!("Documenting stage{} std ({})", stage, target);
110+
t!(fs::create_dir_all(out));
111+
let compiler = Compiler::new(stage, &build.config.build);
111112
let out_dir = build.stage_out(&compiler, Mode::Libstd)
112-
.join(host).join("doc");
113+
.join(target).join("doc");
113114
let rustdoc = build.rustdoc(&compiler);
114115

115116
build.clear_if_dirty(&out_dir, &rustdoc);
116117

117-
let mut cargo = build.cargo(&compiler, Mode::Libstd, host, "doc");
118+
let mut cargo = build.cargo(&compiler, Mode::Libstd, target, "doc");
118119
cargo.arg("--manifest-path")
119120
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"))
120121
.arg("--features").arg(build.std_features());
121122
build.run(&mut cargo);
122123
cp_r(&out_dir, out)
123124
}
124125

125-
pub fn test(build: &Build, stage: u32, host: &str, out: &Path) {
126-
println!("Documenting stage{} test ({})", stage, host);
127-
let compiler = Compiler::new(stage, host);
126+
pub fn test(build: &Build, stage: u32, target: &str, out: &Path) {
127+
println!("Documenting stage{} test ({})", stage, target);
128+
let compiler = Compiler::new(stage, &build.config.build);
128129
let out_dir = build.stage_out(&compiler, Mode::Libtest)
129-
.join(host).join("doc");
130+
.join(target).join("doc");
130131
let rustdoc = build.rustdoc(&compiler);
131132

132133
build.clear_if_dirty(&out_dir, &rustdoc);
133134

134-
let mut cargo = build.cargo(&compiler, Mode::Libtest, host, "doc");
135+
let mut cargo = build.cargo(&compiler, Mode::Libtest, target, "doc");
135136
cargo.arg("--manifest-path")
136137
.arg(build.src.join("src/rustc/test_shim/Cargo.toml"));
137138
build.run(&mut cargo);
138139
cp_r(&out_dir, out)
139140
}
140141

141-
pub fn rustc(build: &Build, stage: u32, host: &str, out: &Path) {
142-
println!("Documenting stage{} compiler ({})", stage, host);
143-
let compiler = Compiler::new(stage, host);
142+
pub fn rustc(build: &Build, stage: u32, target: &str, out: &Path) {
143+
println!("Documenting stage{} compiler ({})", stage, target);
144+
let compiler = Compiler::new(stage, &build.config.build);
144145
let out_dir = build.stage_out(&compiler, Mode::Librustc)
145-
.join(host).join("doc");
146+
.join(target).join("doc");
146147
let rustdoc = build.rustdoc(&compiler);
147148
if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) {
148149
t!(fs::remove_dir_all(&out_dir));
149150
}
150-
let mut cargo = build.cargo(&compiler, Mode::Librustc, host, "doc");
151+
let mut cargo = build.cargo(&compiler, Mode::Librustc, target, "doc");
151152
cargo.arg("--manifest-path")
152153
.arg(build.src.join("src/rustc/Cargo.toml"))
153154
.arg("--features").arg(build.rustc_features());
154155
build.run(&mut cargo);
155156
cp_r(&out_dir, out)
156157
}
157158

158-
pub fn error_index(build: &Build, stage: u32, host: &str, out: &Path) {
159-
println!("Documenting stage{} error index ({})", stage, host);
160-
let compiler = Compiler::new(stage, host);
159+
pub fn error_index(build: &Build, stage: u32, target: &str, out: &Path) {
160+
println!("Documenting stage{} error index ({})", stage, target);
161+
t!(fs::create_dir_all(out));
162+
let compiler = Compiler::new(stage, &build.config.build);
161163
let mut index = build.tool_cmd(&compiler, "error_index_generator");
162164
index.arg("html");
163165
index.arg(out.join("error-index.html"));

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,22 +274,28 @@ impl<'a> Step<'a> {
274274
vec![self.llvm(()).target(&build.config.build)]
275275
}
276276
Source::Llvm { _dummy } => Vec::new(),
277+
278+
// Note that all doc targets depend on artifacts from the build
279+
// architecture, not the target (which is where we're generating
280+
// docs into).
277281
Source::DocStd { stage } => {
278-
vec![self.libstd(self.compiler(stage))]
282+
let compiler = self.target(&build.config.build).compiler(stage);
283+
vec![self.libstd(compiler)]
279284
}
280285
Source::DocTest { stage } => {
281-
vec![self.libtest(self.compiler(stage))]
286+
let compiler = self.target(&build.config.build).compiler(stage);
287+
vec![self.libtest(compiler)]
282288
}
283289
Source::DocBook { stage } |
284290
Source::DocNomicon { stage } |
285291
Source::DocStyle { stage } => {
286-
vec![self.tool_rustbook(stage)]
292+
vec![self.target(&build.config.build).tool_rustbook(stage)]
287293
}
288294
Source::DocErrorIndex { stage } => {
289-
vec![self.tool_error_index(stage)]
295+
vec![self.target(&build.config.build).tool_error_index(stage)]
290296
}
291297
Source::DocStandalone { stage } => {
292-
vec![self.rustc(stage)]
298+
vec![self.target(&build.config.build).rustc(stage)]
293299
}
294300
Source::DocRustc { stage } => {
295301
vec![self.doc_test(stage)]
@@ -333,7 +339,6 @@ impl<'a> Step<'a> {
333339

334340
Source::Dist { stage } => {
335341
let mut base = Vec::new();
336-
base.push(self.dist_docs(stage));
337342

338343
for host in build.config.host.iter() {
339344
let host = self.target(host);
@@ -344,7 +349,9 @@ impl<'a> Step<'a> {
344349

345350
let compiler = self.compiler(stage);
346351
for target in build.config.target.iter() {
347-
base.push(self.target(target).dist_std(compiler));
352+
let target = self.target(target);
353+
base.push(target.dist_docs(stage));
354+
base.push(target.dist_std(compiler));
348355
}
349356
}
350357
return base

0 commit comments

Comments
 (0)