From a3540aa22f5acb7892ef4ef3bf00128726887e35 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Thu, 29 Nov 2018 09:37:39 -0700 Subject: [PATCH] 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 --HG-- extra : rebase_source : ab46822cbf7cb72de61285eb336cb80356943752 extra : amend_source : 9ec807b18a8cc7d1b5d33cb4a4c65988fee4ff00 --- python/mozbuild/mozbuild/mach_commands.py | 5 ++--- taskcluster/taskgraph/generator.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 60710373e3b0..d00559da22ff 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -1313,8 +1313,6 @@ class PackageFrontend(MachCommandBase): import requests import shutil - from taskgraph.config import load_graph_config - from taskgraph.generator import Kind from taskgraph.util.taskcluster import ( get_artifact_url, ) @@ -1433,7 +1431,8 @@ class PackageFrontend(MachCommandBase): 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(): diff --git a/taskcluster/taskgraph/generator.py b/taskcluster/taskgraph/generator.py index 91aea7295f25..aeaaa071d749 100644 --- a/taskcluster/taskgraph/generator.py +++ b/taskcluster/taskgraph/generator.py @@ -382,13 +382,13 @@ class TaskGraphGenerator(object): ) -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