rustc: Use `create_dir_racy` in save analysis

The OSX bots failed last night due a race condition in save analysis where
concurrent calls to `fs::create_dir_all` conflicted with one another. This
replaces the relevant function call with `fs::create_dir_racy` which is defined
internally to the compiler.
This commit is contained in:
Alex Crichton 2016-12-13 09:12:39 -08:00
parent 0d1b9f4614
commit a1f5001998
1 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ use rustc::session::config::CrateType::CrateTypeExecutable;
use rustc::ty::{self, TyCtxt};
use std::env;
use std::fs::{self, File};
use std::fs::File;
use std::path::{Path, PathBuf};
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>,
},
};
if let Err(e) = fs::create_dir_all(&root_path) {
if let Err(e) = rustc::util::fs::create_dir_racy(&root_path) {
tcx.sess.err(&format!("Could not create directory {}: {}",
root_path.display(),
e));