瀏覽代碼

For Travis CI - ensure files in cache have timestamp older than source.
This is an attempt to fix stale PCH for Emscripten CI build which is using our own cache-store implementation.

Yao Wei Tjong 姚伟忠 10 年之前
父節點
當前提交
07a677ac0e
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      Rakefile

+ 2 - 3
Rakefile

@@ -232,11 +232,10 @@ task :ci_setup_cache do
     matched = /.*-([^-]+-[^-]+)$/.match(ENV['TRAVIS_BRANCH'])
     matched = /.*-([^-]+-[^-]+)$/.match(ENV['TRAVIS_BRANCH'])
     base_mirror = matched ? matched[1] : nil
     base_mirror = matched ? matched[1] : nil
     # Do not abort even when it fails here
     # Do not abort even when it fails here
-    system "if ! `git clone -q --depth 1 --branch #{ENV['TRAVIS_BRANCH']}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then if ! [ #{base_mirror} ] || ! `git clone -q --depth 1 --branch #{base_mirror}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then git clone -q --depth 1 https://github.com/#{repo_slug} ~/.ccache 2>/dev/null; fi && cd ~/.ccache && git checkout -qf -b #{ENV['TRAVIS_BRANCH']}#{job_number}; fi"
+    system "if ! `git clone -q --depth 1 --branch #{ENV['TRAVIS_BRANCH']}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then if ! [ #{base_mirror} ] || ! `git clone -q --depth 1 --branch #{base_mirror}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then git clone -q --depth 1 https://github.com/#{repo_slug} ~/.ccache 2>/dev/null; fi && cd ~/.ccache && git checkout -qf -b #{ENV['TRAVIS_BRANCH']}#{job_number}; fi && cd ~/.ccache && mtime=$(git log --format=%ci -n1 README.md); find . -exec touch -d \"$mtime\" {} \;"
   end
   end
-  system 'ccache -z -M 100M'
   # Clear ccache on demand
   # Clear ccache on demand
-  system 'ccache -C' if /\[ccache clear\]/ =~ ENV['COMMIT_MESSAGE']
+  system "ccache -z -M 100M #{/\[ccache clear\]/ =~ ENV['COMMIT_MESSAGE'] ? '-C' : ''}"
 end
 end
 
 
 # Usage: NOT intended to be used manually
 # Usage: NOT intended to be used manually