Bug 1382569 - Make `mach artifact toolchain --from-build` use the toolchain-artifact info from bug 1374940. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 26 Jul 2017 14:15:33 +0900
changeset 419763 953c82d8136063c13f554a5ace23de69da942e72
parent 419684 4f821dab4306fd0aff947ce55a1304acd7e4cf95
child 419764 f441f40fb1b51c5128151970ad7bb1f37322a3ae
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1382569, 1374940
milestone56.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 1382569 - Make `mach artifact toolchain --from-build` use the toolchain-artifact info from bug 1374940. r=gps
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1824,33 +1824,27 @@ class PackageFrontend(MachCommandBase):
 
                 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
 
                 task_id = optimize_task(task, {})
-                if task_id in (True, False):
+                artifact_name = task.attributes.get('toolchain-artifact')
+                if task_id in (True, False) or not artifact_name:
                     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/'):
-                        continue
-                    name = name[len('public/'):]
-                    if name.startswith('logs/'):
-                        continue
-                    name = os.path.basename(name)
-                    records[name] = DownloadRecord(
-                        get_artifact_url(task_id, artifact['name']),
-                        name, None, None, None, unpack=True)
+                name = os.path.basename(artifact_name)
+                records[name] = DownloadRecord(
+                    get_artifact_url(task_id, artifact_name),
+                    name, None, None, None, unpack=True)
 
         # Handle the list of files of the form path@task-id on the command
         # line. Each of those give a path to an artifact to download.
         # For backwards compatibility with mozboot's
         # install_tooltool_clang_package (until that is migrated to use
         # --from-build), files without a @ are considered as a filter over the
         # tooltool manifest contents.
         for f in files: