From 8d7cde22c31a59d0503230334b1d68e858364c9a Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Tue, 11 Oct 2022 15:10:04 -0700 Subject: Replace llbase with llsd module --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3327ecfb56..30b0d23a93 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -49,7 +49,7 @@ viewer_dir = os.path.dirname(__file__) # 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, MissingError -from llbase import llsd +import llsd class ViewerManifest(LLManifest): def is_packaging_viewer(self): -- cgit v1.2.3 From 6112e92b61c334d3c0656bacdea92690cea1a76b Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Wed, 12 Oct 2022 11:49:47 -0700 Subject: Upload installer, build Release, use large runner --- .../installers/windows/installer_template.nsi | 1 - indra/newview/viewer_manifest.py | 34 ++++++---------------- 2 files changed, 9 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 7513908cb4..f7908b059c 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -26,7 +26,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Compiler flags ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Unicode true SetOverwrite on # Overwrite files SetCompress auto # Compress if saves space SetCompressor /solid lzma # Compress whole installer as one block diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 30b0d23a93..eec8e84a2d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -28,7 +28,6 @@ $/LicenseInfo$ """ import errno import glob -import itertools import json import os import os.path @@ -36,12 +35,9 @@ import plistlib import random import re import shutil -import stat import subprocess import sys -import tarfile import time -import zipfile viewer_dir = os.path.dirname(__file__) # Add indra/lib/python to our path so we don't have to muck with PYTHONPATH. @@ -789,27 +785,15 @@ class WindowsManifest(ViewerManifest): # Check two paths, one for Program Files, and one for Program Files (x86). # Yay 64bit windows. - for ProgramFiles in 'ProgramFiles', 'ProgramFiles(x86)': - NSIS_path = os.path.expandvars(r'${%s}\NSIS\makensis.exe' % ProgramFiles) - if os.path.exists(NSIS_path): - break - installer_created=False - nsis_attempts=3 - nsis_retry_wait=15 - for attempt in range(nsis_attempts): - try: - self.run_command([NSIS_path, '/V2', self.dst_path_of(tempfile)]) - except ManifestError as err: - if attempt+1 < nsis_attempts: - print("nsis failed, waiting %d seconds before retrying" % nsis_retry_wait, file=sys.stderr) - time.sleep(nsis_retry_wait) - nsis_retry_wait*=2 - else: - # NSIS worked! Done! - break - else: - print("Maximum nsis attempts exceeded; giving up", file=sys.stderr) - raise + nsis_path = "makensis.exe" + for program_files in '${programfiles}', '${programfiles(x86)}': + for nesis_path in 'NSIS', 'NSIS\\Unicode': + possible_path = os.path.expandvars(f"{program_files}\\{nesis_path}\\makensis.exe") + if os.path.exists(possible_path): + nsis_path = possible_path + break + + self.run_command([possible_path, '/V2', self.dst_path_of(tempfile)]) self.sign(installer_file) self.created_path(self.dst_path_of(installer_file)) -- cgit v1.2.3 From 42c69448da85b06caf9edabb4dd3f5f4ae926ea7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Jun 2023 17:32:31 -0400 Subject: SL-18837: Don't include a version-specific Boost.Regex header. Let the umbrella header make that decision. --- indra/newview/lllogchat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index ba82ff0b0f..8c03292361 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include #if LL_MSVC -- cgit v1.2.3 From 524f3b2af08c4e2a856a70d4505391c6f56d76df Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 5 Jun 2023 10:43:16 -0400 Subject: SL-18837: #include in several sources that need it. It seems we're no longer implicitly inheriting from some other [set of] header file[s]. Where we use std::array, bring it in explicitly. --- indra/newview/llenvironment.h | 2 ++ indra/newview/llimview.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 64fd170e43..1c8a68ae02 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -42,6 +42,8 @@ #include +#include + //------------------------------------------------------------------------- class LLViewerCamera; class LLParcel; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6880cf2171..61a01d7418 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -72,6 +72,8 @@ #include "llcorehttputil.h" #include "lluiusage.h" +#include + const static std::string ADHOC_NAME_SUFFIX(" Conference"); const static std::string NEARBY_P2P_BY_OTHER("nearby_P2P_by_other"); -- cgit v1.2.3 From 3c63cc9c55b1193f2876e7523f0b6766f5a8c5ac Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 28 Jun 2023 18:36:51 -0400 Subject: SL-18837: Make LLVersionInfo::getBuild() S64 for GitHub run IDs. --- indra/newview/llappviewer.cpp | 4 ++-- indra/newview/llpanellogin.cpp | 4 ++-- indra/newview/lltranslate.cpp | 4 ++-- indra/newview/llversioninfo.cpp | 2 +- indra/newview/llversioninfo.h | 2 +- indra/newview/llweb.cpp | 2 +- indra/newview/llxmlrpctransaction.cpp | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8235e4466c..99ace834c2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3552,7 +3552,7 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::instance().getMajor(); gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::instance().getMinor(); gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::instance().getPatch(); - gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::instance().getBuild(); + gDebugInfo["ClientInfo"]["BuildVersion"] = std::to_string(LLVersionInfo::instance().getBuild()); gDebugInfo["ClientInfo"]["AddressSize"] = LLVersionInfo::instance().getAddressSize(); gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); @@ -5669,7 +5669,7 @@ void LLAppViewer::handleLoginComplete() gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::instance().getMajor(); gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::instance().getMinor(); gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::instance().getPatch(); - gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::instance().getBuild(); + gDebugInfo["ClientInfo"]["BuildVersion"] = std::to_string(LLVersionInfo::instance().getBuild()); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel && parcel->getMusicURL()[0]) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index b14fdbf38e..c61c176530 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -300,7 +300,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, setDefaultBtn(def_btn); std::string channel = LLVersionInfo::instance().getChannel(); - std::string version = llformat("%s (%d)", + std::string version = llformat("%s (%ld)", LLVersionInfo::instance().getShortVersion().c_str(), LLVersionInfo::instance().getBuild()); @@ -894,7 +894,7 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - params["version"] = llformat("%s (%d)", + params["version"] = llformat("%s (%ld)", LLVersionInfo::instance().getShortVersion().c_str(), LLVersionInfo::instance().getBuild()); params["channel"] = LLVersionInfo::instance().getChannel(); diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 34d3ed8bb1..d7cb12826f 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -133,7 +133,7 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, std:: LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - std::string user_agent = llformat("%s %d.%d.%d (%d)", + std::string user_agent = llformat("%s %d.%d.%d (%ld)", LLVersionInfo::instance().getChannel().c_str(), LLVersionInfo::instance().getMajor(), LLVersionInfo::instance().getMinor(), @@ -177,7 +177,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - std::string user_agent = llformat("%s %d.%d.%d (%d)", + std::string user_agent = llformat("%s %d.%d.%d (%ld)", LLVersionInfo::instance().getChannel().c_str(), LLVersionInfo::instance().getMajor(), LLVersionInfo::instance().getMinor(), diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 376a7fce76..62bfa24e29 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -91,7 +91,7 @@ S32 LLVersionInfo::getPatch() return LL_VIEWER_VERSION_PATCH; } -S32 LLVersionInfo::getBuild() +S64 LLVersionInfo::getBuild() { return LL_VIEWER_VERSION_BUILD; } diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 02ff0c094a..122bd5c47a 100644 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -61,7 +61,7 @@ public: S32 getPatch(); /// return the build number as an integer - S32 getBuild(); + S64 getBuild(); /// return the full viewer version as a string like "2.0.0.200030" std::string getVersion(); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index c4d873dd22..9afe332025 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -160,7 +160,7 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, substitution["VERSION_MAJOR"] = LLVersionInfo::instance().getMajor(); substitution["VERSION_MINOR"] = LLVersionInfo::instance().getMinor(); substitution["VERSION_PATCH"] = LLVersionInfo::instance().getPatch(); - substitution["VERSION_BUILD"] = LLVersionInfo::instance().getBuild(); + substitution["VERSION_BUILD"] = std::to_string(LLVersionInfo::instance().getBuild()); substitution["CHANNEL"] = LLVersionInfo::instance().getChannel(); substitution["GRID"] = LLGridManager::getInstance()->getGridId(); substitution["GRID_LOWERCASE"] = utf8str_tolower(LLGridManager::getInstance()->getGridId()); diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 8d178dbbdc..b851b7ad5c 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -384,7 +384,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); - std::string user_agent = llformat("%s %d.%d.%d (%d)", + std::string user_agent = llformat("%s %d.%d.%d (%ld)", LLVersionInfo::instance().getChannel().c_str(), LLVersionInfo::instance().getMajor(), LLVersionInfo::instance().getMinor(), -- cgit v1.2.3 From ecb938c95b66ff58840aae64fd5fb791c55ec080 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 18 Jul 2023 13:38:05 -0400 Subject: SL-18837: Try waiting a couple seconds before hdiutil detach to try to avoid "Resource busy" errors from hdiutil. --- indra/newview/viewer_manifest.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4660991de6..1e43485b9c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1329,6 +1329,10 @@ class DarwinManifest(ViewerManifest): self.run_command([self.src_path_of("installers/darwin/apple-notarize.sh"), app_in_dmg]) finally: + # Empirically, on GitHub we've hit errors like: + # hdiutil: couldn't eject "disk10" - Resource busy + # Try waiting a bit to see if that improves reliability. + time.sleep(2) # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From e8cd5205e89993df357410c245f99ebb7703958d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 31 Aug 2023 15:53:56 -0400 Subject: SL-19243: Try to run Windows BugSplat uploads as a separate GH job. Upload a new Windows-exe artifact containing just the executable (needed by BugSplat) separately from the artifact containing the whole NSIS installer. This requires a new viewer_exe step output set by viewer_manifest.py. Define viewer_channel and viewer_version as build job outputs. Set viewer_channel in build.yaml when tag is interpreted. Set viewer_version in build.sh at the point when it would have posted viewer_version.txt to codeticket. Add a post-windows-symbols job dependent on the build job that engages secondlife/viewer-post-bugsplat-windows, which in turn engages secondlife/post-bugsplat-windows. We keep the actual upload code in a separate repo in case we need to modify that code before rerunning to resolve upload errors. If we kept the upload code in the viewer repo itself, rerunning the upload with modifications would necessarily require rerunning the viewer build, which would defeat the purpose of SL-19243. Because of that new upload job in build.yaml, skip Windows symbol uploads in build.sh. Use a simple (platform name) artifact name for metadata because of flatten_files.py's filename collision resolution. Use hyphens, not spaces, in remaining artifact names: apparently download-artifact doesn't much like artifacts with spaces in their names. Only run the release job when in fact there's a tag. Without that, we get errors. We need not create flatten_files.py's output directory beforehand because it will do that implicitly. --- indra/newview/viewer_manifest.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1e43485b9c..6c4f8cb2d4 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -480,6 +480,12 @@ class WindowsManifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) + # emit that as one of the GitHub step outputs + GITHUB_OUTPUT = os.getenv('GITHUB_OUTPUT') + if GITHUB_OUTPUT: + exepath = os.path.join(self.get_dst_prefix(), self.final_exe()) + with open(GITHUB_OUTPUT, 'a') as outf: + print(f'viewer_exe={exepath}', file=outf) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list -- cgit v1.2.3 From c8aa205fab621c6b88393b06268e0026eeb07a23 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 31 Aug 2023 22:35:49 -0400 Subject: SL-19243: Try to robustify GH Mac volume detach Use a retry loop very like the code-signing retry loop. --- indra/newview/viewer_manifest.py | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 6c4f8cb2d4..aa28632e8a 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1288,6 +1288,7 @@ class DarwinManifest(ViewerManifest): 'Keychains', 'viewer.keychain') self.run_command(['security', 'unlock-keychain', '-p', keychain_pwd, viewer_keychain]) + sign_retries=3 sign_retry_wait=15 resources = app_in_dmg + "/Contents/Resources/" plain_sign = glob.glob(resources + "llplugin/*.dylib") @@ -1296,9 +1297,10 @@ class DarwinManifest(ViewerManifest): resources + "SLPlugin.app/Contents/MacOS/SLPlugin", app_in_dmg, ] - for attempt in range(3): + for attempt in range(sign_retries): if attempt: # second or subsequent iteration - print("codesign failed, waiting {:d} seconds before retrying".format(sign_retry_wait), + print(f"codesign attempt {attempt+1} failed, " + f"waiting {sign_retry_wait:d} seconds before retrying", file=sys.stderr) time.sleep(sign_retry_wait) sign_retry_wait*=2 @@ -1329,18 +1331,37 @@ class DarwinManifest(ViewerManifest): # 'err' goes out of scope sign_failed = err else: - print("Maximum codesign attempts exceeded; giving up", file=sys.stderr) + print(f"{sign_retries} codesign attempts failed; giving up", + file=sys.stderr) raise sign_failed self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) - self.run_command([self.src_path_of("installers/darwin/apple-notarize.sh"), app_in_dmg]) + self.run_command([self.src_path_of("installers/darwin/apple-notarize.sh"), + app_in_dmg]) finally: + # Unmount the image even if exceptions from any of the above + detach_retries = 3 + detach_retry_wait = 2 # Empirically, on GitHub we've hit errors like: # hdiutil: couldn't eject "disk10" - Resource busy - # Try waiting a bit to see if that improves reliability. - time.sleep(2) - # Unmount the image even if exceptions from any of the above - self.run_command(['hdiutil', 'detach', '-force', devfile]) + for attempt in range(detach_retries): + if attempt: # second or subsequent iteration + print(f'detach failed, waiting {detach_retry_wait} seconds before retrying', + file=sys.stderr) + # Try waiting a bit to see if that improves reliability. + time.sleep(detach_retry_wait) + detach_retry_wait *= 2 + + try: + self.run_command(['hdiutil', 'detach', '-force', devfile]) + # if no exception, the detach worked + break + except ManifestError as err: + detach_failed = err + else: + print(f'{detach_retries} detach attempts failed', file=sys.stderr) + ## can we carry on anyway?? + ## raise detach_failed print("Converting temp disk image to final disk image") self.run_command(['hdiutil', 'convert', sparsename, '-format', 'UDZO', -- cgit v1.2.3 From 00d8d4e9cdff7b5b584e7bd4f30c46902263c033 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 1 Sep 2023 12:16:36 -0400 Subject: SL-19243: Upload Mac .app as another build artifact. --- indra/newview/viewer_manifest.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index aa28632e8a..d07ec22496 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -406,6 +406,15 @@ class ViewerManifest(LLManifest): return os.path.relpath(abspath(path), abspath(base)) + def set_github_output_path(self, variable, path): + self.set_github_output(variable, os.path.join(self.get_dst_prefix(), path)) + + def set_github_output(self, variable, value): + GITHUB_OUTPUT = os.getenv('GITHUB_OUTPUT') + if GITHUB_OUTPUT: + with open(GITHUB_OUTPUT, 'a') as outf: + print('='.join((variable, value)), file=outf) + class WindowsManifest(ViewerManifest): # We want the platform, per se, for every Windows build to be 'win'. The @@ -481,11 +490,7 @@ class WindowsManifest(ViewerManifest): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) # emit that as one of the GitHub step outputs - GITHUB_OUTPUT = os.getenv('GITHUB_OUTPUT') - if GITHUB_OUTPUT: - exepath = os.path.join(self.get_dst_prefix(), self.final_exe()) - with open(GITHUB_OUTPUT, 'a') as outf: - print(f'viewer_exe={exepath}', file=outf) + self.set_github_output_path('viewer_exe', self.final_exe()) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -848,6 +853,7 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") + self.set_github_output_path('viewer_exe', self.channel() + ".app") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From b13c1f77c7004ab991eb38637ccde01bc4f13b6f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 2 Sep 2023 09:44:24 -0400 Subject: SL-19242: Emphasize to upload-artifact that our .app is a directory --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index d07ec22496..1f67324aaa 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -853,7 +853,7 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") - self.set_github_output_path('viewer_exe', self.channel() + ".app") + self.set_github_output_path('viewer_exe', self.channel() + ".app/") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From 3eea556c28f86d1c1334879ff4d7dfc36201485e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 2 Sep 2023 11:02:23 -0400 Subject: SL-19243: Post xcarchive.zip instead of separate symbols tarball. On Mac, in the CMake USE_BUGSPLAT logic, we created both xcarchive.zip (which is what BugSplat wants to see) and secondlife-symbols-darwin -64.tar.bz2 (which we don't think is used for anything). The tarball was posted to codeticket -- but why? If the point is to manually re-upload to BugSplat in case of failure, we'll do better saving xcarchive.zip to codeticket. For SL-19243, posting xcarchive.zip directly supports the goal of breaking out the upload to BugSplat as a separate step. Anyway, since xcarchive.zip is a superset of the tarball, the tarball can be recreated from the zip file, whereas the zip file can't be recreated from the tarball without opening the .dmg installer and extracting the viewer executable. If the xcarchive.zip file exists (that is, on Mac), post that to codeticket or GitHub, as applicable, instead of the tarball. In fact, in the USE_BUGSPLAT case, don't even bother creating the tarball since we're going to ignore it. Make the new build.sh logic that insists on BUGSPLAT_USER and BUGSPLAT_PASS conditional on BUGSPLAT_DB. --- indra/newview/CMakeLists.txt | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dbd1f1b4ac..f23e4fa849 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2141,20 +2141,6 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") add_dependencies(dsym_generate ${VIEWER_BINARY_NAME}) - add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" - # See above comments about "tar ...j" - COMMAND "tar" - ARGS - "cjf" - "${VIEWER_SYMBOL_FILE}" - "-C" - "${VIEWER_APP_DSYM}/.." - "${product}.dSYM" - DEPENDS "${VIEWER_APP_DSYM}" - COMMENT "Packing dSYM into ${VIEWER_SYMBOL_FILE}" - ) - add_custom_target(dsym_tarball DEPENDS "${VIEWER_SYMBOL_FILE}") - add_dependencies(dsym_tarball dsym_generate) add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" ARGS @@ -2172,16 +2158,15 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" COMMAND rm -rf "${VIEWER_APP_DSYM}" COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" - DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_APP_XCARCHIVE}" + DEPENDS "${VIEWER_APP_XCARCHIVE}" COMMENT "Cleaning up dSYM" ) add_custom_target(generate_symbols DEPENDS "${VIEWER_APP_DSYM}" - "${VIEWER_SYMBOL_FILE}" "${VIEWER_APP_XCARCHIVE}" "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" ) - add_dependencies(generate_symbols dsym_tarball dsym_xcarchive) + add_dependencies(generate_symbols dsym_xcarchive) endif (DARWIN) if (LINUX) # TBD -- cgit v1.2.3 From 2eda2eb21b720646ec8acc16d47551226f1c059d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 2 Sep 2023 12:17:06 -0400 Subject: SL-19242: Fix duplicated 'Second Life Mumble.app' path component in the path passed as the macOS viewer_exe GitHub output. --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1f67324aaa..f6282743bb 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -853,7 +853,8 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") - self.set_github_output_path('viewer_exe', self.channel() + ".app/") + # capture the entire destination app bundle + self.set_github_output_path('viewer_exe', '') pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From db71f834bc4b6898d8b38b484eb953924d42a5db Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 7 Sep 2023 11:44:53 -0400 Subject: SL-18837: Without USE_BUGSPLAT, no target generate_symbols. --- indra/newview/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f23e4fa849..68f96e5669 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2171,10 +2171,9 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE if (LINUX) # TBD endif (LINUX) - endif (USE_BUGSPLAT) - # for both Bugsplat and Breakpad - add_dependencies(llpackage generate_symbols) + add_dependencies(llpackage generate_symbols) + endif (USE_BUGSPLAT) endif () if (LL_TESTS) -- cgit v1.2.3 From 2d04cc14d3805df982d51d96d2e3d180f5ef0b34 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Sep 2023 17:01:46 -0400 Subject: SL-19242: Post -app artifact, not -exe, with entire install image. Previously we posted Windows-exe, macOS-exe artifacts that were a little inconsistent: Windows-exe contained just the Windows executable, whereas macOS-exe contained the whole .app tree (but without the .app directory). Change to post Windows-app, macOS-app artifacts that each contain the whole viewer install image, including the top-level application name directory. This is what we'll need to codesign and notarize. --- indra/newview/viewer_manifest.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f6282743bb..679a3441b9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -489,8 +489,11 @@ class WindowsManifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) - # emit that as one of the GitHub step outputs - self.set_github_output_path('viewer_exe', self.final_exe()) + # Emit the whole app image as one of the GitHub step outputs. The + # current get_dst_prefix() is the top-level contents of the app + # directory -- so hop outward to the directory containing the app + # name. + self.set_github_output_path('viewer_app', os.pardir) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -853,8 +856,9 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") - # capture the entire destination app bundle - self.set_github_output_path('viewer_exe', '') + # capture the entire destination app bundle, including the containing + # .app directory + self.set_github_output_path('viewer_app', os.pardir) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From ee82cd046f9bedc6a3eac96afc90f4413786669f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Sep 2023 19:25:47 -0400 Subject: SL-19242: Resolve '..' in viwer_app path before trying to upload. --- indra/newview/viewer_manifest.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 679a3441b9..e93a3db6d6 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -492,8 +492,11 @@ class WindowsManifest(ViewerManifest): # Emit the whole app image as one of the GitHub step outputs. The # current get_dst_prefix() is the top-level contents of the app # directory -- so hop outward to the directory containing the app - # name. - self.set_github_output_path('viewer_app', os.pardir) + # name. But upload_artifact refuses to deal with '..', so resolve + # the path before setting viewer_app. + self.set_github_output_path( + 'viewer_app', + os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir))) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -858,7 +861,9 @@ class DarwinManifest(ViewerManifest): self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") # capture the entire destination app bundle, including the containing # .app directory - self.set_github_output_path('viewer_app', os.pardir) + self.set_github_output_path( + 'viewer_app', + os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir))) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From dc0ebc96a4556b99b515364465b23a64e84f0899 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 9 Sep 2023 09:36:03 -0400 Subject: SL-19242: Try passing upload-artifact a normalized relative path. --- indra/newview/viewer_manifest.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e93a3db6d6..dd9ca569ce 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -407,7 +407,8 @@ class ViewerManifest(LLManifest): return os.path.relpath(abspath(path), abspath(base)) def set_github_output_path(self, variable, path): - self.set_github_output(variable, os.path.join(self.get_dst_prefix(), path)) + self.set_github_output(variable, + os.path.normpath(os.path.join(self.get_dst_prefix(), path))) def set_github_output(self, variable, value): GITHUB_OUTPUT = os.getenv('GITHUB_OUTPUT') @@ -492,11 +493,8 @@ class WindowsManifest(ViewerManifest): # Emit the whole app image as one of the GitHub step outputs. The # current get_dst_prefix() is the top-level contents of the app # directory -- so hop outward to the directory containing the app - # name. But upload_artifact refuses to deal with '..', so resolve - # the path before setting viewer_app. - self.set_github_output_path( - 'viewer_app', - os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir))) + # name. + self.set_github_output_path('viewer_app', os.pardir) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -861,9 +859,7 @@ class DarwinManifest(ViewerManifest): self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") # capture the entire destination app bundle, including the containing # .app directory - self.set_github_output_path( - 'viewer_app', - os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir))) + self.set_github_output_path('viewer_app', os.pardir) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From 29300a1fd356b7355ecfb56951e7d7ad0553ef15 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Sep 2023 10:07:51 -0400 Subject: SL-19242: Try harder to post artifacts containing exactly app image. In a Windows build tree, we don't actually have an app-named top directory, so don't package its containing directory -- just the app dir itself, e.g. "newview/Release". In a Mac build tree, though we do have "Second Life Mumble.app", its parent directory also contains other large stuff. Try posting a temp directory containing a symlink to the .app. Ditch the "!*.bat" exclusion: the presence of a second path (even an exclusion) changes how upload-artifact nests its contents. --- indra/newview/viewer_manifest.py | 46 +++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index dd9ca569ce..4084c1d9a4 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -37,6 +37,7 @@ import re import shutil import subprocess import sys +import tempfile import time viewer_dir = os.path.dirname(__file__) @@ -490,11 +491,8 @@ class WindowsManifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) - # Emit the whole app image as one of the GitHub step outputs. The - # current get_dst_prefix() is the top-level contents of the app - # directory -- so hop outward to the directory containing the app - # name. - self.set_github_output_path('viewer_app', os.pardir) + # Emit the whole app image as one of the GitHub step outputs. + self.set_github_output_path('viewer_app', '') with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -855,11 +853,39 @@ class DarwinManifest(ViewerManifest): return bool(set(["package", "unpacked"]).intersection(self.args['actions'])) def construct(self): - # copy over the build result (this is a no-op if run within the xcode script) - self.path(os.path.join(self.args['configuration'], self.channel()+".app"), dst="") - # capture the entire destination app bundle, including the containing - # .app directory - self.set_github_output_path('viewer_app', os.pardir) + # copy over the build result (this is a no-op if run within the xcode + # script) + appname = self.channel() + ".app" + self.path(os.path.join(self.args['configuration'], appname), dst="") + RUNNER_TEMP = os.getenv('RUNNER_TEMP') + # When running as a GitHub Action job, RUNNER_TEMP is the recommended + # temp directory. If we're not running on GitHub, don't create this + # temp directory or this symlink: we don't clean them up, trusting + # that the runner is itself transient. On a dev machine, that would + # result in temp-directory clutter. + if RUNNER_TEMP: + # We want an artifact containing the "Second Life Mumble.app" + # directory, which in turn contains the whole app bundle. + # Unfortunately, the directory that contains the .app directory + # also contains other stuff, notably the xcarchive.zip, which is + # itself enormous. Create a temp directory containing only (a link + # to) our .app dir, and specify that as the directory to upload. + wrapdir = tempfile.mkdtemp(dir=RUNNER_TEMP) + applink = os.path.join(wrapdir, appname) + # This link will be used by a different job step, so link to an + # absolute path: we can't guarantee that the other step will have + # the same current directory. + # diagnostic output + parentdir = os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir)) + for dir in parentdir, os.path.join(parentdir, appname): + print(f'Contents of {dir}:') + for item in os.listdir(dir): + print(f' {item}') + # end diagnostic output + appreal = os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir, appname)) + print(f"Linking {applink} => {appreal}") + os.symlink(appreal, applink) + self.set_github_output_path('viewer_app', wrapdir) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From 0107f030c85c1ea122309a21a4d6790fc22e6d10 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Sep 2023 12:53:34 -0400 Subject: SL-19242: Eliminate cruft from Windows app image artifact --- indra/newview/viewer_manifest.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4084c1d9a4..33d5720320 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -34,6 +34,7 @@ import os.path import plistlib import random import re +import secrets import shutil import subprocess import sys @@ -411,11 +412,18 @@ class ViewerManifest(LLManifest): self.set_github_output(variable, os.path.normpath(os.path.join(self.get_dst_prefix(), path))) - def set_github_output(self, variable, value): + def set_github_output(self, variable, *values): GITHUB_OUTPUT = os.getenv('GITHUB_OUTPUT') - if GITHUB_OUTPUT: + if GITHUB_OUTPUT and values: with open(GITHUB_OUTPUT, 'a') as outf: - print('='.join((variable, value)), file=outf) + if len(values) == 1: + print('='.join((variable, value)), file=outf) + else: + delim = secrets.token_hex(8) + print('<<'.join((variable, delim)), file=outf) + for value in values: + print(value, file=outf) + print(delim, file=outf) class WindowsManifest(ViewerManifest): @@ -492,7 +500,12 @@ class WindowsManifest(ViewerManifest): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) # Emit the whole app image as one of the GitHub step outputs. - self.set_github_output_path('viewer_app', '') + self.set_github_output('viewer_app', + self.get_dst_prefix(), # whole app directory + '!secondlife-bin.*', # except for this stuff + '!*.bat', + '!*.tar.bz2', + '!*.nsi') with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list -- cgit v1.2.3 From 0d0dafc1be14d0c4b8cf7b02ac949182d1eb093c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Sep 2023 13:33:30 -0400 Subject: SL-19242: Fix minor error in viewer_manifest.set_github_output(). --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 33d5720320..a5415bb4bc 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -417,7 +417,7 @@ class ViewerManifest(LLManifest): if GITHUB_OUTPUT and values: with open(GITHUB_OUTPUT, 'a') as outf: if len(values) == 1: - print('='.join((variable, value)), file=outf) + print('='.join((variable, values[0])), file=outf) else: delim = secrets.token_hex(8) print('<<'.join((variable, delim)), file=outf) -- cgit v1.2.3 From db2953e5de12eb5eea347f4069be9c0ab015dcdb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Sep 2023 15:29:32 -0400 Subject: SL-19242: Have to prefix upload-artifact exclude paths with pathname. --- indra/newview/viewer_manifest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index a5415bb4bc..1a8973ff84 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -500,12 +500,15 @@ class WindowsManifest(ViewerManifest): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) # Emit the whole app image as one of the GitHub step outputs. - self.set_github_output('viewer_app', - self.get_dst_prefix(), # whole app directory - '!secondlife-bin.*', # except for this stuff - '!*.bat', - '!*.tar.bz2', - '!*.nsi') + appbase = self.relpath(self.get_dst_prefix(), base=os.getcwd()) + self.set_github_output('viewer_app', appbase, + # except for this stuff + *(('!' + os.path.join(appbase, pattern)) + for pattern in ( + 'secondlife-bin.*', + '*.bat', + '*.tar.bz2', + '*.nsi'))) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list -- cgit v1.2.3 From 62879b6e698a839784e1319e0d555c01ce0b4220 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Sep 2023 18:05:32 -0400 Subject: SL-19242: Adjust Windows relative path base directory. --- indra/newview/viewer_manifest.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1a8973ff84..8869831635 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -499,8 +499,19 @@ class WindowsManifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) - # Emit the whole app image as one of the GitHub step outputs. - appbase = self.relpath(self.get_dst_prefix(), base=os.getcwd()) + # Emit the whole app image as one of the GitHub step outputs. When + # we feed upload-artifact multiple absolute pathnames, even just + # for exclusion, it ends up creating several extraneous directory + # levels within the artifact -- so try using only relative paths. + # One problem: as of right now, our current directory os.getcwd() + # is not the same as the initial working directory for this job + # step, meaning paths relative to our os.getcwd() won't work for + # the subsequent upload-artifact step. We're a couple directory + # levels down. Try adjusting for those when specifying the base + # for self.relpath(). + appbase = self.relpath( + self.get_dst_prefix(), + base=os.path.join(os.getcwd(), os.pardir, os.pardir)) self.set_github_output('viewer_app', appbase, # except for this stuff *(('!' + os.path.join(appbase, pattern)) -- cgit v1.2.3 From f31326189c99b18758b3754460d105a0195640c6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Sep 2023 19:38:55 -0400 Subject: SL-19242: Exclude installer from Windows-app artifact. --- indra/newview/viewer_manifest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 8869831635..b994b304eb 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -499,9 +499,12 @@ class WindowsManifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) - # Emit the whole app image as one of the GitHub step outputs. When - # we feed upload-artifact multiple absolute pathnames, even just - # for exclusion, it ends up creating several extraneous directory + # Emit the whole app image as one of the GitHub step outputs. We + # want the whole app -- but NOT the extraneous build products that + # get tossed into the same directory, such as the installer and + # the symbols tarball, so add exclusions. When we feed + # upload-artifact multiple absolute pathnames, even just for + # exclusion, it ends up creating several extraneous directory # levels within the artifact -- so try using only relative paths. # One problem: as of right now, our current directory os.getcwd() # is not the same as the initial working directory for this job @@ -517,6 +520,7 @@ class WindowsManifest(ViewerManifest): *(('!' + os.path.join(appbase, pattern)) for pattern in ( 'secondlife-bin.*', + '*_Setup.exe', '*.bat', '*.tar.bz2', '*.nsi'))) -- cgit v1.2.3 From be5f210e72a12eb31152c8d8c7f28c5d8930ba45 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 11:13:55 -0400 Subject: SL-19242: Don't exclude the prepared .nsi file from Windows-app. Since we need to run NSIS in a separate job step, allow the Windows-app build artifact to include the temporary .nsi file prepared by filling in our template. Also tweak the logic that finds and runs NSIS. --- indra/newview/viewer_manifest.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index b994b304eb..3f07eefbec 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -522,8 +522,7 @@ class WindowsManifest(ViewerManifest): 'secondlife-bin.*', '*_Setup.exe', '*.bat', - '*.tar.bz2', - '*.nsi'))) + '*.tar.bz2'))) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -831,14 +830,20 @@ class WindowsManifest(ViewerManifest): # Check two paths, one for Program Files, and one for Program Files (x86). # Yay 64bit windows. nsis_path = "makensis.exe" - for program_files in '${programfiles}', '${programfiles(x86)}': - for nesis_path in 'NSIS', 'NSIS\\Unicode': - possible_path = os.path.expandvars(f"{program_files}\\{nesis_path}\\makensis.exe") - if os.path.exists(possible_path): - nsis_path = possible_path - break - - self.run_command([possible_path, '/V2', self.dst_path_of(tempfile)]) + try: + for program_files in os.getenv('programfiles'), os.getenv('programfiles(x86)'): + if program_files: + for subpath in 'NSIS', r'NSIS\Unicode': + possible_path = os.path.join(program_files, subpath, nsis_path) + if os.path.isfile(possible_path): + nsis_path = possible_path + # don't just break: we need to exit multiple + # levels of 'for' loop + raise StopIteration() + except StopIteration: + pass + + self.run_command([nsis_path, '/V2', self.dst_path_of(tempfile)]) self.sign(installer_file) self.created_path(self.dst_path_of(installer_file)) -- cgit v1.2.3 From b1c93e6a50cb98de154bf6cabd0d7734248c1423 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 13:17:38 -0400 Subject: SL-19242: Add NSIS language files etc. to Windows-app artifact. --- indra/newview/viewer_manifest.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3f07eefbec..527aa25d05 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -805,12 +805,22 @@ class WindowsManifest(ViewerManifest): engage_registry="SetRegView 32" program_files="" + # Dump the installers/windows directory into the raw app image tree + # because NSIS needs those files. But don't use path() because we + # don't want them installed with the viewer - they're only for use by + # the installer itself. + shutil.copytree(os.path.join(self.get_src_prefix(), 'installers', 'windows'), + os.path.join(self.get_dst_prefix(), 'installers', 'windows')) + tempfile = "secondlife_setup_tmp.nsi" # the following replaces strings in the nsi template # it also does python-style % substitution self.replace_in("installers/windows/installer_template.nsi", tempfile, { "%%VERSION%%":version_vars, - "%%SOURCE%%":self.get_src_prefix(), + # The template references "%%SOURCE%%\installers\windows\...". + # Now that we've copied that directory into the app image + # tree, we can just replace %%SOURCE%% with '.'. + "%%SOURCE%%":'.', "%%INST_VARS%%":inst_vars_template % substitution_strings, "%%INSTALL_FILES%%":self.nsi_file_commands(True), "%%PROGRAMFILES%%":program_files, -- cgit v1.2.3 From baa0faa7d126e07b05d3f57d56a5440beb1c20b7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 15:10:22 -0400 Subject: SL-19242: Don't die if Windows app image installers/windows exists. --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 527aa25d05..40e6a8fa7c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -810,7 +810,8 @@ class WindowsManifest(ViewerManifest): # don't want them installed with the viewer - they're only for use by # the installer itself. shutil.copytree(os.path.join(self.get_src_prefix(), 'installers', 'windows'), - os.path.join(self.get_dst_prefix(), 'installers', 'windows')) + os.path.join(self.get_dst_prefix(), 'installers', 'windows'), + dirs_exist_ok=True) tempfile = "secondlife_setup_tmp.nsi" # the following replaces strings in the nsi template -- cgit v1.2.3 From 62898143bff7627eeea860cd6fdf7ae865d85a60 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 17:59:09 -0400 Subject: SL-19242: Write relative pathnames into NSIS input file. --- indra/newview/viewer_manifest.py | 53 ++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 40e6a8fa7c..fb22d29183 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -28,6 +28,7 @@ $/LicenseInfo$ """ import errno import glob +import itertools import json import os import os.path @@ -718,46 +719,38 @@ class WindowsManifest(ViewerManifest): self.package_file = "copied_deps" def nsi_file_commands(self, install=True): - def wpath(path): - if path.endswith('/') or path.endswith(os.path.sep): - path = path[:-1] - path = path.replace('/', '\\') - return path - - result = "" + result = [] dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])] # sort deepest hierarchy first dest_files.sort(key=lambda f: (f.count(os.path.sep), f), reverse=True) out_path = None for pkg_file in dest_files: - rel_file = os.path.normpath(pkg_file.replace(self.get_dst_prefix()+os.path.sep,'')) - installed_dir = wpath(os.path.join('$INSTDIR', os.path.dirname(rel_file))) - pkg_file = wpath(os.path.normpath(pkg_file)) - if installed_dir != out_path: - if install: - out_path = installed_dir - result += 'SetOutPath ' + out_path + '\n' + pkg_file = os.path.normpath(pkg_file) + rel_file = self.relpath(pkg_file) + installed_dir = os.path.join('$INSTDIR', os.path.dirname(rel_file)) + if install and installed_dir != out_path: + out_path = installed_dir + # emit SetOutPath every time it changes + result.append('SetOutPath ' + out_path) if install: - result += 'File ' + pkg_file + '\n' + result.append('File ' + rel_file) else: - result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n' + # Note that '$INSTDIR' is purely textual here: we write + # exactly that into the .nsi file for NSIS to interpret. + result.append('Delete ' + os.path.join('$INSTDIR', rel_file)) # at the end of a delete, just rmdir all the directories if not install: - deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list] - # find all ancestors so that we don't skip any dirs that happened to have no non-dir children - deleted_dirs = [] - for d in deleted_file_dirs: - deleted_dirs.extend(path_ancestors(d)) + deleted_file_dirs = [os.path.dirname(self.relpath(f)) for f in dest_files] + # find all ancestors so that we don't skip any dirs that happened + # to have no non-dir children + deleted_dirs = set(itertools.chain.from_iterable(path_ancestors(d) + for d in deleted_file_dirs)) # sort deepest hierarchy first - deleted_dirs.sort(key=lambda f: (f.count(os.path.sep), f), reverse=True) - prev = None - for d in deleted_dirs: - if d != prev: # skip duplicates - result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n' - prev = d + for d in sorted(deleted_dirs, key=lambda f: (f.count(os.path.sep), f), reverse=True): + result.append('RMDir ' + os.path.join('$INSTDIR', os.path.normpath(d))) - return result + return '\n'.join(result) def package_finish(self): # a standard map of strings for replacing in the templates @@ -854,7 +847,9 @@ class WindowsManifest(ViewerManifest): except StopIteration: pass - self.run_command([nsis_path, '/V2', self.dst_path_of(tempfile)]) + # Because we've written relative pathnames into tempfile, run nsis + # with their base directory as current. + self.run_command([nsis_path, '/V2', tempfile], cwd=self.get_dst_prefix()) self.sign(installer_file) self.created_path(self.dst_path_of(installer_file)) -- cgit v1.2.3 From 2670cde77b3f75a34f537fb935464c73e9e2814a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 20:12:43 -0400 Subject: SL-19242: On NSIS error, dump the generated .nsi file. --- indra/newview/viewer_manifest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index fb22d29183..62e64b1d44 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -849,7 +849,15 @@ class WindowsManifest(ViewerManifest): # Because we've written relative pathnames into tempfile, run nsis # with their base directory as current. - self.run_command([nsis_path, '/V2', tempfile], cwd=self.get_dst_prefix()) + try: + self.run_command([nsis_path, '/V2', tempfile], cwd=self.get_dst_prefix()) + except ManifestError as err: + print(f' {tempfile} '.center(72, '=')) + with open(self.dst_path_of(tempfile)) as nsi: + for line in nsi: + print(line) + print(72 * '=') + raise self.sign(installer_file) self.created_path(self.dst_path_of(installer_file)) -- cgit v1.2.3 From 2a031fa11cb5a5abca41d9eef5fdfb0b7bb54301 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 21:17:34 -0400 Subject: SL-19242: Ensure NSIS file paths don't end with backslash. If they do, NSIS takes it as line continuation. --- indra/newview/viewer_manifest.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 62e64b1d44..76683a1b92 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -719,6 +719,16 @@ class WindowsManifest(ViewerManifest): self.package_file = "copied_deps" def nsi_file_commands(self, install=True): + def INSTDIR(path): + # Note that '$INSTDIR' is purely textual here: we write + # exactly that into the .nsi file for NSIS to interpret. + # Pass the result through normpath() to handle the case in which + # path is the empty string. On Windows, that produces "$INSTDIR\". + # Unfortunately, if that's the last item on a line, NSIS takes + # that as line continuation and misinterprets the following line. + # Ensure we don't emit a trailing backslash. + return os.path.normpath(os.path.join('$INSTDIR', path)) + result = [] dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])] # sort deepest hierarchy first @@ -727,7 +737,7 @@ class WindowsManifest(ViewerManifest): for pkg_file in dest_files: pkg_file = os.path.normpath(pkg_file) rel_file = self.relpath(pkg_file) - installed_dir = os.path.join('$INSTDIR', os.path.dirname(rel_file)) + installed_dir = INSTDIR(os.path.dirname(rel_file)) if install and installed_dir != out_path: out_path = installed_dir # emit SetOutPath every time it changes @@ -735,9 +745,7 @@ class WindowsManifest(ViewerManifest): if install: result.append('File ' + rel_file) else: - # Note that '$INSTDIR' is purely textual here: we write - # exactly that into the .nsi file for NSIS to interpret. - result.append('Delete ' + os.path.join('$INSTDIR', rel_file)) + result.append('Delete ' + INSTDIR(rel_file)) # at the end of a delete, just rmdir all the directories if not install: @@ -748,7 +756,7 @@ class WindowsManifest(ViewerManifest): for d in deleted_file_dirs)) # sort deepest hierarchy first for d in sorted(deleted_dirs, key=lambda f: (f.count(os.path.sep), f), reverse=True): - result.append('RMDir ' + os.path.join('$INSTDIR', os.path.normpath(d))) + result.append('RMDir ' + INSTDIR(d)) return '\n'.join(result) @@ -855,7 +863,7 @@ class WindowsManifest(ViewerManifest): print(f' {tempfile} '.center(72, '=')) with open(self.dst_path_of(tempfile)) as nsi: for line in nsi: - print(line) + print(line, end='') # already includes '\n' print(72 * '=') raise -- cgit v1.2.3 From ebe8e01ad13cf820fc89f2129928d2279e9d0f8a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Sep 2023 21:54:43 -0400 Subject: SL-19242: Capture the BugSplat @rpath as str, not bytes. --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 76683a1b92..0c54981af3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -996,7 +996,8 @@ class DarwinManifest(ViewerManifest): # work, we need the build to noisily fail! oldpath = subprocess.check_output( ['objdump', '--macho', '--dylib-id', '--non-verbose', - os.path.join(relpkgdir, "BugsplatMac.framework", "BugsplatMac")] + os.path.join(relpkgdir, "BugsplatMac.framework", "BugsplatMac")], + text=True ).splitlines()[-1] # take the last line of output self.run_command( ['install_name_tool', '-change', oldpath, -- cgit v1.2.3 From e8dfbbaf880314359c0c2d18c944199e3f26db07 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 20 Sep 2023 11:34:56 -0400 Subject: SL-19242: Pass channel and imagename to sign-pkg-mac/action.yaml. The viewer_manifest.py logic to determine the name of the viewer installer .dmg is a little convoluted. Make it tell viewer-build-util/sign-pkg-mac that name, rather than passing it all the relevant inputs and composing it redundantly. sign-pkg-mac also wants the viewer channel to determine the application name. --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 0c54981af3..10f38fa7d8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1273,6 +1273,7 @@ class DarwinManifest(ViewerManifest): volname=CHANNEL_VENDOR_BASE+" Installer" # DO NOT CHANGE without understanding comment above imagename = self.installer_base_name() + self.set_github_output('imagename', imagename) sparsename = imagename + ".sparseimage" finalname = imagename + ".dmg" @@ -1292,7 +1293,7 @@ class DarwinManifest(ViewerManifest): try: devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip() - volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip() + volpath = re.search(r'HFS\s+(.+)', hdi_output).group(1).strip() # Copy everything in to the mounted .dmg -- cgit v1.2.3 From ff71d3c742630751e3c7b3eeeeea334f714afd55 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 26 Sep 2023 10:22:40 -0400 Subject: SL-19242: Package Mac app image as tarball for artifact uploading. actions/upload-artifact doesn't preserve symlinks, which are important for our Mac viewer and its embedded frameworks. But tar does, so pack up the whole bundle as a tarball before posting as a GitHub artifact. --- indra/newview/viewer_manifest.py | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 10f38fa7d8..b7dc705e95 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -39,6 +39,7 @@ import secrets import shutil import subprocess import sys +import tarfile import tempfile import time @@ -918,32 +919,22 @@ class DarwinManifest(ViewerManifest): RUNNER_TEMP = os.getenv('RUNNER_TEMP') # When running as a GitHub Action job, RUNNER_TEMP is the recommended # temp directory. If we're not running on GitHub, don't create this - # temp directory or this symlink: we don't clean them up, trusting + # temp directory or this tarball: we don't clean them up, trusting # that the runner is itself transient. On a dev machine, that would # result in temp-directory clutter. if RUNNER_TEMP: - # We want an artifact containing the "Second Life Mumble.app" - # directory, which in turn contains the whole app bundle. - # Unfortunately, the directory that contains the .app directory - # also contains other stuff, notably the xcarchive.zip, which is - # itself enormous. Create a temp directory containing only (a link - # to) our .app dir, and specify that as the directory to upload. - wrapdir = tempfile.mkdtemp(dir=RUNNER_TEMP) - applink = os.path.join(wrapdir, appname) - # This link will be used by a different job step, so link to an - # absolute path: we can't guarantee that the other step will have - # the same current directory. - # diagnostic output - parentdir = os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir)) - for dir in parentdir, os.path.join(parentdir, appname): - print(f'Contents of {dir}:') - for item in os.listdir(dir): - print(f' {item}') - # end diagnostic output - appreal = os.path.abspath(os.path.join(self.get_dst_prefix(), os.pardir, appname)) - print(f"Linking {applink} => {appreal}") - os.symlink(appreal, applink) - self.set_github_output_path('viewer_app', wrapdir) + # Per GitHub's actions/upload-artifact documentation + # https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files + # we must package the app bundle with tar before posting as an + # artifact. Posting individual files follows symlinks, which + # causes problems, especially with frameworks: a framework's top + # level must contain symlinks into its Versions/Current, which + # must itself be a symlink to some specific Versions subdir. + tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") + print(f'Creating {tarpath} from {self.get_dst_prefix()}') + with tarfile.open(tarpath, mode="x:bz2") as tarball: + tarball.add(self.get_dst_prefix()) + self.set_github_output_path('viewer_app', tarpath) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From 5f69db9d1907eac79ad7fa9e639733de42eec36f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 26 Sep 2023 11:47:18 -0400 Subject: SL-19242: Allow overwriting the Mac viewer's app bundle tarball. --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index b7dc705e95..899456dd09 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -932,7 +932,7 @@ class DarwinManifest(ViewerManifest): # must itself be a symlink to some specific Versions subdir. tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") print(f'Creating {tarpath} from {self.get_dst_prefix()}') - with tarfile.open(tarpath, mode="x:bz2") as tarball: + with tarfile.open(tarpath, mode="w:bz2") as tarball: tarball.add(self.get_dst_prefix()) self.set_github_output_path('viewer_app', tarpath) -- cgit v1.2.3 From ae6027572816c0f67d68b8759a00cc8848e21fec Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 26 Sep 2023 13:58:19 -0400 Subject: SL-19242: Store Mac app bundle in tarball with top-level .app name. We were creating the tarball with the app bundle stored as the whole 'Users/someone/.../newview/Release/Second Life Mumble.app' path. Don't. --- indra/newview/viewer_manifest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 899456dd09..5039f3db83 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -933,7 +933,10 @@ class DarwinManifest(ViewerManifest): tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") print(f'Creating {tarpath} from {self.get_dst_prefix()}') with tarfile.open(tarpath, mode="w:bz2") as tarball: - tarball.add(self.get_dst_prefix()) + # store in the tarball as just 'Second Life Mumble.app' + # instead of 'Users/someone/.../newview/Release/Second...' + tarball.add(self.get_dst_prefix(), + arcname=os.path.basename(self.get_dst_prefix())) self.set_github_output_path('viewer_app', tarpath) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') -- cgit v1.2.3 From 1684d6249984e0ad8e13263da05f84cb5e6b84fb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 3 Oct 2023 19:02:40 -0400 Subject: SL-19242: Remove signing and packaging from viewer_manifest.py for Mac and Windows. That's now done by subsequent jobs in the GitHub build. Remove workflow step to upload installers before signing and packaging jobs. Remove from viewer_manifest.py conditionals for 32-bit Windows or Mac. Also bump to actions/checkout@v4, per dependabot. --- indra/newview/viewer_manifest.py | 323 ++------------------------------------- 1 file changed, 16 insertions(+), 307 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 5039f3db83..7db0b75319 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -428,10 +428,11 @@ class ViewerManifest(LLManifest): print(delim, file=outf) -class WindowsManifest(ViewerManifest): +class Windows_x86_64_Manifest(ViewerManifest): # We want the platform, per se, for every Windows build to be 'win'. The # VMP will concatenate that with the address_size. build_data_json_platform = 'win' + address_size = 64 def final_exe(self): return self.exec_name()+".exe" @@ -492,7 +493,7 @@ class WindowsManifest(ViewerManifest): print("Doesn't exist:", src) def construct(self): - super(WindowsManifest, self).construct() + super().construct() pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -575,20 +576,12 @@ class WindowsManifest(ViewerManifest): self.path("SLVoice.exe") # Vivox libraries - if (self.address_size == 64): - self.path("vivoxsdk_x64.dll") - self.path("ortp_x64.dll") - else: - self.path("vivoxsdk.dll") - self.path("ortp.dll") + self.path("vivoxsdk_x64.dll") + self.path("ortp_x64.dll") # OpenSSL - if (self.address_size == 64): - self.path("libcrypto-1_1-x64.dll") - self.path("libssl-1_1-x64.dll") - else: - self.path("libcrypto-1_1.dll") - self.path("libssl-1_1.dll") + self.path("libcrypto-1_1-x64.dll") + self.path("libssl-1_1-x64.dll") # HTTP/2 self.path("nghttp2.dll") @@ -598,14 +591,9 @@ class WindowsManifest(ViewerManifest): # BugSplat if self.args.get('bugsplat'): - if(self.address_size == 64): - self.path("BsSndRpt64.exe") - self.path("BugSplat64.dll") - self.path("BugSplatRc64.dll") - else: - self.path("BsSndRpt.exe") - self.path("BugSplat.dll") - self.path("BugSplatRc.dll") + self.path("BsSndRpt64.exe") + self.path("BugSplat64.dll") + self.path("BugSplatRc64.dll") self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") @@ -767,8 +755,7 @@ class WindowsManifest(ViewerManifest): 'version' : '.'.join(self.args['version']), 'version_short' : '.'.join(self.args['version'][:-1]), 'version_dashes' : '-'.join(self.args['version']), - 'version_registry' : '%s(%s)' % - ('.'.join(self.args['version']), self.address_size), + 'version_registry' : '%s(64)' % '.'.join(self.args['version']), 'final_exe' : self.final_exe(), 'flags':'', 'app_name':self.app_name(), @@ -800,12 +787,8 @@ class WindowsManifest(ViewerManifest): Caption "%(caption)s" """ - if(self.address_size == 64): - engage_registry="SetRegView 64" - program_files="!define MULTIUSER_USE_PROGRAMFILES64" - else: - engage_registry="SetRegView 32" - program_files="" + engage_registry="SetRegView 64" + program_files="!define MULTIUSER_USE_PROGRAMFILES64" # Dump the installers/windows directory into the raw app image tree # because NSIS needs those files. But don't use path() because we @@ -830,72 +813,10 @@ class WindowsManifest(ViewerManifest): "%%ENGAGEREGISTRY%%":engage_registry, "%%DELETE_FILES%%":self.nsi_file_commands(False)}) - # If we're on a build machine, sign the code using our Authenticode certificate. JC - # note that the enclosing setup exe is signed later, after the makensis makes it. - # Unlike the viewer binary, the VMP filenames are invariant with respect to version, os, etc. - for exe in ( - self.final_exe(), - "SLVersionChecker.exe", - "llplugin/dullahan_host.exe", - ): - self.sign(exe) - - # Check two paths, one for Program Files, and one for Program Files (x86). - # Yay 64bit windows. - nsis_path = "makensis.exe" - try: - for program_files in os.getenv('programfiles'), os.getenv('programfiles(x86)'): - if program_files: - for subpath in 'NSIS', r'NSIS\Unicode': - possible_path = os.path.join(program_files, subpath, nsis_path) - if os.path.isfile(possible_path): - nsis_path = possible_path - # don't just break: we need to exit multiple - # levels of 'for' loop - raise StopIteration() - except StopIteration: - pass - - # Because we've written relative pathnames into tempfile, run nsis - # with their base directory as current. - try: - self.run_command([nsis_path, '/V2', tempfile], cwd=self.get_dst_prefix()) - except ManifestError as err: - print(f' {tempfile} '.center(72, '=')) - with open(self.dst_path_of(tempfile)) as nsi: - for line in nsi: - print(line, end='') # already includes '\n' - print(72 * '=') - raise - - self.sign(installer_file) - self.created_path(self.dst_path_of(installer_file)) - self.package_file = installer_file - - def sign(self, exe): - sign_py = os.environ.get('SIGN', r'C:\buildscripts\code-signing\sign.py') - python = os.environ.get('PYTHON', sys.executable) - if os.path.exists(sign_py): - dst_path = self.dst_path_of(exe) - print("about to run signing of: ", dst_path) - self.run_command([python, sign_py, dst_path]) - else: - print("Skipping code signing of %s %s: %s not found" % (self.dst_path_of(exe), exe, sign_py)) - - def escape_slashes(self, path): - return path.replace('\\', '\\\\\\\\') -class Windows_i686_Manifest(WindowsManifest): - # Although we aren't literally passed ADDRESS_SIZE, we can infer it from - # the passed 'arch', which is used to select the specific subclass. - address_size = 32 - -class Windows_x86_64_Manifest(WindowsManifest): - address_size = 64 - - -class DarwinManifest(ViewerManifest): +class Darwin_x86_64_Manifest(ViewerManifest): build_data_json_platform = 'mac' + address_size = 64 def finish_build_data_dict(self, build_data_dict): build_data_dict.update({'Bundle Id':self.args['bundleid']}) @@ -1012,7 +933,7 @@ class DarwinManifest(ViewerManifest): with self.prefix(dst="Resources"): # defer cross-platform file copies until we're in the # nested Resources directory - super(DarwinManifest, self).construct() + super().construct() # need .icns file referenced by Info.plist with self.prefix(src=self.icon_path(), dst="") : @@ -1260,221 +1181,9 @@ class DarwinManifest(ViewerManifest): self.path( "plugins.dat" ) def package_finish(self): - global CHANNEL_VENDOR_BASE - # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. - # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick. - - volname=CHANNEL_VENDOR_BASE+" Installer" # DO NOT CHANGE without understanding comment above - imagename = self.installer_base_name() self.set_github_output('imagename', imagename) - sparsename = imagename + ".sparseimage" - finalname = imagename + ".dmg" - # make sure we don't have stale files laying about - self.remove(sparsename, finalname) - - self.run_command(['hdiutil', 'create', sparsename, - '-volname', volname, '-fs', 'HFS+', - '-type', 'SPARSE', '-megabytes', '1300', - '-layout', 'SPUD']) - - # mount the image and get the name of the mount point and device node - try: - hdi_output = subprocess.check_output(['hdiutil', 'attach', '-private', sparsename], text=True) - except subprocess.CalledProcessError as err: - sys.exit("failed to mount image at '%s'" % sparsename) - - try: - devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip() - volpath = re.search(r'HFS\s+(.+)', hdi_output).group(1).strip() - - # Copy everything in to the mounted .dmg - - app_name = self.app_name() - - # Hack: - # Because there is no easy way to coerce the Finder into positioning - # the app bundle in the same place with different app names, we are - # adding multiple .DS_Store files to svn. There is one for release, - # one for release candidate and one for first look. Any other channels - # will use the release .DS_Store, and will look broken. - # - Ambroff 2008-08-20 - dmg_template = os.path.join( - 'installers', 'darwin', '%s-dmg' % self.channel_type()) - - if not os.path.exists (self.src_path_of(dmg_template)): - dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') - - for s,d in list({self.get_dst_prefix():app_name + ".app", - os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns", - os.path.join(dmg_template, "background.jpg"): "background.jpg", - os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items()): - print("Copying to dmg", s, d) - self.copy_action(self.src_path_of(s), os.path.join(volpath, d)) - - # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit) - for f in ".VolumeIcon.icns", "background.jpg", ".DS_Store": - pathname = os.path.join(volpath, f) - self.run_command(['SetFile', '-a', 'V', pathname]) - - # Create the alias file (which is a resource file) from the .r - self.run_command( - ['Rez', self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"), - '-o', os.path.join(volpath, "Applications")]) - - # Set the alias file's alias and custom icon bits - self.run_command(['SetFile', '-a', 'AC', os.path.join(volpath, "Applications")]) - - # Set the disk image root's custom icon bit - self.run_command(['SetFile', '-a', 'C', volpath]) - - # Sign the app if requested; - # do this in the copy that's in the .dmg so that the extended attributes used by - # the signature are preserved; moving the files using python will leave them behind - # and invalidate the signatures. - if 'signature' in self.args: - app_in_dmg=os.path.join(volpath,self.app_name()+".app") - print("Attempting to sign '%s'" % app_in_dmg) - identity = self.args['signature'] - if identity == '': - identity = 'Developer ID Application' - - # Look for an environment variable set via build.sh when running in Team City. - try: - build_secrets_checkout = os.environ['build_secrets_checkout'] - except KeyError: - pass - else: - # variable found so use it to unlock keychain followed by codesign - home_path = os.environ['HOME'] - keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt') - keychain_pwd = open(keychain_pwd_path).read().rstrip() - - # Note: As of macOS Sierra, keychains are created with - # names postfixed with '-db' so for example, the SL - # Viewer keychain would by default be found in - # ~/Library/Keychains/viewer.keychain-db instead of - # just ~/Library/Keychains/viewer.keychain in - # earlier versions. - # - # Because we have old OS files from previous - # versions of macOS on the build hosts, the - # configurations are different on each host. Some - # have viewer.keychain, some have viewer.keychain-db - # and some have both. As you can see in the line - # below, this script expects the Linden Developer - # cert/keys to be in viewer.keychain. - # - # To correctly sign builds you need to make sure - # ~/Library/Keychains/viewer.keychain exists on the - # host and that it contains the correct cert/key. If - # a build host is set up with a clean version of - # macOS Sierra (or later) then you will need to - # change this line (and the one for 'codesign' - # command below) to point to right place or else - # pull in the cert/key into the default viewer - # keychain 'viewer.keychain-db' and export it to - # 'viewer.keychain' - viewer_keychain = os.path.join(home_path, 'Library', - 'Keychains', 'viewer.keychain') - self.run_command(['security', 'unlock-keychain', - '-p', keychain_pwd, viewer_keychain]) - sign_retries=3 - sign_retry_wait=15 - resources = app_in_dmg + "/Contents/Resources/" - plain_sign = glob.glob(resources + "llplugin/*.dylib") - deep_sign = [ - resources + "updater/SLVersionChecker", - resources + "SLPlugin.app/Contents/MacOS/SLPlugin", - app_in_dmg, - ] - for attempt in range(sign_retries): - if attempt: # second or subsequent iteration - print(f"codesign attempt {attempt+1} failed, " - f"waiting {sign_retry_wait:d} seconds before retrying", - file=sys.stderr) - time.sleep(sign_retry_wait) - sign_retry_wait*=2 - - try: - # Note: See blurb above about names of keychains - for signee in plain_sign: - self.run_command( - ['codesign', - '--force', - '--timestamp', - '--keychain', viewer_keychain, - '--sign', identity, - signee]) - for signee in deep_sign: - self.run_command( - ['codesign', - '--verbose', - '--deep', - '--force', - '--entitlements', self.src_path_of("slplugin.entitlements"), - '--options', 'runtime', - '--keychain', viewer_keychain, - '--sign', identity, - signee]) - break # if no exception was raised, the codesign worked - except ManifestError as err: - # 'err' goes out of scope - sign_failed = err - else: - print(f"{sign_retries} codesign attempts failed; giving up", - file=sys.stderr) - raise sign_failed - self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) - self.run_command([self.src_path_of("installers/darwin/apple-notarize.sh"), - app_in_dmg]) - - finally: - # Unmount the image even if exceptions from any of the above - detach_retries = 3 - detach_retry_wait = 2 - # Empirically, on GitHub we've hit errors like: - # hdiutil: couldn't eject "disk10" - Resource busy - for attempt in range(detach_retries): - if attempt: # second or subsequent iteration - print(f'detach failed, waiting {detach_retry_wait} seconds before retrying', - file=sys.stderr) - # Try waiting a bit to see if that improves reliability. - time.sleep(detach_retry_wait) - detach_retry_wait *= 2 - - try: - self.run_command(['hdiutil', 'detach', '-force', devfile]) - # if no exception, the detach worked - break - except ManifestError as err: - detach_failed = err - else: - print(f'{detach_retries} detach attempts failed', file=sys.stderr) - ## can we carry on anyway?? - ## raise detach_failed - - print("Converting temp disk image to final disk image") - self.run_command(['hdiutil', 'convert', sparsename, '-format', 'UDZO', - '-imagekey', 'zlib-level=9', '-o', finalname]) - # get rid of the temp file - self.package_file = finalname - self.remove(sparsename) - - -class Darwin_i386_Manifest(DarwinManifest): - address_size = 32 - - -class Darwin_i686_Manifest(DarwinManifest): - """alias in case arch is passed as i686 instead of i386""" - pass - - -class Darwin_x86_64_Manifest(DarwinManifest): - address_size = 64 - class LinuxManifest(ViewerManifest): build_data_json_platform = 'lnx' -- cgit v1.2.3 From 617801401ff84e0142fa3fe5f6614671094e2cef Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 4 Oct 2023 08:55:15 -0400 Subject: SL-18837: Restore setting ViewerManifest.package_file. This is referenced after running the packaging. --- indra/newview/viewer_manifest.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 7db0b75319..33b2e4affc 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -813,6 +813,8 @@ class Windows_x86_64_Manifest(ViewerManifest): "%%ENGAGEREGISTRY%%":engage_registry, "%%DELETE_FILES%%":self.nsi_file_commands(False)}) + self.package_file = installer_file + class Darwin_x86_64_Manifest(ViewerManifest): build_data_json_platform = 'mac' @@ -1183,6 +1185,8 @@ class Darwin_x86_64_Manifest(ViewerManifest): def package_finish(self): imagename = self.installer_base_name() self.set_github_output('imagename', imagename) + finalname = imagename + ".dmg" + self.package_file = finalname class LinuxManifest(ViewerManifest): -- cgit v1.2.3 From 59cd3f48b00b408e354cd39c0f6e966912ba628f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 4 Oct 2023 14:19:44 -0400 Subject: SL-18837: Fix set-but-unreferenced in LLInventoryGallery::startDrag() --- indra/newview/llinventorygallery.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 4838ba7a47..845ea01f56 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2420,6 +2420,8 @@ void LLInventoryGallery::startDrag() ids.push_back(selected_id); } } + // We must have set this for some reason, but it's causing compile errors + (void)src; LLToolDragAndDrop::getInstance()->beginMultiDrag(types, ids, LLToolDragAndDrop::SOURCE_AGENT); } -- cgit v1.2.3 From 016023c780aeb02b281ed52128f286b08d3c9eaf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 16 Oct 2023 19:04:23 -0400 Subject: SL-18837: Create Second Life Viewer.app, not Second Life Release.app --- indra/newview/viewer_manifest.py | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 33b2e4affc..4bcc26e1d5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -837,30 +837,7 @@ class Darwin_x86_64_Manifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode # script) - appname = self.channel() + ".app" - self.path(os.path.join(self.args['configuration'], appname), dst="") - RUNNER_TEMP = os.getenv('RUNNER_TEMP') - # When running as a GitHub Action job, RUNNER_TEMP is the recommended - # temp directory. If we're not running on GitHub, don't create this - # temp directory or this tarball: we don't clean them up, trusting - # that the runner is itself transient. On a dev machine, that would - # result in temp-directory clutter. - if RUNNER_TEMP: - # Per GitHub's actions/upload-artifact documentation - # https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files - # we must package the app bundle with tar before posting as an - # artifact. Posting individual files follows symlinks, which - # causes problems, especially with frameworks: a framework's top - # level must contain symlinks into its Versions/Current, which - # must itself be a symlink to some specific Versions subdir. - tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") - print(f'Creating {tarpath} from {self.get_dst_prefix()}') - with tarfile.open(tarpath, mode="w:bz2") as tarball: - # store in the tarball as just 'Second Life Mumble.app' - # instead of 'Users/someone/.../newview/Release/Second...' - tarball.add(self.get_dst_prefix(), - arcname=os.path.basename(self.get_dst_prefix())) - self.set_github_output_path('viewer_app', tarpath) + self.path(os.path.join(self.args['configuration'], self.app_name() + ".app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -1188,6 +1165,29 @@ class Darwin_x86_64_Manifest(ViewerManifest): finalname = imagename + ".dmg" self.package_file = finalname + RUNNER_TEMP = os.getenv('RUNNER_TEMP') + # When running as a GitHub Action job, RUNNER_TEMP is the recommended + # temp directory. If we're not running on GitHub, don't create this + # temp directory or this tarball: we don't clean them up, trusting + # that the runner is itself transient. On a dev machine, that would + # result in temp-directory clutter. + if RUNNER_TEMP: + # Per GitHub's actions/upload-artifact documentation + # https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files + # we must package the app bundle with tar before posting as an + # artifact. Posting individual files follows symlinks, which + # causes problems, especially with frameworks: a framework's top + # level must contain symlinks into its Versions/Current, which + # must itself be a symlink to some specific Versions subdir. + tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") + print(f'Creating {tarpath} from {self.get_dst_prefix()}') + with tarfile.open(tarpath, mode="w:bz2") as tarball: + # store in the tarball as just 'Second Life Mumble.app' + # instead of 'Users/someone/.../newview/Release/Second...' + tarball.add(self.get_dst_prefix(), + arcname=os.path.basename(self.get_dst_prefix())) + self.set_github_output_path('viewer_app', tarpath) + class LinuxManifest(ViewerManifest): build_data_json_platform = 'lnx' -- cgit v1.2.3 From 19f453fc2007f780ae5d819090db206f07d0a9c6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 16 Oct 2023 19:46:37 -0400 Subject: SL-18837: Second Life Release.app=>Second Life Viewer.app in tarball --- indra/newview/viewer_manifest.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4bcc26e1d5..1fa4df1682 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -837,7 +837,7 @@ class Darwin_x86_64_Manifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode # script) - self.path(os.path.join(self.args['configuration'], self.app_name() + ".app"), dst="") + self.path(os.path.join(self.args['configuration'], self.channel() + ".app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -1182,10 +1182,12 @@ class Darwin_x86_64_Manifest(ViewerManifest): tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") print(f'Creating {tarpath} from {self.get_dst_prefix()}') with tarfile.open(tarpath, mode="w:bz2") as tarball: - # store in the tarball as just 'Second Life Mumble.app' + # Store in the tarball as just 'Second Life Mumble.app' # instead of 'Users/someone/.../newview/Release/Second...' + # It's at this point that we rename 'Second Life Release.app' + # to 'Second Life Viewer.app'. tarball.add(self.get_dst_prefix(), - arcname=os.path.basename(self.get_dst_prefix())) + arcname=self.app_name() + ".app") self.set_github_output_path('viewer_app', tarpath) -- cgit v1.2.3 From 117f07e5a4b7882a44681c730dcc0628238cfec6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 17 Oct 2023 06:33:05 -0400 Subject: SL-18837: Avoid stuffing build number into 32-bit int. Even though LLVersionInfo::getBuild() already returns a 64-bit int, various consumers assumed it could fit into 32 bits. It was especially bad to pass it to a classic C style varargs function. Only on a little-endian CPU, and only because it was the last argument, the damage was limited to truncation -- instead of arbitrary undefined behavior. Where the consumer doesn't support 64-bit ints, pass as string instead. --- indra/newview/llappviewer.cpp | 4 +++- indra/newview/llcurrencyuimanager.cpp | 13 +++++++++---- indra/newview/llpanellogin.cpp | 13 ++++++------- indra/newview/lltranslate.cpp | 25 +++++++++++++------------ indra/newview/llversioninfo.cpp | 4 ++-- indra/newview/llversioninfo.h | 2 +- indra/newview/llxmlrpctransaction.cpp | 15 ++++++++------- 7 files changed, 42 insertions(+), 34 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dec849afa1..5763ebe721 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3209,8 +3209,10 @@ LLSD LLAppViewer::getViewerInfo() const // LLFloaterAbout. LLSD info; auto& versionInfo(LLVersionInfo::instance()); + // With GitHub builds, the build number is too big to fit in a 32-bit int, + // and LLSD doesn't deal with integers wider than int. Use string. info["VIEWER_VERSION"] = llsd::array(versionInfo.getMajor(), versionInfo.getMinor(), - versionInfo.getPatch(), versionInfo.getBuild()); + versionInfo.getPatch(), stringize(versionInfo.getBuild())); info["VIEWER_VERSION_STR"] = versionInfo.getVersion(); info["CHANNEL"] = versionInfo.getChannel(); info["ADDRESS_SIZE"] = ADDRESS_SIZE; diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 232e461fd0..4c0a5cf183 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -45,6 +45,7 @@ #include "llxmlrpctransaction.h" #include "llviewernetwork.h" #include "llpanel.h" +#include "stringize.h" const F64 CURRENCY_ESTIMATE_FREQUENCY = 2.0; @@ -158,7 +159,7 @@ void LLCurrencyUIManager::Impl::updateCurrencyInfo() mLocalCurrencyEstimated = true; return; } - + LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); keywordArgs.appendString("agentId", gAgent.getID().asString()); keywordArgs.appendString( @@ -170,8 +171,10 @@ void LLCurrencyUIManager::Impl::updateCurrencyInfo() keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::instance().getMajor()); keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::instance().getMinor()); keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::instance().getPatch()); - keywordArgs.appendInt("viewerBuildVersion", LLVersionInfo::instance().getBuild()); - + // With GitHub builds, the build number is too big to fit in a 32-bit int, + // and XMLRPC_VALUE doesn't deal with integers wider than int. Use string. + keywordArgs.appendString("viewerBuildVersion", stringize(LLVersionInfo::instance().getBuild())); + LLXMLRPCValue params = LLXMLRPCValue::createArray(); params.append(keywordArgs); @@ -245,7 +248,9 @@ void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password) keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::instance().getMajor()); keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::instance().getMinor()); keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::instance().getPatch()); - keywordArgs.appendInt("viewerBuildVersion", LLVersionInfo::instance().getBuild()); + // With GitHub builds, the build number is too big to fit in a 32-bit int, + // and XMLRPC_VALUE doesn't deal with integers wider than int. Use string. + keywordArgs.appendString("viewerBuildVersion", stringize(LLVersionInfo::instance().getBuild())); LLXMLRPCValue params = LLXMLRPCValue::createArray(); params.append(keywordArgs); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ea936ab024..025a653c47 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -65,6 +65,7 @@ #include "lltrans.h" #include "llglheaders.h" #include "llpanelloginlistener.h" +#include "stringize.h" #if LL_WINDOWS #pragma warning(disable: 4355) // 'this' used in initializer list @@ -300,10 +301,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, setDefaultBtn(def_btn); std::string channel = LLVersionInfo::instance().getChannel(); - std::string version = llformat("%s (%ld)", - LLVersionInfo::instance().getShortVersion().c_str(), - LLVersionInfo::instance().getBuild()); - + std::string version = stringize(LLVersionInfo::instance().getShortVersion(), " (", + LLVersionInfo::instance().getBuild(), ')'); + LLTextBox* forgot_password_text = getChild("forgot_password_text"); forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); @@ -894,9 +894,8 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - params["version"] = llformat("%s (%ld)", - LLVersionInfo::instance().getShortVersion().c_str(), - LLVersionInfo::instance().getBuild()); + params["version"] = stringize(LLVersionInfo::instance().getShortVersion(), " (", + LLVersionInfo::instance().getBuild(), ')'); params["channel"] = LLVersionInfo::instance().getChannel(); // Grid diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 1e21c3fa05..6526e1df92 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -39,6 +39,7 @@ #include "json/reader.h" #include "llcorehttputil.h" #include "llurlregistry.h" +#include "stringize.h" static const std::string AZURE_NOTRANSLATE_OPENING_TAG("
"); @@ -160,12 +161,12 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, LLSD LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - std::string user_agent = llformat("%s %d.%d.%d (%ld)", - LLVersionInfo::instance().getChannel().c_str(), - LLVersionInfo::instance().getMajor(), - LLVersionInfo::instance().getMinor(), - LLVersionInfo::instance().getPatch(), - LLVersionInfo::instance().getBuild()); + std::string user_agent = stringize( + LLVersionInfo::instance().getChannel(), ' ', + LLVersionInfo::instance().getMajor(), '.', + LLVersionInfo::instance().getMinor(), '.', + LLVersionInfo::instance().getPatch(), " (", + LLVersionInfo::instance().getBuild(), ')'); initHttpHeader(httpHeaders, user_agent, key); @@ -215,12 +216,12 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - std::string user_agent = llformat("%s %d.%d.%d (%ld)", - LLVersionInfo::instance().getChannel().c_str(), - LLVersionInfo::instance().getMajor(), - LLVersionInfo::instance().getMinor(), - LLVersionInfo::instance().getPatch(), - LLVersionInfo::instance().getBuild()); + std::string user_agent = stringize( + LLVersionInfo::instance().getChannel(), ' ', + LLVersionInfo::instance().getMajor(), '.', + LLVersionInfo::instance().getMinor(), '.', + LLVersionInfo::instance().getPatch(), " (", + LLVersionInfo::instance().getBuild(), ')'); initHttpHeader(httpHeaders, user_agent); httpOpts->setSSLVerifyPeer(false); diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 62bfa24e29..9551df7bee 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -69,7 +69,7 @@ void LLVersionInfo::initSingleton() // fully constructed; such calls don't really belong in the constructor. // cache the version string - version = STRINGIZE(getShortVersion() << "." << getBuild()); + version = stringize(getShortVersion(), ".", getBuild()); } LLVersionInfo::~LLVersionInfo() @@ -91,7 +91,7 @@ S32 LLVersionInfo::getPatch() return LL_VIEWER_VERSION_PATCH; } -S64 LLVersionInfo::getBuild() +U64 LLVersionInfo::getBuild() { return LL_VIEWER_VERSION_BUILD; } diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 122bd5c47a..a40042380a 100644 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -61,7 +61,7 @@ public: S32 getPatch(); /// return the build number as an integer - S64 getBuild(); + U64 getBuild(); /// return the full viewer version as a string like "2.0.0.200030" std::string getVersion(); diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index b851b7ad5c..8ea07fcee0 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -42,6 +42,7 @@ #include "bufferarray.h" #include "llversioninfo.h" #include "llviewercontrol.h" +#include "stringize.h" // Have to include these last to avoid queue redefinition! @@ -384,14 +385,14 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); - std::string user_agent = llformat("%s %d.%d.%d (%ld)", - LLVersionInfo::instance().getChannel().c_str(), - LLVersionInfo::instance().getMajor(), - LLVersionInfo::instance().getMinor(), - LLVersionInfo::instance().getPatch(), - LLVersionInfo::instance().getBuild()); + std::string user_agent = stringize( + LLVersionInfo::instance().getChannel(), ' ', + LLVersionInfo::instance().getMajor(), '.', + LLVersionInfo::instance().getMinor(), '.', + LLVersionInfo::instance().getPatch(), " (", + LLVersionInfo::instance().getBuild(), ')'); - httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, user_agent); + httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, user_agent); ///* Setting the DNS cache timeout to -1 disables it completely. //This might help with bug #503 */ -- cgit v1.2.3 From 732fedbe8f585b86f7f44c058b7407f0f8a9ecf7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 25 Oct 2023 14:31:48 -0400 Subject: Increment viewer version to 6.6.17 following promotion of DRTVWR-578 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 5235a3e6f4..93409ff0c2 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.6.16 +6.6.17 -- cgit v1.2.3