bug 1286934 - Switch to using sccache2 + allow cache hits. r?glandium draft
authorTed Mielczarek <ted@mielczarek.org>
Thu, 25 Aug 2016 18:39:57 -0400
changeset 438764 1013c44aa521ecaf8664e1b1aed5f89aa5fbd050
parent 438527 3316f249377fdeb03d85770a8f5f3b3c28793da6
child 438765 c8629ee3714c70ffe28a43f4cfdc7b168ef2f793
push id35807
push userbmo:ted@mielczarek.org
push dateTue, 15 Nov 2016 00:55:44 +0000
reviewersglandium
bugs1286934
milestone52.0a1
bug 1286934 - Switch to using sccache2 + allow cache hits. r?glandium MozReview-Commit-ID: 9lrdLwNj5Bm
Makefile.in
browser/config/tooltool-manifests/linux32/clang.manifest
browser/config/tooltool-manifests/linux32/releng.manifest
browser/config/tooltool-manifests/linux64/clang.manifest
browser/config/tooltool-manifests/linux64/hazard.manifest
browser/config/tooltool-manifests/linux64/releng.manifest
browser/config/tooltool-manifests/macosx64/clang.manifest
browser/config/tooltool-manifests/macosx64/cross-releng.manifest
browser/config/tooltool-manifests/macosx64/releng.manifest
browser/config/tooltool-manifests/win32/build-clang-cl.manifest
browser/config/tooltool-manifests/win32/clang.manifest
browser/config/tooltool-manifests/win32/releng.manifest
browser/config/tooltool-manifests/win64/clang.manifest
browser/config/tooltool-manifests/win64/releng.manifest
build/moz.configure/toolchain.configure
build/mozconfig.cache
build/sccache.mk
mobile/android/config/tooltool-manifests/android-frontend/releng.manifest
mobile/android/config/tooltool-manifests/android-gradle-dependencies/releng.manifest
mobile/android/config/tooltool-manifests/android-x86/releng.manifest
mobile/android/config/tooltool-manifests/android/releng.manifest
--- a/Makefile.in
+++ b/Makefile.in
@@ -257,16 +257,24 @@ include $(topsrcdir)/testing/testsuite-t
 endif
 endif
 
 default all::
 	$(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
 
 include $(topsrcdir)/config/rules.mk
 
+ifdef MOZ_USING_SCCACHE
+default::
+	@echo "===SCCACHE STATS==="
+	# This won't contain stats for both halves of a universal build, but I can live with that.
+	-bash -c "$(SCCACHE) --show-stats | tee >(gzip > $(DIST)/sccache.log.gz)"
+	@echo "==================="
+endif
+
 distclean::
 	$(RM) $(DIST_GARBAGE)
 
 ifeq ($(OS_ARCH),WINNT)
 # we want to copy PDB files on Windows
 MAKE_SYM_STORE_ARGS := -c --vcs-info
 ifdef PDBSTR_PATH
 MAKE_SYM_STORE_ARGS += -i
--- a/browser/config/tooltool-manifests/linux32/clang.manifest
+++ b/browser/config/tooltool-manifests/linux32/clang.manifest
@@ -1,10 +1,10 @@
 [
 {
 "version": "clang 3.8.0, libgcc 4.8.5",
 "size": 140319580,
 "digest": "34e219d7e8eaffa81710631c34d21355563d06335b3c00851e94c1f42f9098788fded8463dd0f67dd699f77b47a0245dd7aff754943a7a03fb5fd145a808254f",
 "algorithm": "sha512", 
 "filename": "clang.tar.xz",
-"unpack": true,
+"unpack": true
 }
 ]
--- a/browser/config/tooltool-manifests/linux32/releng.manifest
+++ b/browser/config/tooltool-manifests/linux32/releng.manifest
@@ -27,15 +27,16 @@
 "version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
 "size": 3245716,
 "digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 }
 ]
--- a/browser/config/tooltool-manifests/linux64/clang.manifest
+++ b/browser/config/tooltool-manifests/linux64/clang.manifest
@@ -11,15 +11,16 @@
 "size": 12072532,
 "digest": "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "setup": "setup.sh",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 }
 ]
--- a/browser/config/tooltool-manifests/linux64/hazard.manifest
+++ b/browser/config/tooltool-manifests/linux64/hazard.manifest
@@ -27,15 +27,16 @@
 "version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
 "size": 102403884,
 "digest": "a7c1512d955d3030bcc1ebddfbf512f7b11b66e31634726deab78d0403fc0ceadd603d32b08c1a5025d3e9ee4ff48ddcf5eaba33468bb2161cfb9fb1a557affa",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
