]> git.lizzy.rs Git - rust.git/commitdiff
Enable appveyor cache, add more paranoia
authorAidan Hobson Sayers <aidanhs@cantab.net>
Tue, 4 Apr 2017 21:51:16 +0000 (22:51 +0100)
committerAidan Hobson Sayers <aidanhs@cantab.net>
Tue, 4 Apr 2017 22:41:38 +0000 (23:41 +0100)
appveyor.yml
src/ci/init_repo.sh

index 68b2a239aff1babc31c622fd0631dd4abaac9c78..b0adda4bdb904e234223fc9fbae9e2b0f6e76425 100644 (file)
@@ -141,15 +141,18 @@ install:
   - set SCCACHE_ERROR_LOG=%CD%/sccache.log
 
 test_script:
-  - appveyor-retry sh -c 'git submodule deinit -f . && git submodule update --init'
+  - if not exist C:\cache\rustsrc\NUL mkdir C:\cache\rustsrc
+  - sh src/ci/init_repo.sh . /c/cache/rustsrc
   - set SRC=.
   - set NO_CCACHE=1
   - sh src/ci/run.sh
 
 on_failure:
-  - cat %CD%/sccache.log
+  - cat %CD%\sccache.log
+  - cat C:\Users\appveyor\AppData\Local\Temp\1\build-cache-logs\*.log
 
 cache:
+  - C:\cache\rustsrc
   - "build/i686-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger"
   - "build/x86_64-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger"
   - "i686-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger"
index 4e22907d9794c733251fa1ad0a79679b47b14f57..c235681cddd0c5dac224280a0d67c25c6599c23b 100755 (executable)
@@ -38,9 +38,20 @@ fi
 
 # Wipe the cache if it's not valid, or mark it as invalid while we update it
 if [ ! -f "$cache_valid_file" ]; then
-    rm -rf "$CACHE_DIR" && mkdir "$CACHE_DIR"
+    rm -rf "$CACHE_DIR"
+    mkdir "$CACHE_DIR"
 else
-    rm "$cache_valid_file"
+    stat_lines=$(cd "$cache_src_dir" && git status --porcelain | wc -l)
+    stat_ec=$(cd "$cache_src_dir" && git status >/dev/null 2>&1 && echo $?)
+    if [ ! -d "$cache_src_dir/.git" -o $stat_lines != 0 -o $stat_ec != 0 ]; then
+        # Something is badly wrong - the cache valid file is here, but something
+        # about the git repo is fishy. Nuke it all, just in case
+        echo "WARNING: $cache_valid_file exists but bad repo: l:$stat_lines, ec:$stat_ec"
+        rm -rf "$CACHE_DIR"
+        mkdir "$CACHE_DIR"
+    else
+        rm "$cache_valid_file"
+    fi
 fi
 
 # Update the cache (a pristine copy of the rust source master)