Bug 1304176 - Use vendored tooltool.py if available; r=ted
authorGregory Szorc <gps@mozilla.com>
Tue, 20 Sep 2016 12:36:33 -0700
changeset 315069 b64330d3db8d5091927308dc91ac1cfd5ec7b7ad
parent 315068 2e07640f74cf7531b8b2077d519557a680fea456
child 315070 3fd83c9c0548b3f07c844a2f6c3a23ae7569eecd
push id32537
push usergszorc@mozilla.com
push dateFri, 23 Sep 2016 20:03:51 +0000
treeherderautoland@d5355738ce1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1304176
milestone52.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 1304176 - Use vendored tooltool.py if available; r=ted Now that we can detect when we're running from a source checkout, we can start using things from source checkouts instead of relying on host machine state or grabbing files from another server. We start by using the vendored tooltool.py if available. This avoids non-determinism. It avoids a possible 3rd party hosting dependency on github.com. It avoids a possible MitM attack vector. Wins all around. MozReview-Commit-ID: L6hLveHZxBR
testing/mozharness/mozharness/mozilla/tooltool.py
--- a/testing/mozharness/mozharness/mozilla/tooltool.py
+++ b/testing/mozharness/mozharness/mozilla/tooltool.py
@@ -42,18 +42,24 @@ class TooltoolMixin(object):
         # take care of auth.  Everywhere else, we'll get auth failures if
         # necessary.
         if os.path.exists(fn):
             return fn
 
     def tooltool_fetch(self, manifest,
                        output_dir=None, privileged=False, cache=None):
         """docstring for tooltool_fetch"""
-
-        if self.config.get("download_tooltool"):
+        # Use vendored tooltool.py if available.
+        if self.topsrcdir:
+            cmd = [
+                sys.executable,
+                os.path.join(self.topsrcdir, 'testing', 'docker', 'recipes',
+                                'tooltool.py')
+            ]
+        elif self.config.get("download_tooltool"):
             cmd = [sys.executable, self._fetch_tooltool_py()]
         else:
             cmd = self.query_exe('tooltool.py', return_type='list')
 
         # get the tooltool servers from configuration
         default_urls = self.config.get('tooltool_servers', TOOLTOOL_SERVERS)
 
         # add slashes (bug 1155630)