Bug 1390393 - Override tooltool files with toolchain artifacts when one is given to `mach artifact toolchain`. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 15 Aug 2017 11:03:49 +0900
changeset 647047 abd087ae9b84a82a7d7403adb0fba46e0034fa26
parent 647046 d5f40050d2df0075acc5312a14926e57657bbd1d
child 647048 a9732755601920d47aa95b3d599cddaede3f29e1
push id74288
push userhikezoe@mozilla.com
push dateWed, 16 Aug 2017 00:19:57 +0000
reviewersgps
bugs1390393
milestone57.0a1
Bug 1390393 - Override tooltool files with toolchain artifacts when one is given to `mach artifact toolchain`. r=gps When the tooltool manifest contains e.g. clang.tar.bz2 and it's also provided by some toolchain job artifact, we still download both. In fact, depending how things go, the tooltool one could take precedence. In practice, this hasn't caused problems so far because we've removed tooltool manifest items early on, and when we didn't, it was still the same version as provided by toolchain jobs. It is still necessary to fix for the future, though.
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1912,17 +1912,17 @@ class PackageFrontend(MachCommandBase):
         # 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 f in files:
             if '@' not in f:
                 self.log(logging.ERROR, 'artifact', {},
                          'Expected a list of files of the form path@task-id')
                 return 1
             name, task_id = f.rsplit('@', 1)
-            records[name] = DownloadRecord(
+            records[os.path.basename(name)] = DownloadRecord(
                 get_artifact_url(task_id, name), os.path.basename(name),
                 None, None, None, unpack=True)
 
         for record in records.itervalues():
             self.log(logging.INFO, 'artifact', {'name': record.basename},
                      'Downloading {name}')
             valid = False
             # sleeptime is 60 per retry.py, used by tooltool_wrapper.sh