-"filename" : "sccache.tar.bz2",
-"algorithm" : "sha512",
-"digest" : "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
-"unpack" : true,
-"size" : 167175
+"algorithm": "sha512",
+"visibility": "public",
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 }
 ]
--- a/browser/config/tooltool-manifests/linux64/releng.manifest
+++ b/browser/config/tooltool-manifests/linux64/releng.manifest
@@ -27,15 +27,16 @@
 "version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
 "size": 3245716,
 "digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 }
 ]
--- a/browser/config/tooltool-manifests/macosx64/clang.manifest
+++ b/browser/config/tooltool-manifests/macosx64/clang.manifest
@@ -3,21 +3,22 @@
 "version": "clang 3.8.0",
 "size": 133060926,
 "digest": "aff5ad3ac2d41db19d1ba0df5f97b189a7d7e1b6af8c56e22c2b0cced84d75fa98394ded6a4ba5713652e6684a0a46f47aeccf87991f9e849bf8d7d82e564f6f",
 "algorithm": "sha512",
 "filename": "clang.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "d0025b286468cc5ada83b23d3fafbc936b9f190eaa7d4a981715b18e8e3bf720a7bcee7bfe758cfdeb8268857f6098fd52dcdd8818232692a30ce91039936596",
+"size": 1139082
 },
 {
 "version": "cctools port from commit hash db1f8d906cb28, ld only",
 "size": 634496,
 "digest": "037f31fcf29e7bb7fada0d2bdd5e95c7d4cb2692f2a5c98ed6f6a7561b9d81622d015f0d12b291d3667719655f1369e8ce8a0a4a4773aa0ee4753e04a8821173",
 "algorithm": "sha512",
 "filename": "cctools.tar.bz2",
 "unpack": true
--- a/browser/config/tooltool-manifests/macosx64/cross-releng.manifest
+++ b/browser/config/tooltool-manifests/macosx64/cross-releng.manifest
@@ -27,21 +27,22 @@
 "version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
 "size": 3245716,
 "digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
+"visibility": "public",
+"filename": "sccache2.tar.xz",
 "unpack": true,
-"filename": "sccache.tar.bz2"
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 },
 {
 "size": 57060, 
 "visibility": "public", 
 "digest": "9649ca595f4cf088d118da26201f92cc94cda7af49c7c48112ee31cd13c83b2935b3e145de9dd78060cff2480b4c2e7ff5fb24235876956fed13c87852071998", 
 "algorithm": "sha512", 
 "unpack": true,
 "filename": "dmg.tar.xz"
--- a/browser/config/tooltool-manifests/macosx64/releng.manifest
+++ b/browser/config/tooltool-manifests/macosx64/releng.manifest
@@ -27,15 +27,16 @@
 "version": "cctools port from commit hash db1f8d906cb28, ld only",
 "size": 634496,
 "digest": "037f31fcf29e7bb7fada0d2bdd5e95c7d4cb2692f2a5c98ed6f6a7561b9d81622d015f0d12b291d3667719655f1369e8ce8a0a4a4773aa0ee4753e04a8821173",
 "algorithm": "sha512",
 "filename": "cctools.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "d0025b286468cc5ada83b23d3fafbc936b9f190eaa7d4a981715b18e8e3bf720a7bcee7bfe758cfdeb8268857f6098fd52dcdd8818232692a30ce91039936596",
+"size": 1139082
 }
 ]
--- a/browser/config/tooltool-manifests/win32/build-clang-cl.manifest
+++ b/browser/config/tooltool-manifests/win32/build-clang-cl.manifest
@@ -17,21 +17,22 @@
 "version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
 "size": 2402000,
 "digest": "56f12f7ac437742ed717ce0ccfb0b4134160948e45d73016e48d9033567e5b01a171ac95dd7965eb007702c31da73274b5913281655f461f611ddeee37181ecc",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c",
