Bug 1369630 - Fix `mach artifact toolchain --from-build` after bug 1345863 and bug 1351010. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 02 Jun 2017 15:48:33 +0900
changeset 588118 44a12d582fb21d9632af9a91d6c9c7e295d4e4be
parent 587987 41224b687a4351fd9f5bd2ced998ebfa64131e9c
child 631468 e27503294f6265fa15d2a80dc08b03f5f9cf49b8
push id61917
push userbmo:mh+mozilla@glandium.org
push dateFri, 02 Jun 2017 06:50:09 +0000
reviewersgps
bugs1369630, 1345863, 1351010
milestone55.0a1
Bug 1369630 - Fix `mach artifact toolchain --from-build` after bug 1345863 and bug 1351010. r?gps The former removed the /opt from the toolchain job names, and the latter made optimize_task() return a single value.
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1743,30 +1743,27 @@ class PackageFrontend(MachCommandBase):
                         for task in tasks
                     }
 
             toolchains = tasks('toolchain')
 
             for b in from_build:
                 user_value = b
 
-                if '/' not in b:
-                    b = '{}/opt'.format(b)
-
                 if not b.startswith('toolchain-'):
                     b = 'toolchain-{}'.format(b)
 
                 task = toolchains.get(b)
                 if not task:
                     self.log(logging.ERROR, 'artifact', {'build': user_value},
                              'Could not find a toolchain build named `{build}`')
                     return 1
 
-                optimized, task_id = optimize_task(task, {})
-                if not optimized:
+                task_id = optimize_task(task, {})
+                if task_id in (True, False):
                     self.log(logging.ERROR, 'artifact', {'build': user_value},
                              'Could not find artifacts for a toolchain build '
                              'named `{build}`')
                     return 1
 
                 for artifact in list_artifacts(task_id):
                     name = artifact['name']
                     if not name.startswith('public/'):