Bug 1230060 - Don't fail to read an install manifest containing non-actionable items. r=gps
☠☠ backed out by 081e18054575 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 03 Dec 2015 16:54:09 +0900
changeset 309853 1e44f391a3cb0c4e2bcbf7918e20a46ca58b6bab
parent 309852 9d1f7f04a68283d91ea243ffbf4d37d9b5e2c419
child 309854 a788c06e448a1082edc1818552953422a61a8ba2
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1230060
milestone45.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 1230060 - Don't fail to read an install manifest containing non-actionable items. r=gps Future improvements to process_install_manifest's --track option will require adding data in the tracking dump that uses an install manifest form, and I don't want e.g. switching branches or bisection to require to clobber in order to do the right thing, so this change future-proofs the install manifest reader.
python/mozbuild/mozpack/manifests.py
--- a/python/mozbuild/mozpack/manifests.py
+++ b/python/mozbuild/mozpack/manifests.py
@@ -80,16 +80,18 @@ class InstallManifest(object):
     Version 3 added support for pattern entries.
     Version 4 added preprocessed file support.
     """
 
     CURRENT_VERSION = 4
 
     FIELD_SEPARATOR = '\x1f'
 
+    # Negative values are reserved for non-actionable items, that is, metadata
+    # that doesn't describe files in the destination.
     SYMLINK = 1
     COPY = 2
     REQUIRED_EXISTS = 3
     OPTIONAL_EXISTS = 4
     PATTERN_SYMLINK = 5
     PATTERN_COPY = 6
     PREPROCESS = 7
 
@@ -158,18 +160,21 @@ class InstallManifest(object):
             if record_type == self.PREPROCESS:
                 dest, source, deps, marker, defines, warnings = fields[1:]
 
                 self.add_preprocess(source, dest, deps, marker,
                     self._decode_field_entry(defines),
                     silence_missing_directive_warnings=bool(int(warnings)))
                 continue
 
-            raise UnreadableInstallManifest('Unknown record type: %d' %
-                record_type)
+            # Don't fail for non-actionable items, allowing
+            # forward-compatibility with those we will add in the future.
+            if record_type >= 0:
+                raise UnreadableInstallManifest('Unknown record type: %d' %
+                    record_type)
 
     def __len__(self):
         return len(self._dests)
 
     def __contains__(self, item):
         return item in self._dests
 
     def __eq__(self, other):