+"size": 1181375
 },
 {
 "version": "Visual Studio 2015 Update 3 14.0.25425.01 / SDK 10.0.14393.0",
 "size": 326656969,
 "digest": "babc414ffc0457d27f5a1ed24a8e4873afbe2f1c1a4075469a27c005e1babc3b2a788f643f825efedff95b79686664c67ec4340ed535487168a3482e68559bc7",
 "algorithm": "sha512",
 "filename": "vs2015u3.zip",
 "unpack": true
--- a/browser/config/tooltool-manifests/win32/clang.manifest
+++ b/browser/config/tooltool-manifests/win32/clang.manifest
@@ -9,21 +9,22 @@
 "version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
 "size": 89434100,
 "digest": "4da0efd2c36c77f29846f328d9f3c095a7b7e0dfd94f76b3159d441aae02b25007a475a979fb5bf313cf8fecb22fec81684871809effcb6b514419bc3854f398",
 "algorithm": "sha512",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c",
+"size": 1181375
 },
 {
 "version": "clang 3.9.0/r262971",
 "size": 169861843,
 "digest": "8caa5a89aea981b618233d39f01bb934b79b85ee8167104bfa4f07936145df5e8ca5e8e007123d75ccc12d2baa926ffc827b40bf793fa9d4bc2670fa519b0ec0",
 "algorithm": "sha512",
 "filename": "clang32.tar.bz2",
 "unpack": true
--- a/browser/config/tooltool-manifests/win32/releng.manifest
+++ b/browser/config/tooltool-manifests/win32/releng.manifest
@@ -17,21 +17,22 @@
 "version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
 "size": 2402000,
 "digest": "56f12f7ac437742ed717ce0ccfb0b4134160948e45d73016e48d9033567e5b01a171ac95dd7965eb007702c31da73274b5913281655f461f611ddeee37181ecc",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c",
+"size": 1181375
 },
 {
 "version": "Visual Studio 2015 Update 3 14.0.25425.01 / SDK 10.0.14393.0",
 "size": 326656969,
 "digest": "babc414ffc0457d27f5a1ed24a8e4873afbe2f1c1a4075469a27c005e1babc3b2a788f643f825efedff95b79686664c67ec4340ed535487168a3482e68559bc7",
 "algorithm": "sha512",
 "filename": "vs2015u3.zip",
 "unpack": true
--- a/browser/config/tooltool-manifests/win64/clang.manifest
+++ b/browser/config/tooltool-manifests/win64/clang.manifest
@@ -10,21 +10,22 @@
 "size": 94812923,
 "digest": "f8ff01a44caf38711c352e49c06e8ef6bbac7836bed1050bb043f89ba70f70a11c88001f453baec0cbc56a013efb0fd6b16d612923d07e29b5d8d4512dbaab07",
 "algorithm": "sha512",
 "visibility": "public",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c",
+"size": 1181375
 },
 {
 "version": "clang 3.9.0/r262971",
 "size": 173306045,
 "digest": "806413640a964dad44c0c6055d2a89a1075730fb6f659ff37341378a14a7dc032e672941765225608b71f6b385ac721ed36bfa04eb38c211b07e2776cb72a0ee",
 "algorithm": "sha512",
 "filename": "clang64.tar.bz2",
 "unpack": true
--- a/browser/config/tooltool-manifests/win64/releng.manifest
+++ b/browser/config/tooltool-manifests/win64/releng.manifest
@@ -18,21 +18,22 @@
 "version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
 "size": 2677831,
 "digest": "eada1edd6142dcde907f14f23c08a2a0b86f108a8fb242f62be6573bbbe1d3b2a4a04c05465d561253d6a617e18cdabee3c87d8cef9a1b5bdd20fe835ef25ff1",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.bz2",
+"unpack": true,
+"digest": "f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c",
+"size": 1181375
 },
 {
 "version": "Visual Studio 2015 Update 3 14.0.25425.01 / SDK 10.0.14393.0",
 "size": 326656969,
 "digest": "babc414ffc0457d27f5a1ed24a8e4873afbe2f1c1a4075469a27c005e1babc3b2a788f643f825efedff95b79686664c67ec4340ed535487168a3482e68559bc7",
 "algorithm": "sha512",
 "filename": "vs2015u3.zip",
 "unpack": true
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -117,28 +117,50 @@ def ccache(value):
 ccache = check_prog('CCACHE', progs=(), input=ccache)
 
 @depends_if(ccache)
 def using_ccache(ccache):
     return True
 
 set_config('MOZ_USING_CCACHE', using_ccache)
 
-@depends('--with-compiler-wrapper', ccache)
+option('--with-sccache', env='SCCACHE', nargs='?',
+       help='Enable compiling with sccache')
+
+@depends_if('--with-sccache')
+def sccache(value):
+    if len(value):
+        return value
+    # If --with-sccache was given without an explicit value, we default to
+    # 'sccache'.
+    return 'sccache'
+
+sccache = check_prog('SCCACHE', progs=(), input=sccache)
+
+@depends_if(sccache)
+def using_sccache(sccache):
+    return True
+
+set_config('MOZ_USING_SCCACHE', using_sccache)
+
+@depends('--with-compiler-wrapper', ccache, sccache)
 @imports(_from='mozbuild.shellutil', _import='split', _as='shell_split')
-def compiler_wrapper(wrapper, ccache):
+def compiler_wrapper(wrapper, ccache, sccache):
     if wrapper:
         raw_wrapper = wrapper[0]
         wrapper = shell_split(raw_wrapper)
         wrapper_program = find_program(wrapper[0])
         if not wrapper_program:
             die('Cannot find `%s` from the given compiler wrapper `%s`',
                 wrapper[0], raw_wrapper)
         wrapper[0] = wrapper_program
 
+    if ccache and sccache:
+        die("Can't use both --with-ccache and --with-sccache")
+    ccache = ccache or sccache
     if ccache:
         if wrapper:
             return tuple([ccache] + wrapper)
         else:
             return (ccache,)
     elif wrapper:
         return tuple(wrapper)
 
--- a/build/mozconfig.cache
+++ b/build/mozconfig.cache
@@ -86,44 +86,46 @@ fi
 
 # if platform hasn't been determined from buildprops, and we're on windows,
 # it must be set to prevent adding ac_add_options --with-ccache below
 if test -z "$platform"; then
     # set platform based on the SYSTEMROOT env var
     case "${SYSTEMROOT}" in
     *Windows)
         platform=windows
