From bc02a54d12f8b03506ae8eda50a05784cf04b63f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 6 Apr 2016 12:01:40 -0400 Subject: [PATCH] rename the dep-graph file to include crate ident This way, multiple compilations can share the same work directory. --- src/librustc_incremental/persist/util.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/librustc_incremental/persist/util.rs b/src/librustc_incremental/persist/util.rs index 8ebcbc0466f..754292ba383 100644 --- a/src/librustc_incremental/persist/util.rs +++ b/src/librustc_incremental/persist/util.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use rustc::middle::cstore::LOCAL_CRATE; use rustc::ty::TyCtxt; use std::fs; @@ -28,7 +29,12 @@ pub fn dep_graph_path(tcx: TyCtxt) -> Option { } } - Some(incr_dir.join("dep_graph.rbml")) + let crate_name = tcx.crate_name(LOCAL_CRATE); + let crate_disambiguator = tcx.crate_disambiguator(LOCAL_CRATE); + let file_name = format!("dep-graph-{}-{}.bin", + crate_name, + crate_disambiguator); + Some(incr_dir.join(file_name)) }) }