diff options
| -rwxr-xr-x | indra/lib/python/indra/util/llmanifest.py | 65 | ||||
| -rwxr-xr-x | indra/newview/viewer_manifest.py | 34 | 
2 files changed, 55 insertions, 44 deletions
| diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 57788f6099..4bc70b2ca4 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -27,6 +27,7 @@ THE SOFTWARE.  $/LicenseInfo$  """ +from collections import namedtuple, defaultdict  import commands  import errno  import filecmp @@ -312,6 +313,8 @@ class LLManifestRegistry(type):          if match:             cls.manifests[match.group(1).lower()] = cls +MissingFile = namedtuple("MissingFile", ("pattern", "tried")) +  class LLManifest(object):      __metaclass__ = LLManifestRegistry      manifests = {} @@ -333,7 +336,8 @@ class LLManifest(object):          self.dst_prefix = [args['dest']]          self.created_paths = []          self.package_name = "Unknown" -         +        self.missing = [] +      def default_channel(self):          return self.args.get('channel', None) == RELEASE_CHANNEL @@ -592,6 +596,40 @@ class LLManifest(object):      def package_action(self, src, dst):          pass +    def finish(self): +        """ +        generic finish, always called before the ${action}_finish() methods +        """ +        # Collecting MissingFile instances in self.missing, and checking that +        # here, is intended to minimize the number of (potentially lengthy) +        # build cycles a developer must run in order to fix missing-files +        # errors. The manifest processing is necessarily the last step in a +        # build, and if we only caught a single missing file error per run, +        # the developer would need to run a build for each additional missing- +        # file error until all were resolved. This way permits the developer +        # to resolve them all at once. +        if self.missing: +            print '*' * 72 +            print "Missing files:" +            # Instead of just dumping each missing file and all the places we +            # looked for it, group by common sets of places we looked. Use a +            # set to store the 'tried' directories, to avoid mismatches due to +            # reordering -- but since we intend to use the set of 'tried' +            # directories as a dict key, it must be a frozenset. +            organize = defaultdict(set) +            for missingfile in self.missing: +                organize[frozenset(missingfile.tried)].add(missingfile.pattern) +            # Now dump all the patterns sought in each group of 'tried' +            # directories. +            for tried, patterns in organize.items(): +                print "  Could not find in:" +                for dir in sorted(tried): +                    print "    %s" % dir +                for pattern in sorted(patterns): +                    print "      %s" % pattern +            print '*' * 72 +            raise MissingError('%s patterns could not be found' % len(self.missing)) +      def copy_finish(self):          pass @@ -825,18 +863,23 @@ class LLManifest(object):              return count          try_prefixes = [self.get_src_prefix(), self.get_artwork_prefix(), self.get_build_prefix()] -        tried=[] -        count=0 -        while not count and try_prefixes:  -            pfx = try_prefixes.pop(0) +        for pfx in try_prefixes:              try:                  count = try_path(os.path.join(pfx, src))              except MissingError: -                tried.append(pfx) -                if not try_prefixes: -                    # no more prefixes left to try -                    raise MissingError("unable to find '%s'; looked in:\n  %s" % (src, '\n  '.join(tried))) -                     +                # if we produce MissingError, just try the next prefix +                continue +            # If we actually found nonzero files, stop looking +            if count: +                break +        else: +            # no more prefixes left to try +            print("\nunable to find '%s'; looked in:\n  %s" % (src, '\n  '.join(try_prefixes))) +            self.missing.append(MissingFile(pattern=src, tried=try_prefixes)) +            # At this point 'count' might never have been successfully +            # assigned! Even if it was, though, we can be sure it is 0. +            return 0 +          print "%d files" % count          # Let caller check whether we processed as many files as expected. In @@ -847,6 +890,8 @@ class LLManifest(object):          self.actions = actions          self.construct()          # perform finish actions +        # generic finish first +        self.finish()          for action in self.actions:              methodname = action + "_finish"              method = getattr(self, methodname, None) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3f6a7124a4..9976c49ca5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -145,13 +145,10 @@ class ViewerManifest(LLManifest):              with self.prefix(src_dst="skins"):                      # include the entire textures directory recursively                      with self.prefix(src_dst="*/textures"): -                            self.path("*/*.tga") -                            self.path("*/*.j2c")                              self.path("*/*.jpg")                              self.path("*/*.png")                              self.path("*.tga")                              self.path("*.j2c") -                            self.path("*.jpg")                              self.path("*.png")                              self.path("textures.xml")                      self.path("*/xui/*/*.xml") @@ -171,11 +168,6 @@ class ViewerManifest(LLManifest):                              self.path("*/*/*.gif") -            # local_assets dir (for pre-cached textures) -            with self.prefix(src_dst="local_assets"): -                self.path("*.j2c") -                self.path("*.tga") -              #build_data.json.  Standard with exception handling is fine.  If we can't open a new file for writing, we have worse problems              #platform is computed above with other arg parsing              build_data_dict = {"Type":"viewer","Version":'.'.join(self.args['version']), @@ -514,17 +506,6 @@ class WindowsManifest(ViewerManifest):          with self.prefix(src=os.path.join(self.args['build'], os.pardir,                                            'sharedlibs', self.args['configuration'])): -            # Get llcommon and deps. If missing assume static linkage and continue. -            try: -                self.path('llcommon.dll') -                self.path('libapr-1.dll') -                self.path('libaprutil-1.dll') -                self.path('libapriconv-1.dll') -                 -            except MissingError as err: -                print err.message -                print "Skipping llcommon.dll (assuming llcommon was linked statically)" -              # Mesh 3rd party libs needed for auto LOD and collada reading              try:                  self.path("glod.dll") @@ -549,13 +530,9 @@ class WindowsManifest(ViewerManifest):              if self.args['configuration'].lower() == 'debug':                  self.path("msvcr120d.dll")                  self.path("msvcp120d.dll") -                self.path("msvcr100d.dll") -                self.path("msvcp100d.dll")              else:                  self.path("msvcr120.dll")                  self.path("msvcp120.dll") -                self.path("msvcr100.dll") -                self.path("msvcp100.dll")              # Vivox runtimes              self.path("SLVoice.exe") @@ -565,8 +542,6 @@ class WindowsManifest(ViewerManifest):              else:                  self.path("vivoxsdk.dll")                  self.path("ortp.dll") -            self.path("libsndfile-1.dll") -            self.path("vivoxoal.dll")              # Security              self.path("ssleay32.dll") @@ -589,15 +564,6 @@ class WindowsManifest(ViewerManifest):                      self.path("BugSplat.dll")                      self.path("BugSplatRc.dll") -            # For google-perftools tcmalloc allocator. -            try: -                if self.args['configuration'].lower() == 'debug': -                    self.path('libtcmalloc_minimal-debug.dll') -                else: -                    self.path('libtcmalloc_minimal.dll') -            except: -                print "Skipping libtcmalloc_minimal.dll" -          self.path(src="licenses-win32.txt", dst="licenses.txt")          self.path("featuretable.txt") | 