+        suffix=.exe
         ;;
     esac
 fi
 
 if test -z "$bucket"; then
     case "$platform" in
     win*) : ;;
     *)
         ac_add_options --with-ccache
     esac
 else
-    if ! test -e $topsrcdir/sccache/sccache.py; then
-        echo "Sccache missing in the tooltool manifest" >&2
+    if ! test -e $topsrcdir/sccache2/sccache${suffix}; then
+        echo "sccache2 missing in the tooltool manifest" >&2
         exit 1
     fi
     mk_add_options "export SCCACHE_BUCKET=$bucket"
     case "$master" in
     *us[ew][12].mozilla.com*|*euc1.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"
+    ac_add_options "--with-sccache=$topsrcdir/sccache2/sccache${suffix}"
     mk_add_options MOZ_PREFLIGHT_ALL+=build/sccache.mk
     mk_add_options MOZ_POSTFLIGHT_ALL+=build/sccache.mk
     mk_add_options "UPLOAD_EXTRA_FILES+=sccache.log.gz"
     case "$platform" in
     win*)
         # sccache supports a special flag to create depfiles.
+        #TODO: move this all into toolchain.configure
         export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
         # Windows builds have a default wrapper that needs to be overridden
         mk_add_options "export CC_WRAPPER="
         mk_add_options "export CXX_WRAPPER="
         # For now, sccache doesn't support separate PDBs so force debug info to be
         # in object files.
         mk_add_options "export COMPILE_PDB_FLAG="
         mk_add_options "export HOST_PDB_FLAG="
--- a/build/sccache.mk
+++ b/build/sccache.mk
@@ -6,13 +6,13 @@ ifdef OBJDIR
 BASE_DIR = $(OBJDIR)
 else
 # OSX Universal builds only do upload in the first MOZ_BUILD_PROJECTS
 BASE_DIR = $(MOZ_OBJDIR)/$(firstword $(MOZ_BUILD_PROJECTS))
 endif
 
 preflight_all:
 	# Terminate any sccache server that might still be around
-	-python2.7 $(TOPSRCDIR)/sccache/sccache.py > /dev/null 2>&1
+	-$(TOPSRCDIR)/sccache2/sccache --stop-server > /dev/null 2>&1
 
 postflight_all:
 	# Terminate sccache server. This prints sccache stats.
-	-python2.7 $(TOPSRCDIR)/sccache/sccache.py 2>&1 | gzip > $(BASE_DIR)/dist/sccache.log.gz
+	-$(TOPSRCDIR)/sccache2/sccache --stop-server
--- a/mobile/android/config/tooltool-manifests/android-frontend/releng.manifest
+++ b/mobile/android/config/tooltool-manifests/android-frontend/releng.manifest
@@ -10,22 +10,22 @@
 "size": 573952124,
 "visibility": "internal",
 "digest": "1d495d7a7386af3f27b14982e0ff7b0963fd1a63a08040b9b1db0e94c9681fa3704c195ba8be23b5f73e15101b2b767293bc8f96e0584e17867ef13b074e5038",
 "algorithm": "sha512",
 "filename": "android-sdk-linux.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
