Bug 1397847: Pass the taskcluster root to `load_tasks_for_kind` in `mach artifact toolchain`; r=dustin a=tomprince
authorTom Prince <mozilla@hocat.ca>
Thu, 29 Nov 2018 09:37:39 -0700
changeset 505174 19480c5351171537652af013289a595fa4d66ede
parent 505173 a89d378954538f7fe0cad49681b409e80c3f8a0f
child 505187 d81d2b5e6e27308135996c6105b875dd088af81f
child 505211 05c615c12e25294699daf8227638ca856789f57c
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin, tomprince
bugs1397847
milestone65.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 1397847: Pass the taskcluster root to `load_tasks_for_kind` in `mach artifact toolchain`; r=dustin a=tomprince Differential Revision: https://phabricator.services.mozilla.com/D13433
python/mozbuild/mozbuild/mach_commands.py
taskcluster/taskgraph/generator.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1308,18 +1308,16 @@ class PackageFrontend(MachCommandBase):
             open_manifest,
             unpack_file,
         )
         from requests.adapters import HTTPAdapter
         import redo
         import requests
         import shutil
 
-        from taskgraph.config import load_graph_config
-        from taskgraph.generator import Kind
         from taskgraph.util.taskcluster import (
             get_artifact_url,
         )
 
         self._set_log_level(verbose)
         # Normally, we'd use self.log_manager.enable_unstructured(),
         # but that enables all logging, while we only really want tooltool's
         # and it also makes structured log output twice.
@@ -1428,17 +1426,18 @@ class PackageFrontend(MachCommandBase):
             from taskgraph.optimize import IndexSearch
             from taskgraph.parameters import Parameters
             from taskgraph.generator import load_tasks_for_kind
             params = Parameters(
                 level=os.environ.get('MOZ_SCM_LEVEL', '3'),
                 strict=False,
             )
 
-            toolchains = load_tasks_for_kind(params, 'toolchain')
+            root_dir = mozpath.join(self.topsrcdir, 'taskcluster/ci')
+            toolchains = load_tasks_for_kind(params, 'toolchain', root_dir=root_dir)
 
             aliases = {}
             for t in toolchains.values():
                 alias = t.attributes.get('toolchain-alias')
                 if alias:
                     aliases['toolchain-{}'.format(alias)] = \
                         t.task['metadata']['name']
 
--- a/taskcluster/taskgraph/generator.py
+++ b/taskcluster/taskgraph/generator.py
@@ -377,20 +377,20 @@ class TaskGraphGenerator(object):
         from .transforms.job import registry
         verify_docs(
             filename="transforms.rst",
             identifiers=registry.keys(),
             appearing_as="inline-literal"
          )
 
 
-def load_tasks_for_kind(parameters, kind):
+def load_tasks_for_kind(parameters, kind, root_dir=None):
     """
     Get all the tasks of a given kind.
 
     This function is designed to be called from outside of taskgraph.
     """
-    tgg = TaskGraphGenerator(root_dir=None, parameters=parameters, target_kind=kind)
+    tgg = TaskGraphGenerator(root_dir=root_dir, parameters=parameters, target_kind=kind)
     return {
         task.task['metadata']['name']: task
         for task in tgg.full_task_set
         if task.kind == kind
     }