Bug 1566219 - Provide dist-toolchains for use with sccache in bootstrap on macOS. r=nalexander
authorChris Manchester <cmanchester@mozilla.com>
Tue, 16 Jul 2019 18:50:59 +0000
changeset 483050 1e8b8b8f2449a6f1dad0bd7f91ff714dadb26ded
parent 483049 920ebfd35011bedee14ea1c6138c7afcb19d3f91
child 483051 dd3252509d4b16077d05040635fc72caee07c568
push id90161
push usercmanchester@mozilla.com
push dateWed, 17 Jul 2019 01:56:09 +0000
treeherderautoland@5b8d8357d468 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1566219
milestone70.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 1566219 - Provide dist-toolchains for use with sccache in bootstrap on macOS. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D38151
python/mozboot/mozboot/base.py
python/mozboot/mozboot/osx.py
python/mozboot/mozboot/sccache.py
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -292,31 +292,35 @@ class BaseBootstrapper(object):
             % __name__)
 
     def install_toolchain_static_analysis(self, state_dir, checkout_root, toolchain_job):
         clang_tools_path = os.path.join(state_dir, 'clang-tools')
         if not os.path.exists(clang_tools_path):
             os.mkdir(clang_tools_path)
         self.install_toolchain_artifact(clang_tools_path, checkout_root, toolchain_job)
 
-    def install_toolchain_artifact(self, state_dir, checkout_root, toolchain_job):
+    def install_toolchain_artifact(self, state_dir, checkout_root, toolchain_job,
+                                   no_unpack=False):
         mach_binary = os.path.join(checkout_root, 'mach')
         mach_binary = os.path.abspath(mach_binary)
         if not os.path.exists(mach_binary):
             raise ValueError("mach not found at %s" % mach_binary)
 
         # If Python can't figure out what its own executable is, there's little
         # chance we're going to be able to execute mach on its own, particularly
         # on Windows.
         if not sys.executable:
             raise ValueError("cannot determine path to Python executable")
 
         cmd = [sys.executable, mach_binary, 'artifact', 'toolchain',
                '--from-build', toolchain_job]
 
+        if no_unpack:
+            cmd += ['--no-unpack']
+
         subprocess.check_call(cmd, cwd=state_dir)
 
     def which(self, name, *extra_search_dirs):
         """Python implementation of which.
 
         It returns the path of an executable or None if it couldn't be found.
         """
         search_dirs = os.environ['PATH'].split(os.pathsep)
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -507,16 +507,22 @@ class OSXBootstrapper(BaseBootstrapper):
         from mozboot import static_analysis
         self.install_toolchain_static_analysis(
             state_dir, checkout_root, static_analysis.MACOS_CLANG_TIDY)
 
     def ensure_sccache_packages(self, state_dir, checkout_root):
         from mozboot import sccache
 
         self.install_toolchain_artifact(state_dir, checkout_root, sccache.MACOS_SCCACHE)
+        self.install_toolchain_artifact(state_dir, checkout_root,
+                                        sccache.RUSTC_DIST_TOOLCHAIN,
+                                        no_unpack=True)
+        self.install_toolchain_artifact(state_dir, checkout_root,
+                                        sccache.CLANG_DIST_TOOLCHAIN,
+                                        no_unpack=True)
 
     def ensure_stylo_packages(self, state_dir, checkout_root):
         from mozboot import stylo
         self.install_toolchain_artifact(state_dir, checkout_root, stylo.MACOS_CLANG)
         self.install_toolchain_artifact(state_dir, checkout_root, stylo.MACOS_CBINDGEN)
 
     def ensure_nasm_packages(self, state_dir, checkout_root):
         # installed via ensure_browser_packages
--- a/python/mozboot/mozboot/sccache.py
+++ b/python/mozboot/mozboot/sccache.py
@@ -1,8 +1,10 @@
 # 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/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 LINUX_SCCACHE = 'linux64-sccache'
 MACOS_SCCACHE = 'macosx64-sccache'
+RUSTC_DIST_TOOLCHAIN = 'rustc-dist-toolchain'
+CLANG_DIST_TOOLCHAIN = 'clang-dist-toolchain'