Skip to content

Commit a1f5001

Browse files
committed
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.
1 parent 0d1b9f4 commit a1f5001

File tree

1 file changed

+2
-2
lines changed
  • src/librustc_save_analysis

1 file changed

+2
-2
lines changed

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)