+"algorithm": "sha512",
 "visibility": "public",
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
-"algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 },
 {
 "size": 30899096,
 "visibility": "public",
 "digest": "ac9f5f95d11580d3dbeff87e80a585fe4d324b270dabb91b1165686acab47d99fa6651074ab0be09420239a5d6af38bb2c539506962a7b44e0ed4d080bba2953",
 "algorithm": "sha512",
 "filename": "java_home-1.7.0-openjdk-1.7.0.85.x86_64.tar.xz",
 "unpack": true
--- a/mobile/android/config/tooltool-manifests/android-gradle-dependencies/releng.manifest
+++ b/mobile/android/config/tooltool-manifests/android-gradle-dependencies/releng.manifest
@@ -10,22 +10,22 @@
 "size": 573952124,
 "visibility": "internal",
 "digest": "1d495d7a7386af3f27b14982e0ff7b0963fd1a63a08040b9b1db0e94c9681fa3704c195ba8be23b5f73e15101b2b767293bc8f96e0584e17867ef13b074e5038",
 "algorithm": "sha512",
 "filename": "android-sdk-linux.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
+"algorithm": "sha512",
 "visibility": "public",
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
-"algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 },
 {
 "size": 30899096,
 "visibility": "public",
 "digest": "ac9f5f95d11580d3dbeff87e80a585fe4d324b270dabb91b1165686acab47d99fa6651074ab0be09420239a5d6af38bb2c539506962a7b44e0ed4d080bba2953",
 "algorithm": "sha512",
 "unpack": true,
 "filename": "java_home-1.7.0-openjdk-1.7.0.85.x86_64.tar.xz"
--- a/mobile/android/config/tooltool-manifests/android-x86/releng.manifest
+++ b/mobile/android/config/tooltool-manifests/android-x86/releng.manifest
@@ -19,21 +19,22 @@
 "size": 573952124,
 "visibility": "internal", 
 "digest": "1d495d7a7386af3f27b14982e0ff7b0963fd1a63a08040b9b1db0e94c9681fa3704c195ba8be23b5f73e15101b2b767293bc8f96e0584e17867ef13b074e5038",
 "algorithm": "sha512",
 "filename": "android-sdk-linux.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"visibility": "public",
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 },
 {
 "size": 4906080,
 "digest": "d735544e039da89382c53b2302b7408d4610247b4f8b5cdc5a4d5a8ec5470947b19e8ea7f7a37e78222e661347e394e0030d81f41534138b527b14e9c4e55634",
 "algorithm": "sha512",
 "filename": "jsshell.tar.xz",
 "unpack": true
 },
--- a/mobile/android/config/tooltool-manifests/android/releng.manifest
+++ b/mobile/android/config/tooltool-manifests/android/releng.manifest
@@ -19,22 +19,22 @@
 "size": 573952124,
 "visibility": "internal", 
 "digest": "1d495d7a7386af3f27b14982e0ff7b0963fd1a63a08040b9b1db0e94c9681fa3704c195ba8be23b5f73e15101b2b767293bc8f96e0584e17867ef13b074e5038",
 "algorithm": "sha512",
 "filename": "android-sdk-linux.tar.xz",
 "unpack": true
 },
 {
-"size": 167175,
+"algorithm": "sha512",
 "visibility": "public",
-"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
-"algorithm": "sha512",
-"filename": "sccache.tar.bz2",
-"unpack": true
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "648c2f9cee15d9bf52427de1127f06c6931fed52567edb4325a4619ee6b437fcba8a7b2d062a2546b2d7b3659302a9a137cb25fa0bdf26613c6e42ea2bac2747",
+"size": 1013060
 },
 {
 "size": 4906080,
 "visibility": "public",
 "unpack": true,
 "digest": "d735544e039da89382c53b2302b7408d4610247b4f8b5cdc5a4d5a8ec5470947b19e8ea7f7a37e78222e661347e394e0030d81f41534138b527b14e9c4e55634",
 "algorithm": "sha512",
 "filename": "jsshell.tar.xz"