Skip to content

Commit 2ac7121

Browse files
committed
Auto merge of #38353 - alexcrichton:fix-nightiles, r=alexcrichton
Another round of nightly fixes Another three separate errors happened last night: * Race condition in save analysis failed the OX build * Packaging docs that don't exist failed the Android build * Packaging save-analysis that doesn't exist failed the cross host builds It just never ends...
2 parents 7f78b42 + 194c3fb commit 2ac7121

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/bootstrap/dist.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ pub fn tmpdir(build: &Build) -> PathBuf {
4848
/// Slurps up documentation from the `stage`'s `host`.
4949
pub fn docs(build: &Build, stage: u32, host: &str) {
5050
println!("Dist docs stage{} ({})", stage, host);
51+
if !build.config.docs {
52+
println!("\tskipping - docs disabled");
53+
return
54+
}
55+
5156
let name = format!("rust-docs-{}", package_vers(build));
5257
let image = tmpdir(build).join(format!("{}-{}-image", name, name));
5358
let _ = fs::remove_dir_all(&image);
@@ -260,6 +265,14 @@ pub fn debugger_scripts(build: &Build,
260265
pub fn std(build: &Build, compiler: &Compiler, target: &str) {
261266
println!("Dist std stage{} ({} -> {})", compiler.stage, compiler.host,
262267
target);
268+
269+
// The only true set of target libraries came from the build triple, so
270+
// let's reduce redundant work by only producing archives from that host.
271+
if compiler.host != build.config.build {
272+
println!("\tskipping, not a build host");
273+
return
274+
}
275+
263276
let name = format!("rust-std-{}", package_vers(build));
264277
let image = tmpdir(build).join(format!("{}-{}-image", name, target));
265278
let _ = fs::remove_dir_all(&image);
@@ -294,10 +307,15 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
294307
println!("Dist analysis");
295308

296309
if build.config.channel != "nightly" {
297-
println!("Skipping dist-analysis - not on nightly channel");
310+
println!("\tskipping - not on nightly channel");
298311
return;
299312
}
313+
if compiler.host != build.config.build {
314+
println!("\tskipping - not a build host");
315+
return
316+
}
300317
if compiler.stage != 2 {
318+
println!("\tskipping - not stage2");
301319
return
302320
}
303321

src/librustc_save_analysis/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use rustc::session::config::CrateType::CrateTypeExecutable;
4848
use rustc::ty::{self, TyCtxt};
4949

5050
use std::env;
51-
use std::fs::{self, File};
51+
use std::fs::File;
5252
use std::path::{Path, PathBuf};
5353

5454
use syntax::ast::{self, NodeId, PatKind, Attribute, CRATE_NODE_ID};
@@ -832,7 +832,7 @@ pub fn process_crate<'l, 'tcx>(tcx: TyCtxt<'l, 'tcx, 'tcx>,
832832
},
833833
};
834834

835-
if let Err(e) = fs::create_dir_all(&root_path) {
835+
if let Err(e) = rustc::util::fs::create_dir_racy(&root_path) {
836836
tcx.sess.err(&format!("Could not create directory {}: {}",
837837
root_path.display(),
838838
e));

0 commit comments

Comments
 (0)