From 296480d552e36f6aae9d94129386d984781da2ef Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 16 Sep 2019 12:50:30 -0400
Subject: [PATCH] SL-11598: viewer_manifest.py should fail if a viewer file is
 missing

---
 indra/lib/python/indra/util/llmanifest.py |  3 +-
 indra/newview/viewer_manifest.py          | 34 +++++++++++++----------
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py
index 2e6cf53912c..57788f60992 100755
--- a/indra/lib/python/indra/util/llmanifest.py
+++ b/indra/lib/python/indra/util/llmanifest.py
@@ -835,7 +835,8 @@ def try_path(src):
                 tried.append(pfx)
                 if not try_prefixes:
                     # no more prefixes left to try
-                    print "unable to find '%s'; looked in:\n  %s" % (src, '\n  '.join(tried))
+                    raise MissingError("unable to find '%s'; looked in:\n  %s" % (src, '\n  '.join(tried)))
+                    
         print "%d files" % count
 
         # Let caller check whether we processed as many files as expected. In
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index fcb97ded8ff..3f6a7124a40 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -46,7 +46,7 @@
 # Put it FIRST because some of our build hosts have an ancient install of
 # indra.util.llmanifest under their system Python!
 sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python"))
-from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError
+from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError, MissingError
 from llbase import llsd
 
 class ViewerManifest(LLManifest):
@@ -176,9 +176,6 @@ def construct(self):
                 self.path("*.j2c")
                 self.path("*.tga")
 
-            # File in the newview/ directory
-            self.path("gpu_table.txt")
-
             #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']),
@@ -524,7 +521,7 @@ def construct(self):
                 self.path('libaprutil-1.dll')
                 self.path('libapriconv-1.dll')
                 
-            except RuntimeError as err:
+            except MissingError as err:
                 print err.message
                 print "Skipping llcommon.dll (assuming llcommon was linked statically)"
 
@@ -990,7 +987,7 @@ def construct(self):
 
                 with self.prefix(src=relpkgdir, dst=""):
                     self.path("libndofdev.dylib")
-                    self.path("libhunspell-1.3.0.dylib")   
+                    self.path("libhunspell-1.3.a")   
 
                 with self.prefix(src_dst="cursors_mac"):
                     self.path("*.tif")
@@ -1037,11 +1034,15 @@ def path_optional(src, dst):
                     # (source, dest) pair to self.file_list for every expanded
                     # file processed. Remember its size before the call.
                     oldlen = len(self.file_list)
-                    self.path(src, dst)
-                    # The dest appended to self.file_list has been prepended
-                    # with self.get_dst_prefix(). Strip it off again.
-                    added = [os.path.relpath(d, self.get_dst_prefix())
-                             for s, d in self.file_list[oldlen:]]
+                    try:
+                        self.path(src, dst)
+                        # The dest appended to self.file_list has been prepended
+                        # with self.get_dst_prefix(). Strip it off again.
+                        added = [os.path.relpath(d, self.get_dst_prefix())
+                                 for s, d in self.file_list[oldlen:]]
+                    except MissingError as err:
+                        print >> sys.stderr, "Warning: "+err.msg
+                        added = []
                     if not added:
                         print "Skipping %s" % dst
                     return added
@@ -1076,8 +1077,8 @@ def path_optional(src, dst):
                 # SLVoice and vivox lols, no symlinks needed
                 for libfile in (
                                 'libortp.dylib',
-                                'libsndfile.dylib',
-                                'libvivoxoal.dylib',
+                                #'libsndfile.dylib',
+                                #'libvivoxoal.dylib',
                                 'libvivoxsdk.dylib',
                                 'libvivoxplatform.dylib',
                                 'SLVoice',
@@ -1596,4 +1597,9 @@ def construct(self):
         dict(name='bugsplat', description="""BugSplat database to which to post crashes,
              if BugSplat crash reporting is desired""", default=''),
         ]
-    main(extra=extra_arguments)
+    try:
+        main(extra=extra_arguments)
+    except (ManifestError, MissingError) as err:
+        sys.exit("\nviewer_manifest.py failed: "+err.msg)
+    except:
+        raise
-- 
GitLab