about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-08-31 12:56:15 -0700
committerGitHub <noreply@github.com>2016-08-31 12:56:15 -0700
commit2c01bb885108c436adae2006632ff6dfc0a5f2cd (patch)
tree096e830596ea574c97955f2c2081974721399b96 /src/tools
parent7a187c39c79e21cd61d1688d449bdd52d7510281 (diff)
parentbcd2f905c46158f9137fa5b63aafebcb60083385 (diff)
downloadrust-2c01bb885108c436adae2006632ff6dfc0a5f2cd.tar.gz
rust-2c01bb885108c436adae2006632ff6dfc0a5f2cd.zip
Auto merge of #35718 - michaelwoerister:incr-comp-dir-locking, r=alexcrichton
Implement synchronization scheme for incr. comp. directory

This PR implements a copy-on-write-based synchronization scheme for the incremental compilation cache directory. For technical details, see the documentation at the beginning of `rustc_incremental/persist/fs.rs`.

The PR contains unit tests for some functions but for testing whether the scheme properly handles races, a more elaborate test setup would be needed. It would probably involve a small tool that allows to manipulate the incremental compilation directory in a controlled way and then letting a compiler instance run against directories in different states. I don't know if it's worth the trouble of adding another test category to `compiletest`, but I'd be happy to do so.

Fixes #32754
Fixes #34957
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/compiletest/src/runtest.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 60a0d8f0b86..228d6ada01d 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1976,7 +1976,10 @@ actual:\n\
         // runs.
         let incremental_dir = self.incremental_dir();
         if incremental_dir.exists() {
-            fs::remove_dir_all(&incremental_dir).unwrap();
+            // Canonicalizing the path will convert it to the //?/ format
+            // on Windows, which enables paths longer than 260 character
+            let canonicalized = incremental_dir.canonicalize().unwrap();
+            fs::remove_dir_all(canonicalized).unwrap();
         }
         fs::create_dir_all(&incremental_dir).unwrap();
 
@@ -2041,7 +2044,7 @@ actual:\n\
 
     /// Directory where incremental work products are stored.
     fn incremental_dir(&self) -> PathBuf {
-        self.output_base_name().with_extension("incremental")
+        self.output_base_name().with_extension("inc")
     }
 
     fn run_rmake_test(&self) {