Bug 988722 - Use buildprops.json to decide whether and how to use sccache. r=bhearsum
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 29 Mar 2014 07:50:08 +0900
changeset 176011 8245a010d297fcf66daf17705f17412dea8647d5
parent 176010 ca4eb95802608ce2e518c38b2075dea84b213e32
child 176012 05a22543378bacadca314c7e8d1603ab742df2ac
push id26505
push userphilringnalda@gmail.com
push dateSat, 29 Mar 2014 16:01:43 +0000
treeherdermozilla-central@8da3aabb044f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs988722
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 988722 - Use buildprops.json to decide whether and how to use sccache. r=bhearsum
build/mozconfig.cache
--- a/build/mozconfig.cache
+++ b/build/mozconfig.cache
@@ -1,27 +1,39 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # Setup for build cache
 
+read branch platform master <<EOF
+$(python2.7 -c 'import json; p = json.loads(open("'"$topsrcdir"'/../buildprops.json").read())["properties"]; print p["branch"], p["platform"], p["master"]' 2> /dev/null)
+EOF
+
 bucket=
 if test -z "$SCCACHE_DISABLE" -a -f "$topsrcdir/sccache/sccache.py"; then
-    case `hostname` in
-    try*spot*.use1.mozilla.com|try*ec2*.use1.mozilla.com)
+    case "${branch}_${master}" in
+    try_*use1.mozilla.com*)
         bucket=mozilla-releng-s3-cache-us-east-1-try
         ;;
-    try*spot*.usw2.mozilla.com|try*ec2*.usw2.mozilla.com)
+    try_*usw2.mozilla.com*)
         bucket=mozilla-releng-s3-cache-us-west-2-try
         ;;
     esac
 fi
 
 if test -z "$bucket"; then
-    ac_add_options --with-ccache
+    case "$platform" in
+    win*) : ;;
+    *)
+        ac_add_options --with-ccache
+    esac
 else
     mk_add_options "export SCCACHE_BUCKET=$bucket"
-    mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
+    case "$master" in
+    *use1.mozilla.com*|*usw2.mozilla.com*)
+        mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
+        ;;
+    esac
     ac_add_options "--with-compiler-wrapper=python2.7 $topsrcdir/sccache/sccache.py"
     mk_add_options MOZ_PREFLIGHT+=build/sccache.mk
     mk_add_options MOZ_POSTFLIGHT+=build/sccache.mk
 fi