Bug 1240323 - Fix installation of binary components in a subdir of dist/bin for linux artifact builds. r=nalexander draft
authorChris Manchester <cmanchester@mozilla.com>
Sat, 16 Jan 2016 16:01:53 -0800
changeset 322211 0c8e525a2b237f0eb2c95e676d153ae5cbdeced6
parent 322209 1801185b069b4a3af9bea81d1f29292850730f69
child 322212 c5560804eee444668f073ca7d05edfbef9090a62
push id9560
push usercmanchester@mozilla.com
push dateSun, 17 Jan 2016 00:07:34 +0000
reviewersnalexander
bugs1240323
milestone46.0a1
Bug 1240323 - Fix installation of binary components in a subdir of dist/bin for linux artifact builds. r=nalexander A recent change regressed this behavior -- while an artifact build runs, it doesn't load certain "about:" pages due to missing libraries in subdirectories of dist/bin.
python/mozbuild/mozbuild/artifacts.py
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -188,36 +188,38 @@ class LinuxArtifactJob(ArtifactJob):
         'firefox/crashreporter',
         'firefox/dependentlibs.list',
         'firefox/firefox',
         'firefox/firefox-bin',
         'firefox/platform.ini',
         'firefox/plugin-container',
         'firefox/updater',
         'firefox/webapprt-stub',
-        'firefox/*.so',
+        'firefox/**/*.so',
     }
 
     def process_package_artifact(self, filename, processed_filename):
         added_entry = False
 
         with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
             with tarfile.open(filename) as reader:
                 for f in reader:
                     if not f.isfile():
                         continue
 
                     if not any(mozpath.match(f.name, p) for p in self.package_artifact_patterns):
                         continue
 
-                    basename = mozpath.basename(f.name)
+                    # We strip off the relative "firefox/" bit from the path,
+                    # but otherwise preserve it.
+                    destpath = mozpath.relpath(f.name, "firefox")
                     self.log(logging.INFO, 'artifact',
-                             {'basename': basename},
-                             'Adding {basename} to processed archive')
-                    writer.add(basename.encode('utf-8'), reader.extractfile(f), mode=f.mode)
+                             {'destpath': destpath},
+                             'Adding {destpath} to processed archive')
+                    writer.add(destpath.encode('utf-8'), reader.extractfile(f), mode=f.mode)
                     added_entry = True
 
         if not added_entry:
             raise ValueError('Archive format changed! No pattern from "{patterns}" '
                              'matched an archive path.'.format(
                                  patterns=LinuxArtifactJob.package_artifact_patterns))