Bug 1369630 - Fix `mach artifact toolchain --from-build` after bug 1345863 and bug 1351010. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 02 Jun 2017 15:48:33 +0900
changeset 588556 181f02a8a7e896de9e2de40a06f3e0f9b906c71b
parent 588555 fb9cc965d50bfda7d44b26fb132369c5594d4cd4
child 588557 a784646bf7be61e19fc345a5eb30fdc5c326ee62
push id62084
push userbmo:rchien@mozilla.com
push dateSat, 03 Jun 2017 03:26:37 +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/'):