From 803b75a718833ccf236f00b425faff4eaf0f29cb Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 18 Oct 2017 18:36:10 -0700 Subject: First version that builds with a dummy BugSplay call in llapp.cpp --- indra/newview/viewer_manifest.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 71e348db3f..7292f715b7 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -448,6 +448,11 @@ class WindowsManifest(ViewerManifest): # Hunspell self.path("libhunspell.dll") + # BugSplat + self.path("BsSndRpt64.exe") + self.path("BugSplat64.dll") + self.path("BugSplatRc64.dll") + # For google-perftools tcmalloc allocator. try: if self.args['configuration'].lower() == 'debug': @@ -457,7 +462,6 @@ class WindowsManifest(ViewerManifest): except: print "Skipping libtcmalloc_minimal.dll" - self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") self.path("ca-bundle.crt") @@ -571,10 +575,15 @@ class WindowsManifest(ViewerManifest): self.path("zh-CN.pak") self.path("zh-TW.pak") - with self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'release'), dst="llplugin"): - self.path("libvlc.dll") - self.path("libvlccore.dll") - self.path("plugins/") + with self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'release'), dst="llplugin"): + self.path("libvlc.dll") + self.path("libvlccore.dll") + self.path("plugins/") + + with self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'), dst=""): + self.path("BsSndRpt64.exe") + self.path("BugSplat64.dll") + self.path("BugSplatRc64.dll") # pull in the crash logger and updater from other projects # tag:"crash-logger" here as a cue to the exporter -- cgit v1.2.3 From 6cbb00fe85df8cb01c3a979dbdf2c0354e7bfa4d Mon Sep 17 00:00:00 2001 From: callum_linden Date: Thu, 19 Oct 2017 18:35:00 -0700 Subject: Differentiate between 32/64 bit windows builds for build systewm (BugsSplat enforces specifc names that vary across bitness) --- indra/newview/viewer_manifest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 7292f715b7..4e69597b61 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -449,9 +449,14 @@ class WindowsManifest(ViewerManifest): self.path("libhunspell.dll") # BugSplat - self.path("BsSndRpt64.exe") - self.path("BugSplat64.dll") - self.path("BugSplatRc64.dll") + 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") # For google-perftools tcmalloc allocator. try: @@ -580,11 +585,6 @@ class WindowsManifest(ViewerManifest): self.path("libvlccore.dll") self.path("plugins/") - with self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'), dst=""): - self.path("BsSndRpt64.exe") - self.path("BugSplat64.dll") - self.path("BugSplatRc64.dll") - # pull in the crash logger and updater from other projects # tag:"crash-logger" here as a cue to the exporter self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'], -- cgit v1.2.3 From 3de5bab17459ed5bf0494d7bd2a531c473e20b7e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 May 2018 16:00:20 -0400 Subject: SL-821: Move BugSplat includes/libs from llcommon to newview. No C++ source in llcommon references any of the BugSplat code. --- indra/newview/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6b16713add..1fd0af0558 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -4,6 +4,7 @@ project(viewer) include(00-Common) include(Boost) +include(bugsplat) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) @@ -91,6 +92,7 @@ include_directories( ${LIBS_PREBUILT_DIR}/include/collada/1.4 ${LLAPPEARANCE_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} + ${BUGSPLAT_INCLUDE_DIR} ) include_directories(SYSTEM @@ -1976,6 +1978,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLPHYSICS_LIBRARIES} ${LLPHYSICSEXTENSIONS_LIBRARIES} ${LLAPPEARANCE_LIBRARIES} + ${BUGSPLAT_LIBRARIES} ) set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH -- cgit v1.2.3 From 78b8a0c3e44d7ae0931da7ea6064a12bd3d77b8c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 May 2018 17:04:24 -0400 Subject: SL-821: Use one self.path() call for everything under "llplugin". --- indra/newview/viewer_manifest.py | 195 ++++++++++++++++++++------------------- 1 file changed, 98 insertions(+), 97 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 437769726d..3375d4e071 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -605,103 +605,104 @@ class WindowsManifest(ViewerManifest): self.path("ca-bundle.crt") # Media plugins - CEF - with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_cef.dll") - - # Media plugins - LibVLC - with self.prefix(src='../media_plugins/libvlc/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_libvlc.dll") - - # Media plugins - Example (useful for debugging - not shipped with release viewer) - if self.channel_type() != 'release': - with self.prefix(src='../media_plugins/example/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_example.dll") - - # CEF runtime files - debug - # CEF runtime files - not debug (release, relwithdebinfo etc.) - config = 'debug' if self.args['configuration'].lower() == 'debug' else 'release' - with self.prefix(src=os.path.join(pkgdir, 'bin', config), dst="llplugin"): - self.path("chrome_elf.dll") - self.path("d3dcompiler_43.dll") - self.path("d3dcompiler_47.dll") - self.path("libcef.dll") - self.path("libEGL.dll") - self.path("libGLESv2.dll") - self.path("dullahan_host.exe") - self.path("natives_blob.bin") - self.path("snapshot_blob.bin") - self.path("widevinecdmadapter.dll") - - # MSVC DLLs needed for CEF and have to be in same directory as plugin - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release'), dst="llplugin"): - self.path("msvcp120.dll") - self.path("msvcr120.dll") - - # CEF files common to all configurations - with self.prefix(src=os.path.join(pkgdir, 'resources'), dst="llplugin"): - self.path("cef.pak") - self.path("cef_100_percent.pak") - self.path("cef_200_percent.pak") - self.path("cef_extensions.pak") - self.path("devtools_resources.pak") - self.path("icudtl.dat") - - with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst=os.path.join('llplugin', 'locales')): - self.path("am.pak") - self.path("ar.pak") - self.path("bg.pak") - self.path("bn.pak") - self.path("ca.pak") - self.path("cs.pak") - self.path("da.pak") - self.path("de.pak") - self.path("el.pak") - self.path("en-GB.pak") - self.path("en-US.pak") - self.path("es-419.pak") - self.path("es.pak") - self.path("et.pak") - self.path("fa.pak") - self.path("fi.pak") - self.path("fil.pak") - self.path("fr.pak") - self.path("gu.pak") - self.path("he.pak") - self.path("hi.pak") - self.path("hr.pak") - self.path("hu.pak") - self.path("id.pak") - self.path("it.pak") - self.path("ja.pak") - self.path("kn.pak") - self.path("ko.pak") - self.path("lt.pak") - self.path("lv.pak") - self.path("ml.pak") - self.path("mr.pak") - self.path("ms.pak") - self.path("nb.pak") - self.path("nl.pak") - self.path("pl.pak") - self.path("pt-BR.pak") - self.path("pt-PT.pak") - self.path("ro.pak") - self.path("ru.pak") - self.path("sk.pak") - self.path("sl.pak") - self.path("sr.pak") - self.path("sv.pak") - self.path("sw.pak") - self.path("ta.pak") - self.path("te.pak") - self.path("th.pak") - self.path("tr.pak") - self.path("uk.pak") - self.path("vi.pak") - self.path("zh-CN.pak") - self.path("zh-TW.pak") - - with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="llplugin"): + with self.prefix(dst="llplugin"): + with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration']): + self.path("media_plugin_cef.dll") + + # Media plugins - LibVLC + with self.prefix(src='../media_plugins/libvlc/%s' % self.args['configuration']): + self.path("media_plugin_libvlc.dll") + + # Media plugins - Example (useful for debugging - not shipped with release viewer) + if self.channel_type() != 'release': + with self.prefix(src='../media_plugins/example/%s' % self.args['configuration']): + self.path("media_plugin_example.dll") + + # CEF runtime files - debug + # CEF runtime files - not debug (release, relwithdebinfo etc.) + config = 'debug' if self.args['configuration'].lower() == 'debug' else 'release' + with self.prefix(src=os.path.join(pkgdir, 'bin', config)): + self.path("chrome_elf.dll") + self.path("d3dcompiler_43.dll") + self.path("d3dcompiler_47.dll") + self.path("libcef.dll") + self.path("libEGL.dll") + self.path("libGLESv2.dll") + self.path("dullahan_host.exe") + self.path("natives_blob.bin") + self.path("snapshot_blob.bin") + self.path("widevinecdmadapter.dll") + + # MSVC DLLs needed for CEF and have to be in same directory as plugin + with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release')): + self.path("msvcp120.dll") + self.path("msvcr120.dll") + + # CEF files common to all configurations + with self.prefix(src=os.path.join(pkgdir, 'resources')): + self.path("cef.pak") + self.path("cef_100_percent.pak") + self.path("cef_200_percent.pak") + self.path("cef_extensions.pak") + self.path("devtools_resources.pak") + self.path("icudtl.dat") + + with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst='locales'): + self.path("am.pak") + self.path("ar.pak") + self.path("bg.pak") + self.path("bn.pak") + self.path("ca.pak") + self.path("cs.pak") + self.path("da.pak") + self.path("de.pak") + self.path("el.pak") + self.path("en-GB.pak") + self.path("en-US.pak") + self.path("es-419.pak") + self.path("es.pak") + self.path("et.pak") + self.path("fa.pak") + self.path("fi.pak") + self.path("fil.pak") + self.path("fr.pak") + self.path("gu.pak") + self.path("he.pak") + self.path("hi.pak") + self.path("hr.pak") + self.path("hu.pak") + self.path("id.pak") + self.path("it.pak") + self.path("ja.pak") + self.path("kn.pak") + self.path("ko.pak") + self.path("lt.pak") + self.path("lv.pak") + self.path("ml.pak") + self.path("mr.pak") + self.path("ms.pak") + self.path("nb.pak") + self.path("nl.pak") + self.path("pl.pak") + self.path("pt-BR.pak") + self.path("pt-PT.pak") + self.path("ro.pak") + self.path("ru.pak") + self.path("sk.pak") + self.path("sl.pak") + self.path("sr.pak") + self.path("sv.pak") + self.path("sw.pak") + self.path("ta.pak") + self.path("te.pak") + self.path("th.pak") + self.path("tr.pak") + self.path("uk.pak") + self.path("vi.pak") + self.path("zh-CN.pak") + self.path("zh-TW.pak") + + with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): self.path("libvlc.dll") self.path("libvlccore.dll") self.path("plugins/") -- cgit v1.2.3 From ed891c60de4169fa8ef4cc19e953e389cc4df60e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 May 2018 05:33:14 -0400 Subject: SL-821: Add LL_TO_WSTRING() macro to llpreprocessor.h. Also use existing LL_TO_STRING() macro to stringize LL_VIEWER_CHANNEL in llversioninfo.cpp and its tests. --- indra/newview/llversioninfo.cpp | 7 ++----- indra/newview/tests/llversioninfo_test.cpp | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 375dce485d..4e07223784 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -101,14 +101,11 @@ namespace { // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The // macro expands to the string name of the channel, but without quotes. We - // need to turn it into a quoted string. This macro trick does that. -#define stringize_inner(x) #x -#define stringize_outer(x) stringize_inner(x) - + // need to turn it into a quoted string. LL_TO_STRING() does that. /// Storage of the channel name the viewer is using. // The channel name is set by hardcoded constant, // or by calling LLVersionInfo::resetChannel() - std::string sWorkingChannelName(stringize_outer(LL_VIEWER_CHANNEL)); + std::string sWorkingChannelName(LL_TO_STRING(LL_VIEWER_CHANNEL)); // Storage for the "version and channel" string. // This will get reset too. diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp index 2f7a4e9601..58f0469552 100644 --- a/indra/newview/tests/llversioninfo_test.cpp +++ b/indra/newview/tests/llversioninfo_test.cpp @@ -33,10 +33,8 @@ // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The // macro expands to the string name of the channel, but without quotes. We -// need to turn it into a quoted string. This macro trick does that. -#define stringize_inner(x) #x -#define stringize_outer(x) stringize_inner(x) -#define ll_viewer_channel stringize_outer(LL_VIEWER_CHANNEL) +// need to turn it into a quoted string. LL_TO_STRING() does that. +#define ll_viewer_channel LL_TO_STRING(LL_VIEWER_CHANNEL) namespace tut { -- cgit v1.2.3 From c5f618d096f05bdff91a5d384c46e26840f5a771 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 May 2018 06:53:42 -0400 Subject: SL-821: Move Windows BugSplat engagement from llcommon to newview. Use WSTRINGIZE(), LL_TO_WSTRING(), wstringize() to produce required wide strings. Use a lambda for callback that sends log file; use LLDir, if set, to find the log file. Introduce BUGSPLAT CMake variable to allow suppressing BugSplat. Make BUGSPLAT CMake variable set LL_BUGSPLAT for C++ compilations. Set viewer version macros on llappviewerwin32.cpp, llappviewerlinux.cpp and llappdelegate-objc.mm -- because BugSplat needs the viewer version data, and because the macOS BugSplat hook is engaged in an Objective-C++ function we override in the app delegate. --- indra/newview/CMakeLists.txt | 23 +++++++++++++++++- indra/newview/llappviewerwin32.cpp | 49 ++++++++++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1fd0af0558..2592b532c4 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1354,6 +1354,11 @@ if (DARWIN) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) + set_source_files_properties( + llappdelegate-objc.mm + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1366,6 +1371,7 @@ if (DARWIN) ${AGL_LIBRARY} ${IOKIT_LIBRARY} ${COREAUDIO_LIBRARY} + ${BUGSPLAT_LIBRARIES} ) # Add resource files to the project. @@ -1393,6 +1399,11 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) + set_source_files_properties( + llappviewerlinux.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") @@ -1409,6 +1420,11 @@ if (WINDOWS) llappviewerwin32.cpp llwindebug.cpp ) + set_source_files_properties( + llappviewerwin32.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) list(APPEND viewer_HEADER_FILES llappviewerwin32.h @@ -1692,6 +1708,11 @@ if (SDL_FOUND) ) endif (SDL_FOUND) +if (BUGSPLAT) + set_property(TARGET ${VIEWER_BINARY_NAME} + PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT") +endif (BUGSPLAT) + # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) @@ -1790,7 +1811,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll ) endif (FMODEX) - + add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat COMMAND ${PYTHON_EXECUTABLE} diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 48b3a1c485..8a014c55d7 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -66,8 +66,18 @@ #endif #include "stringize.h" +#include "lldir.h" #include + +// Bugsplat (http://bugsplat.com) crash reporting tool +#ifdef LL_BUGSPLAT +#include "BugSplat.h" + +// FIXME: need a production BugSplat database name +static const wchar_t *bugdb_name = L"second_life_callum_test"; +#endif + namespace { void (*gOldTerminateHandler)() = NULL; @@ -495,15 +505,46 @@ bool LLAppViewerWin32::init() LLWinDebug::instance(); #endif -#if LL_WINDOWS #if LL_SEND_CRASH_REPORTS - +#if ! defined(LL_BUGSPLAT) LLAppViewer* pApp = LLAppViewer::instance(); pApp->initCrashReporting(); -#endif -#endif +#else // LL_BUGSPLAT + + std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << + LL_VIEWER_VERSION_MINOR << '.' << + LL_VIEWER_VERSION_PATCH << '.' << + LL_VIEWER_VERSION_BUILD)); + + auto sender = new MiniDmpSender( + bugdb_name, LL_TO_WSTRING(LL_VIEWER_CHANNEL), version_string.c_str(), nullptr); + sender->setCallback( + [sender](unsigned int nCode, void* lpVal1, void* lpVal2) + { + // If we haven't yet initialized LLDir, don't bother trying to + // find our log file. + // Alternatively -- if we might encounter trouble trying to query + // LLDir during crash cleanup -- consider making gDirUtilp an + // LLPounceable, and attach a callback that stores the pathname to + // the log file here. + if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp) + { + // send the main viewer log file + // widen to wstring, then pass c_str() + sender->sendAdditionalFile( + wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log")).c_str()); + } + + return false; + }); + + LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) + << version_string << ')' << LL_ENDL; + +#endif // LL_BUGSPLAT +#endif // LL_SEND_CRASH_REPORTS bool success = LLAppViewer::init(); -- cgit v1.2.3 From cd21556aef547dbb031e363d3a9b9f1893be4d08 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 May 2018 10:58:59 -0400 Subject: SL-821: Convert wstrings to strings of __wchar_t for BugSplat API. --- indra/newview/llappviewerwin32.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 8a014c55d7..91c6f08000 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -76,7 +76,14 @@ // FIXME: need a production BugSplat database name static const wchar_t *bugdb_name = L"second_life_callum_test"; -#endif + +// MiniDmpSender's constructor is defined to accept __wchar_t* instead of +// plain wchar_t*. +inline std::basic_string<__wchar_t> wunder(const std::wstring& str) +{ + return { str.begin(), str.end() }; +} +#endif // LL_BUGSPLAT namespace { @@ -518,8 +525,12 @@ bool LLAppViewerWin32::init() LL_VIEWER_VERSION_PATCH << '.' << LL_VIEWER_VERSION_BUILD)); + // have to convert normal wide strings to strings of __wchar_t auto sender = new MiniDmpSender( - bugdb_name, LL_TO_WSTRING(LL_VIEWER_CHANNEL), version_string.c_str(), nullptr); + wunder(bugdb_name).c_str(), + wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), + wunder(version_string).c_str(), + nullptr); sender->setCallback( [sender](unsigned int nCode, void* lpVal1, void* lpVal2) { @@ -532,16 +543,17 @@ bool LLAppViewerWin32::init() if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp) { // send the main viewer log file - // widen to wstring, then pass c_str() + // widen to wstring, convert to __wchar_t, then pass c_str() sender->sendAdditionalFile( - wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log")).c_str()); + wunder(wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))).c_str()); } return false; }); + // engage stringize() overload that converts from wstring LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) - << version_string << ')' << LL_ENDL; + << stringize(version_string) << ')' << LL_ENDL; #endif // LL_BUGSPLAT #endif // LL_SEND_CRASH_REPORTS -- cgit v1.2.3 From 800b47ec230d1d2a6781dce5ba9816d10a37e91e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 17 May 2018 15:02:26 -0400 Subject: SL-821: Use classic-C BugSplat callback and static dumb pointer. BugSplat has no business introducing a new C++ API based on classic-C function pointers without even a generic pass-through user data pointer! --- indra/newview/llappviewerwin32.cpp | 65 ++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 91c6f08000..5f3bf14bc2 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -74,14 +74,43 @@ #ifdef LL_BUGSPLAT #include "BugSplat.h" -// FIXME: need a production BugSplat database name -static const wchar_t *bugdb_name = L"second_life_callum_test"; - -// MiniDmpSender's constructor is defined to accept __wchar_t* instead of -// plain wchar_t*. -inline std::basic_string<__wchar_t> wunder(const std::wstring& str) +namespace { - return { str.begin(), str.end() }; + // FIXME: need a production BugSplat database name + static const wchar_t *bugdb_name = L"second_life_callum_test"; + + // MiniDmpSender's constructor is defined to accept __wchar_t* instead of + // plain wchar_t*. + inline std::basic_string<__wchar_t> wunder(const std::wstring& str) + { + return { str.begin(), str.end() }; + } + + // Irritatingly, MiniDmpSender::setCallback() is defined to accept a + // classic-C function pointer instead of an arbitrary C++ callable. In the + // latter case, we could pass a lambda that binds our MiniDmpSender + // pointer. As things stand, we must define an actual function and store + // the pointer statically. + static MiniDmpSender *sBugSplatSender = nullptr; + + bool bugsplatSendLog(UINT nCode, LPVOID lpVal1, LPVOID lpVal2) + { + // If we haven't yet initialized LLDir, don't bother trying to + // find our log file. + // Alternatively -- if we might encounter trouble trying to query + // LLDir during crash cleanup -- consider making gDirUtilp an + // LLPounceable, and attach a callback that stores the pathname to + // the log file here. + if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp) + { + // send the main viewer log file + // widen to wstring, convert to __wchar_t, then pass c_str() + sBugSplatSender->sendAdditionalFile( + wunder(wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))).c_str()); + } + + return false; + } } #endif // LL_BUGSPLAT @@ -526,30 +555,12 @@ bool LLAppViewerWin32::init() LL_VIEWER_VERSION_BUILD)); // have to convert normal wide strings to strings of __wchar_t - auto sender = new MiniDmpSender( + sBugSplatSender = new MiniDmpSender( wunder(bugdb_name).c_str(), wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), wunder(version_string).c_str(), nullptr); - sender->setCallback( - [sender](unsigned int nCode, void* lpVal1, void* lpVal2) - { - // If we haven't yet initialized LLDir, don't bother trying to - // find our log file. - // Alternatively -- if we might encounter trouble trying to query - // LLDir during crash cleanup -- consider making gDirUtilp an - // LLPounceable, and attach a callback that stores the pathname to - // the log file here. - if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp) - { - // send the main viewer log file - // widen to wstring, convert to __wchar_t, then pass c_str() - sender->sendAdditionalFile( - wunder(wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))).c_str()); - } - - return false; - }); + sBugSplatSender->setCallback(bugsplatSendLog); // engage stringize() overload that converts from wstring LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) -- cgit v1.2.3 From 4562773abcfe14425478889e2fea02da205013e1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 May 2018 13:03:43 -0400 Subject: SL-821: Reorder CMakeLists.txt includes to resolve interdependencies. --- indra/newview/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2592b532c4..d28791485c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -3,6 +3,10 @@ project(viewer) include(00-Common) +# DON'T move Linking.cmake to its place in the alphabetized list below: it +# sets variables on which the 3p .cmake files depend. +include(Linking) + include(Boost) include(bugsplat) include(BuildPackagesInfo) @@ -38,7 +42,6 @@ include(LLUI) include(LLVFS) include(LLWindow) include(LLXML) -include(Linking) include(NDOF) include(NVAPI) include(OPENAL) -- cgit v1.2.3 From 881bdec4b356ede32b0d0896334f7d6addac6c54 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 May 2018 13:07:44 -0400 Subject: SL-821: Introduce macOS BugSplat initialization. --- indra/newview/llappdelegate-objc.mm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index aebae4c434..2fa8319260 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -25,6 +25,9 @@ */ #import "llappdelegate-objc.h" +#if defined(LL_BUGSPLAT) +#import BugsplatMac; +#endif #include "llwindowmacosx-objc.h" #include // Used for Text Input Services ("Safe" API - it's supported) @@ -64,6 +67,11 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; // [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; + +#if defined(LL_BUGSPLAT) + // https://www.bugsplat.com/docs/platforms/os-x#initialization + [[BugsplatStartupManager sharedManager] start]; +#endif } - (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { -- cgit v1.2.3 From 3a885e9cb7bb86e82036b217e2aaf2d96106be43 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 May 2018 13:29:16 -0400 Subject: SL-821: Use @import, not #import. --- indra/newview/llappdelegate-objc.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 2fa8319260..e8b4272e51 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -26,7 +26,7 @@ #import "llappdelegate-objc.h" #if defined(LL_BUGSPLAT) -#import BugsplatMac; +@import BugsplatMac; #endif #include "llwindowmacosx-objc.h" #include // Used for Text Input Services ("Safe" API - it's supported) -- cgit v1.2.3 From 6f878571ec65d15f9e06af39375cc0251e4d1e2d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 May 2018 13:54:39 -0400 Subject: SL-821: Add -fmodules to llappdelegate-objc.mm compile switches. The BugsplatMac package is built as a module requiring @import. Using @import requires Objective-C++ module support, which requires the -fmodules switch. --- indra/newview/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d28791485c..3501fdf800 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1361,6 +1361,7 @@ if (DARWIN) llappdelegate-objc.mm PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + COMPILE_FLAGS "-fmodules" ) find_library(AGL_LIBRARY AGL) -- cgit v1.2.3 From 170d5201ff97b4110fa9cc2a9a80234de53e12d8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 May 2018 14:13:11 -0400 Subject: SL-821: Need -fcxx-modules for C++ module support, vs. classic C. --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3501fdf800..7638a74bc1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1361,7 +1361,7 @@ if (DARWIN) llappdelegate-objc.mm PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" - COMPILE_FLAGS "-fmodules" + COMPILE_FLAGS "-fmodules -fcxx-modules" ) find_library(AGL_LIBRARY AGL) -- cgit v1.2.3 From 199c688e211125ae1b404425d9a8bd3bc036ea50 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 22 May 2018 11:52:00 -0400 Subject: SL-821: Copy BugsplatMac.framework into target application bundle. --- indra/newview/viewer_manifest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3375d4e071..d1a56c2230 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1005,13 +1005,15 @@ open "%s" --args "$@" os.path.basename(Info_plist), "Info.plist") - # CEF framework goes inside viewer_app/Contents/Frameworks. - # Remember where we parked this car. with self.prefix(src="", dst="Frameworks"): + # CEF framework goes inside viewer_app/Contents/Frameworks. CEF_framework = "Chromium Embedded Framework.framework" self.path2basename(relpkgdir, CEF_framework) + # Remember where we parked this car. CEF_framework = self.dst_path_of(CEF_framework) + self.path2basename(relpkgdir, "BugsplatMac.framework") + with self.prefix(dst="MacOS"): # CMake constructs the Second Life executable in the # MacOS directory belonging to the top-level Second -- cgit v1.2.3 From 48534c1badcd2f63dee2ee0106a109b93604827c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 22 May 2018 12:00:20 -0400 Subject: SL-821: Add macOS rpath to Mac viewer executable for BugsplatMac. The BugsplatMac framework is stamped with @rpath/BugsplatMac.framework/etc., so that's the dependency stamped into our viewer executable. To support that lookup, direct CMake to add an appropriate RPATH to the executable. --- indra/newview/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7638a74bc1..954d5ce9ed 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1361,9 +1361,16 @@ if (DARWIN) llappdelegate-objc.mm PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + # BugsplatMac is a module, imported with @import. That language feature + # demands these switches. COMPILE_FLAGS "-fmodules -fcxx-modules" ) + # from https://stackoverflow.com/a/43551534 + set(CMAKE_MACOSX_RPATH 1) + # From Contents/MacOS/SecondLife, look in Contents/Frameworks + set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks") + find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) find_library(COCOA_LIBRARY Cocoa) -- cgit v1.2.3 From 43716d580049bb026904133f0804e8c8d1f519aa Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 23 May 2018 15:48:58 -0400 Subject: SL-821: Try again to add -rpath to Mac executable for BugSplat. --- indra/newview/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6065a08524..9e8a68224b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1368,11 +1368,6 @@ if (DARWIN) COMPILE_FLAGS "-fmodules -fcxx-modules" ) - # from https://stackoverflow.com/a/43551534 - set(CMAKE_MACOSX_RPATH 1) - # From Contents/MacOS/SecondLife, look in Contents/Frameworks - set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks") - find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) find_library(COCOA_LIBRARY Cocoa) @@ -1937,8 +1932,8 @@ else (WINDOWS) endif (WINDOWS) # *NOTE: - this list is very sensitive to ordering, test carefully on all -# platforms if you change the releative order of the entries here. -# In particular, cmake 2.6.4 (when buidling with linux/makefile generators) +# platforms if you change the relative order of the entries here. +# In particular, cmake 2.6.4 (when building with linux/makefile generators) # appears to sometimes de-duplicate redundantly listed dependencies improperly. # To work around this, higher level modules should be listed before the modules # that they depend upon. -brad @@ -2101,11 +2096,16 @@ if (DARWIN) set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + + # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ + set(CMAKE_MACOSX_RPATH 1) set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" + # From Contents/MacOS/SecondLife, look in Contents/Frameworks + INSTALL_RPATH "@loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) -- cgit v1.2.3 From b247c4e42434715459df93b5cbf6adb15d3c4cc4 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 24 May 2018 08:48:00 -0400 Subject: SL-821: Force the Mac -rpath linker switch using LINK_FLAGS property instead of the INSTALL_RPATH CMake property, which _should_ have worked. --- indra/newview/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9e8a68224b..c67f365767 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2106,6 +2106,9 @@ if (DARWIN) OUTPUT_NAME "${product}" # From Contents/MacOS/SecondLife, look in Contents/Frameworks INSTALL_RPATH "@loader_path/../Frameworks" + # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply + # does not work. Try this: + LINK_FLAGS "-rpath @loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) -- cgit v1.2.3 From 63fe7d802aad177107ef8e3bc0c9b7ea5118ad61 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 25 May 2018 12:09:50 -0400 Subject: SL-821, SL-826: Use BUGSPLAT_DB from environment on Windows and Mac. On TeamCity, set BUGSPLAT_DB from build-secrets. Use the presence of $BUGSPLAT_DB, rather than a new CMake BUGSPLAT option, to control whether CMake searches for BugSplat -- and passes LL_BUGSPLAT into C++. When BUGSPLAT_DB is present, make viewer_manifest.py set "BugSplat DB" in build_data.json, and "BugsplatServerURL" in Mac Info.plist. Make llappviewerwin32.cpp read "BugSplat DB" from build_data.json. Add placeholders for Mac hooks to suppress BugSplat prompt and send SecondLife.log. --- indra/newview/CMakeLists.txt | 4 +- indra/newview/llappdelegate-objc.mm | 19 ++++++++ indra/newview/llappviewerwin32.cpp | 87 +++++++++++++++++++++++++++---------- indra/newview/viewer_manifest.py | 12 +++++ 4 files changed, 96 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c67f365767..cf275ef4b5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1715,10 +1715,10 @@ if (SDL_FOUND) ) endif (SDL_FOUND) -if (BUGSPLAT) +if (DEFINED ENV{BUGSPLAT_DB}) set_property(TARGET ${VIEWER_BINARY_NAME} PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT") -endif (BUGSPLAT) +endif (DEFINED ENV{BUGSPLAT_DB}) # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index e8b4272e51..8e1ad169c9 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -70,6 +70,8 @@ #if defined(LL_BUGSPLAT) // https://www.bugsplat.com/docs/platforms/os-x#initialization +// [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; +// [BugsplatStartupManager sharedManager].askUserDetails = NO; [[BugsplatStartupManager sharedManager] start]; #endif } @@ -187,4 +189,21 @@ return true; } +#if 0 // defined(LL_BUGSPLAT) + +@implementation BugsplatStartupManagerDelegate + +- (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { + NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"example" withExtension:@"json"]; + NSData *data = [NSData dataWithContentsOfURL:fileURL]; + + BugsplatAttachment *attachment = + [[BugsplatAttachment alloc] initWithFilename:@"example.json" + attachmentData:data + contentType:@"application/json"]; + return attachment; +} + +#endif // LL_BUGSPLAT + @end diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 5f3bf14bc2..f9df2b88ed 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -68,29 +68,30 @@ #include "stringize.h" #include "lldir.h" +#include #include // Bugsplat (http://bugsplat.com) crash reporting tool #ifdef LL_BUGSPLAT #include "BugSplat.h" +#include "reader.h" // JsonCpp namespace { - // FIXME: need a production BugSplat database name - static const wchar_t *bugdb_name = L"second_life_callum_test"; - // MiniDmpSender's constructor is defined to accept __wchar_t* instead of - // plain wchar_t*. + // plain wchar_t*. It would be nice if, when wchar_t is the same as + // __wchar_t, this whole function would optimize away. However, we use it + // only for the arguments to make exactly one call to initialize BugSplat. inline std::basic_string<__wchar_t> wunder(const std::wstring& str) { return { str.begin(), str.end() }; } // Irritatingly, MiniDmpSender::setCallback() is defined to accept a - // classic-C function pointer instead of an arbitrary C++ callable. In the - // latter case, we could pass a lambda that binds our MiniDmpSender - // pointer. As things stand, we must define an actual function and store - // the pointer statically. + // classic-C function pointer instead of an arbitrary C++ callable. If it + // did accept a modern callable, we could pass a lambda that binds our + // MiniDmpSender pointer. As things stand, though, we must define an + // actual function and store the pointer statically. static MiniDmpSender *sBugSplatSender = nullptr; bool bugsplatSendLog(UINT nCode, LPVOID lpVal1, LPVOID lpVal2) @@ -549,22 +550,60 @@ bool LLAppViewerWin32::init() #else // LL_BUGSPLAT - std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << - LL_VIEWER_VERSION_MINOR << '.' << - LL_VIEWER_VERSION_PATCH << '.' << - LL_VIEWER_VERSION_BUILD)); - - // have to convert normal wide strings to strings of __wchar_t - sBugSplatSender = new MiniDmpSender( - wunder(bugdb_name).c_str(), - wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), - wunder(version_string).c_str(), - nullptr); - sBugSplatSender->setCallback(bugsplatSendLog); - - // engage stringize() overload that converts from wstring - LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) - << stringize(version_string) << ')' << LL_ENDL; + if (gDirUtilp) + { + LL_WARNS() << "Can't initialize BugSplat, gDirUtilp not yet set" << LL_ENDL; + } + else + { + std::string build_data_fname( + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); + std::ifstream inf(build_data_fname.c_str()); + if (! inf.open()) + { + LL_WARNS() << "Can't initialize BugSplat, can't read '" << build_data_fname + << "'" << LL_ENDL; + } + else + { + Json::Reader reader; + Json::Value build_data; + if (! reader.parse(inf, build_data, false)) // don't collect comments + { + LL_WARNS() << "Can't initialize BugSplat, can't parse '" << build_data_fname + << "': " << reader.getFormattedErrorMessages() << LL_ENDL; + } + else + { + Json::Value BugSplat_DB = build_data["BugSplat DB"]; + if (! BugSplat_DB) + { + LL_WARNS() << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" + << build_data_fname "'" << LL_ENDL; + } + else + { + // Got BugSplat_DB, onward! + std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << + LL_VIEWER_VERSION_MINOR << '.' << + LL_VIEWER_VERSION_PATCH << '.' << + LL_VIEWER_VERSION_BUILD)); + + // have to convert normal wide strings to strings of __wchar_t + sBugSplatSender = new MiniDmpSender( + wunder(BugSplat_DB).c_str(), + wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), + wunder(version_string).c_str(), + nullptr); + sBugSplatSender->setCallback(bugsplatSendLog); + + // engage stringize() overload that converts from wstring + LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) + << stringize(version_string) << ')' << LL_ENDL; + } // got BugSplat_DB + } // parsed build_data.json + } // opened build_data.json + } // gDirUtilp set #endif // LL_BUGSPLAT #endif // LL_SEND_CRASH_REPORTS diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1fa948f89e..68ad1db14d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -186,6 +186,11 @@ class ViewerManifest(LLManifest): "Address Size":self.address_size, "Update Service":"https://update.secondlife.com/update", } + try: + build_data_dict["BugSplat DB"] = os.environ["BUGSPLAT_DB"] + except KeyError: + # skip the assignment if there's no BUGSPLAT_DB variable + pass build_data_dict = self.finish_build_data_dict(build_data_dict) with open(os.path.join(os.pardir,'build_data.json'), 'w') as build_data_handle: json.dump(build_data_dict,build_data_handle) @@ -1001,6 +1006,13 @@ open "%s" --args "$@" # runs the executable, instead of launching the app) Info["CFBundleExecutable"] = "Second Life" Info["CFBundleIconFile"] = viewer_icon + try: + # https://www.bugsplat.com/docs/platforms/os-x#configuration + Info["BugsplatServerURL"] = \ + "https://{BUGSPLAT_DB}.bugsplatsoftware.com/".format(**os.environ) + except KeyError: + # skip the assignment if there's no BUGSPLAT_DB variable + pass self.put_in_file( plistlib.writePlistToString(Info), os.path.basename(Info_plist), -- cgit v1.2.3 From 3ca76065b0beeaf276078b4bc28b8e0c6295a4fc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 25 May 2018 19:02:53 -0400 Subject: SL-823: Fix minor compile errors in code to read build_data.json. --- indra/newview/llappviewerwin32.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index f9df2b88ed..b7ad28448b 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -79,14 +79,29 @@ namespace { // MiniDmpSender's constructor is defined to accept __wchar_t* instead of - // plain wchar_t*. It would be nice if, when wchar_t is the same as - // __wchar_t, this whole function would optimize away. However, we use it - // only for the arguments to make exactly one call to initialize BugSplat. + // plain wchar_t*. That said, wunder() returns std::basic_string<__wchar_t>, + // NOT plain __wchar_t*, despite the apparent convenience. Calling + // wunder(something).c_str() as an argument expression is fine: that + // std::basic_string instance will survive until the function returns. + // Calling c_str() on a std::basic_string local to wunder() would be + // Undefined Behavior: we'd be left with a pointer into a destroyed + // std::basic_string instance. + + // It would be nice if, when wchar_t is the same as __wchar_t, this whole + // function would optimize away. However, we use it only for the arguments + // to make exactly one call to initialize BugSplat. inline std::basic_string<__wchar_t> wunder(const std::wstring& str) { return { str.begin(), str.end() }; } + // when what we have in hand is a std::string, convert from UTF-8 using + // specific wstringize() overload + inline std::basic_string<__wchar_t> wunder(const std::string& str) + { + return wunder(wstringize(str)); + } + // Irritatingly, MiniDmpSender::setCallback() is defined to accept a // classic-C function pointer instead of an arbitrary C++ callable. If it // did accept a modern callable, we could pass a lambda that binds our @@ -107,7 +122,7 @@ namespace // send the main viewer log file // widen to wstring, convert to __wchar_t, then pass c_str() sBugSplatSender->sendAdditionalFile( - wunder(wstringize(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))).c_str()); + wunder(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log")).c_str()); } return false; @@ -559,7 +574,7 @@ bool LLAppViewerWin32::init() std::string build_data_fname( gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); std::ifstream inf(build_data_fname.c_str()); - if (! inf.open()) + if (! inf.is_open()) { LL_WARNS() << "Can't initialize BugSplat, can't read '" << build_data_fname << "'" << LL_ENDL; @@ -570,8 +585,9 @@ bool LLAppViewerWin32::init() Json::Value build_data; if (! reader.parse(inf, build_data, false)) // don't collect comments { + // gah, the typo is baked into their API LL_WARNS() << "Can't initialize BugSplat, can't parse '" << build_data_fname - << "': " << reader.getFormattedErrorMessages() << LL_ENDL; + << "': " << reader.getFormatedErrorMessages() << LL_ENDL; } else { @@ -579,7 +595,7 @@ bool LLAppViewerWin32::init() if (! BugSplat_DB) { LL_WARNS() << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" - << build_data_fname "'" << LL_ENDL; + << build_data_fname << "'" << LL_ENDL; } else { @@ -591,7 +607,7 @@ bool LLAppViewerWin32::init() // have to convert normal wide strings to strings of __wchar_t sBugSplatSender = new MiniDmpSender( - wunder(BugSplat_DB).c_str(), + wunder(BugSplat_DB.asString()).c_str(), wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), wunder(version_string).c_str(), nullptr); -- cgit v1.2.3 From a5c17472fb3bbd2bc6fe188c450d2123963b5d6e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 26 May 2018 08:44:57 -0400 Subject: SL-823: Fix typo in code that sets up BugSplat. --- indra/newview/llappviewerwin32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index f9df2b88ed..c2cbce493c 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -550,7 +550,7 @@ bool LLAppViewerWin32::init() #else // LL_BUGSPLAT - if (gDirUtilp) + if (! gDirUtilp) { LL_WARNS() << "Can't initialize BugSplat, gDirUtilp not yet set" << LL_ENDL; } -- cgit v1.2.3 From d2fa5a53e8b91bd0aba10ab3917c722dc360b610 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 30 May 2018 13:14:43 -0400 Subject: remove unused UNATTENDED cmake variable that generates warnings --- indra/newview/CMakeLists.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index cf275ef4b5..6b3db36efe 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1853,23 +1853,21 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin - windows-crash-logger + windows-crash-logger ) # sets the 'working directory' for debugging from visual studio. - if (NOT UNATTENDED) - add_custom_command( - TARGET ${VIEWER_BINARY_NAME} POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe - ARGS - --solution - ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln - --workingdir - ${VIEWER_BINARY_NAME} - "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." - ) - endif (NOT UNATTENDED) + add_custom_command( + TARGET ${VIEWER_BINARY_NAME} POST_BUILD + COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe + ARGS + --solution + ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln + --workingdir + ${VIEWER_BINARY_NAME} + "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." + ) if (PACKAGE) add_custom_command( -- cgit v1.2.3 From 5caeacb3f6cf677cbec265ee6de733697dbf30ec Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jun 2018 10:55:38 -0400 Subject: SL-821: Create macOS symbol-file archive while packaging. --- indra/newview/viewer_manifest.py | 67 +++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 68ad1db14d..8f2d04e9b8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -26,19 +26,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA $/LicenseInfo$ """ -import sys -import os -import os.path -import shutil import errno import json +import os +import os.path 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. @@ -903,6 +904,9 @@ class DarwinManifest(ViewerManifest): launcher_app, launcher_icon = "Second Life Launcher.app", "secondlife.icns" viewer_app, viewer_icon = "Second Life Viewer.app", "secondlife.icns" + # capture the path to the directory containing toplevel_app + parentdir = os.path.join(self.get_dst_prefix(), os.pardir) + # copy over the build result (this is a no-op if run within the xcode script) self.path(os.path.join(self.args['configuration'], toplevel_app), dst="") @@ -914,10 +918,12 @@ class DarwinManifest(ViewerManifest): # top-level Second Life application is only a container with self.prefix(src="", dst="Contents"): # everything goes in Contents # top-level Info.plist is as generated by CMake - Info_plist = "Info.plist" - ## This self.path() call reports 0 files... skip? - self.path(Info_plist) - Info_plist = self.dst_path_of(Info_plist) + Info_plist = self.dst_path_of("Info.plist") + # except we twiddle these entries + Info = plistlib.readPlist(Info_plist) + Info["CFBundleGetInfoString"] = self.channel() + Info["CFBundleShortVersionString"] = '.'.join(self.args['version']) + plistlib.writePlist(Info, Info_plist) # the one file in top-level MacOS directory is the trampoline to # our nested launcher_app @@ -1046,14 +1052,47 @@ open "%s" --args "$@" # now do it, only without relativizing paths os.rename(fromwhere, towhere) - # NOTE: the -S argument to strip causes it to keep - # enough info for annotated backtraces (i.e. function - # names in the crash log). 'strip' with no arguments - # yields a slightly smaller binary but makes crash - # logs mostly useless. This may be desirable for the - # final release. Or not. if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): + # only if we're engaging BugSplat + if "BUGSPLAT_DB" in os.environ: + # Create a symbol archive BEFORE stripping the + # binary. + self.run_command(['dsymutil', os.path.join(here, 'Second Life')]) + # This should produce a Second Life.dSYM bundle directory. + try: + # Now pretend we're Xcode making a .xcarchive file. + # Put it as a sibling of the top-level .app. + # From "Dave" at BugSplat support: + # "More from our Mac lead: I think zipping + # a folder containing the binary and + # symbols would be sufficient. Assuming + # symbol files are created with CMake. I'm + # not sure if CMake strips symbols into + # separate files at build time, and if so + # they're in a supported format." + xcarchive = os.path.join(parentdir, + 'Second Life.xcarchive.zip') + with zipfile.ZipFile(xcarchive, 'w', + compression=zipfile.ZIP_DEFLATED) as zf: + print "Creating {}".format(xcarchive) + for base, dirs, files in os.walk(here): + for fn in files: + fullfn = os.path.join(base, fn) + relfn = os.path.relpath(fullfn, here) + print " {}".format(relfn) + zf.write(fullfn, relfn) + finally: + # Whether or not we were able to create the + # .xcarchive file, clean up the .dSYM bundle + shutil.rmtree(os.path.join(here, 'Second Life.dSYM')) + + # NOTE: the -S argument to strip causes it to keep + # enough info for annotated backtraces (i.e. function + # names in the crash log). 'strip' with no arguments + # yields a slightly smaller binary but makes crash + # logs mostly useless. This may be desirable for the + # final release. Or not. self.run_command( ['strip', '-S', self.dst_path_of('Second Life')]) -- cgit v1.2.3 From 6cda0ecc964e4bcc989c97df7b4bc61b78e91592 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jun 2018 13:22:20 -0400 Subject: SL-821: Rename macOS Second Life executable to match the channel name. This requires fixing CFBundleExecutable as well. --- indra/newview/viewer_manifest.py | 90 +++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 38 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 8f2d04e9b8..4d6df04156 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1005,34 +1005,7 @@ open "%s" --args "$@" # -------------------- nested viewer_app --------------------- with self.prefix(dst=os.path.join(viewer_app, "Contents")): - # Info.plist is just like top-level one... - Info = plistlib.readPlist(Info_plist) - # except for these replacements: - # (CFBundleExecutable may be moot: SL_Launcher directly - # runs the executable, instead of launching the app) - Info["CFBundleExecutable"] = "Second Life" - Info["CFBundleIconFile"] = viewer_icon - try: - # https://www.bugsplat.com/docs/platforms/os-x#configuration - Info["BugsplatServerURL"] = \ - "https://{BUGSPLAT_DB}.bugsplatsoftware.com/".format(**os.environ) - except KeyError: - # skip the assignment if there's no BUGSPLAT_DB variable - pass - self.put_in_file( - plistlib.writePlistToString(Info), - os.path.basename(Info_plist), - "Info.plist") - - with self.prefix(src="", dst="Frameworks"): - # CEF framework goes inside viewer_app/Contents/Frameworks. - CEF_framework = "Chromium Embedded Framework.framework" - self.path2basename(relpkgdir, CEF_framework) - # Remember where we parked this car. - CEF_framework = self.dst_path_of(CEF_framework) - - self.path2basename(relpkgdir, "BugsplatMac.framework") - + # defer Info.plist until after MacOS with self.prefix(dst="MacOS"): # CMake constructs the Second Life executable in the # MacOS directory belonging to the top-level Second @@ -1040,25 +1013,39 @@ open "%s" --args "$@" here = self.get_dst_prefix() relbase = os.path.realpath(os.path.dirname(Info_plist)) self.cmakedirs(here) - for f in os.listdir(toplevel_MacOS): - if f == os.path.basename(trampoline): - # don't move the trampoline script we just made! - continue + # don't move the trampoline script we just made! + executables = [f for f in os.listdir(toplevel_MacOS) + if f != os.path.basename(trampoline)] + if not executables: + raise ManifestError("Couldn't find viewer executable in {}!" + .format(toplevel_MacOS)) + for f in executables: fromwhere = os.path.join(toplevel_MacOS, f) - towhere = os.path.join(here, f) + towhere = self.dst_path_of(f) print "Moving %s => %s" % \ (self.relpath(fromwhere, relbase), self.relpath(towhere, relbase)) # now do it, only without relativizing paths os.rename(fromwhere, towhere) + # Pick the biggest of the executables as the real viewer. + # Make (size, filename) pairs; sort by size; pick the + # last pair; take the filename entry from that. + SecondLife = sorted((os.path.getsize(self.dst_path_of(f)), f) + for f in executables)[-1][1] + # now rename it to match the channel name + exename = self.channel() + exepath = self.dst_path_of(exename) + print "{} => {}".format(SecondLife, exename) + os.rename(self.dst_path_of(SecondLife), exepath) + if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): # only if we're engaging BugSplat if "BUGSPLAT_DB" in os.environ: # Create a symbol archive BEFORE stripping the # binary. - self.run_command(['dsymutil', os.path.join(here, 'Second Life')]) + self.run_command(['dsymutil', exepath]) # This should produce a Second Life.dSYM bundle directory. try: # Now pretend we're Xcode making a .xcarchive file. @@ -1072,7 +1059,7 @@ open "%s" --args "$@" # separate files at build time, and if so # they're in a supported format." xcarchive = os.path.join(parentdir, - 'Second Life.xcarchive.zip') + exename + '.xcarchive.zip') with zipfile.ZipFile(xcarchive, 'w', compression=zipfile.ZIP_DEFLATED) as zf: print "Creating {}".format(xcarchive) @@ -1085,7 +1072,7 @@ open "%s" --args "$@" finally: # Whether or not we were able to create the # .xcarchive file, clean up the .dSYM bundle - shutil.rmtree(os.path.join(here, 'Second Life.dSYM')) + shutil.rmtree(self.dst_path_of(exename + '.dSYM')) # NOTE: the -S argument to strip causes it to keep # enough info for annotated backtraces (i.e. function @@ -1093,8 +1080,35 @@ open "%s" --args "$@" # yields a slightly smaller binary but makes crash # logs mostly useless. This may be desirable for the # final release. Or not. - self.run_command( - ['strip', '-S', self.dst_path_of('Second Life')]) + self.run_command(['strip', '-S', exepath]) + + # Info.plist is just like top-level one... + Info = plistlib.readPlist(Info_plist) + # except for these replacements: + # (CFBundleExecutable may be moot: SL_Launcher directly + # runs the executable, instead of launching the app) + Info["CFBundleExecutable"] = exename + Info["CFBundleIconFile"] = viewer_icon + try: + # https://www.bugsplat.com/docs/platforms/os-x#configuration + Info["BugsplatServerURL"] = \ + "https://{BUGSPLAT_DB}.bugsplatsoftware.com/".format(**os.environ) + except KeyError: + # skip the assignment if there's no BUGSPLAT_DB variable + pass + self.put_in_file( + plistlib.writePlistToString(Info), + os.path.basename(Info_plist), + "Info.plist") + + with self.prefix(src="", dst="Frameworks"): + # CEF framework goes inside viewer_app/Contents/Frameworks. + CEF_framework = "Chromium Embedded Framework.framework" + self.path2basename(relpkgdir, CEF_framework) + # Remember where we parked this car. + CEF_framework = self.dst_path_of(CEF_framework) + + self.path2basename(relpkgdir, "BugsplatMac.framework") with self.prefix(dst="Resources"): # defer cross-platform file copies until we're in the right -- cgit v1.2.3 From 1378547bb6a077fbed594ae7b92289dac5942183 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jun 2018 14:25:03 -0400 Subject: SL-821: Defend macOS packaging against multiple viewer_manifest runs --- indra/newview/viewer_manifest.py | 51 +++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4d6df04156..80370be109 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -27,6 +27,7 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA $/LicenseInfo$ """ import errno +import glob import json import os import os.path @@ -1016,28 +1017,34 @@ open "%s" --args "$@" # don't move the trampoline script we just made! executables = [f for f in os.listdir(toplevel_MacOS) if f != os.path.basename(trampoline)] - if not executables: - raise ManifestError("Couldn't find viewer executable in {}!" - .format(toplevel_MacOS)) - for f in executables: - fromwhere = os.path.join(toplevel_MacOS, f) - towhere = self.dst_path_of(f) - print "Moving %s => %s" % \ - (self.relpath(fromwhere, relbase), - self.relpath(towhere, relbase)) - # now do it, only without relativizing paths - os.rename(fromwhere, towhere) - - # Pick the biggest of the executables as the real viewer. - # Make (size, filename) pairs; sort by size; pick the - # last pair; take the filename entry from that. - SecondLife = sorted((os.path.getsize(self.dst_path_of(f)), f) - for f in executables)[-1][1] - # now rename it to match the channel name - exename = self.channel() - exepath = self.dst_path_of(exename) - print "{} => {}".format(SecondLife, exename) - os.rename(self.dst_path_of(SecondLife), exepath) + if executables: + # there are still executables in toplevel_MacOS + for f in executables: + fromwhere = os.path.join(toplevel_MacOS, f) + towhere = self.dst_path_of(f) + print "Moving %s => %s" % \ + (self.relpath(fromwhere, relbase), + self.relpath(towhere, relbase)) + # now do it, only without relativizing paths + os.rename(fromwhere, towhere) + + # Pick the biggest of the executables as the real viewer. + # Make (size, filename) pairs; sort by size; pick the + # last pair; take the filename entry from that. + SecondLife = sorted((os.path.getsize(self.dst_path_of(f)), f) + for f in executables)[-1][1] + # now rename it to match the channel name + exename = self.channel() + exepath = self.dst_path_of(exename) + print "{} => {}".format(SecondLife, exename) + os.rename(self.dst_path_of(SecondLife), exepath) + + else: + # executables already located 'here' -- pick the + # biggest, as above + exepath = sorted((os.path.getsize(f), f) + for f in glob.glob(os.path.join(here, '*')))[-1][1] + exename = os.path.basename(exepath) if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): -- cgit v1.2.3 From 67f6625c56406604197507c842496f031eb0986f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jun 2018 17:03:25 -0400 Subject: SL-821: Continue changing macOS executable to match channel name. Set our CMake 'product' variable to VIEWER_CHANNEL. This probably has far- reaching implications, but it seems the expedient way to keep everything self- consistent. Use ${product} in the DARWIN VIEWER_EXE_GLOBS used for Breakpad symbol dumping instead of hardcoding 'Second Life'. The Breakpad symbol dumping stanza was enclosed in nested (but not indented) conditions. To these we add another condition: don't bother if we're using BugSplat. Unify all three into a single horrendous outermost expression. Fix the MACOSX_BUNDLE_INFO_STRING, and hence CFBundleGetInfoString, to VIEWER_CHANNEL as well. Our CMake MACOSX_BUNDLE_SHORT_VERSION_STRING was never used before -- we were erroneously using MACOSX_BUNDLE_LONG_VERSION_STRING in the Info-SecondLife.plist template even for CFBundleShortVersionString. Looks like a classic copy/paste error. Fix that; also use four-part version number instead of three-part. With those two changes, we shouldn't need to patch the top-level Info.plist in viewer_manifest.py any more. viewer_manifest.py still needs to move the viewer executable(s) to the embedded viewer app bundle, but it no longer needs to rename the real executable to the channel name since we've already dealt with that in CMake land. This lets us unify the code that picks the biggest of those executables in the first and second viewer_manifest.py runs. --- indra/newview/CMakeLists.txt | 20 ++++++------- indra/newview/Info-SecondLife.plist | 2 +- indra/newview/viewer_manifest.py | 59 ++++++++++++++----------------------- 3 files changed, 33 insertions(+), 48 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index ba261c8e91..5648e3eb02 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2082,16 +2082,18 @@ if (LINUX) endif (LINUX) if (DARWIN) - # These all get set with PROPERTIES - set(product "Second Life") + # These all get set with PROPERTIES. It's not that the property names are + # magically known to CMake -- it's that these names are referenced in the + # Info-SecondLife.plist file in the configure_file() directive below. + set(product "${VIEWER_CHANNEL}") # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") - set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") @@ -2179,7 +2181,7 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -if (PACKAGE) +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT DEFINED ENV{BUGSPLAT_DB}) set(SYMBOL_SEARCH_DIRS "") # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh if (WINDOWS) @@ -2198,8 +2200,8 @@ if (PACKAGE) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") - set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) @@ -2211,7 +2213,6 @@ if (PACKAGE) set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) endif (LINUX) - if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) if(CMAKE_CFG_INTDIR STREQUAL ".") set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) else(CMAKE_CFG_INTDIR STREQUAL ".") @@ -2238,8 +2239,7 @@ if (PACKAGE) add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}") endif (WINDOWS OR LINUX) add_dependencies(llpackage generate_breakpad_symbols) - endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) -endif (PACKAGE) +endif () if (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index af4cf26ac6..8aabd6818b 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} CFBundleSignature ???? CFBundleVersion diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 80370be109..49dc732457 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -27,7 +27,6 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA $/LicenseInfo$ """ import errno -import glob import json import os import os.path @@ -920,11 +919,6 @@ class DarwinManifest(ViewerManifest): with self.prefix(src="", dst="Contents"): # everything goes in Contents # top-level Info.plist is as generated by CMake Info_plist = self.dst_path_of("Info.plist") - # except we twiddle these entries - Info = plistlib.readPlist(Info_plist) - Info["CFBundleGetInfoString"] = self.channel() - Info["CFBundleShortVersionString"] = '.'.join(self.args['version']) - plistlib.writePlist(Info, Info_plist) # the one file in top-level MacOS directory is the trampoline to # our nested launcher_app @@ -1014,37 +1008,28 @@ open "%s" --args "$@" here = self.get_dst_prefix() relbase = os.path.realpath(os.path.dirname(Info_plist)) self.cmakedirs(here) - # don't move the trampoline script we just made! - executables = [f for f in os.listdir(toplevel_MacOS) - if f != os.path.basename(trampoline)] - if executables: - # there are still executables in toplevel_MacOS - for f in executables: - fromwhere = os.path.join(toplevel_MacOS, f) - towhere = self.dst_path_of(f) - print "Moving %s => %s" % \ - (self.relpath(fromwhere, relbase), - self.relpath(towhere, relbase)) - # now do it, only without relativizing paths - os.rename(fromwhere, towhere) - - # Pick the biggest of the executables as the real viewer. - # Make (size, filename) pairs; sort by size; pick the - # last pair; take the filename entry from that. - SecondLife = sorted((os.path.getsize(self.dst_path_of(f)), f) - for f in executables)[-1][1] - # now rename it to match the channel name - exename = self.channel() - exepath = self.dst_path_of(exename) - print "{} => {}".format(SecondLife, exename) - os.rename(self.dst_path_of(SecondLife), exepath) - - else: - # executables already located 'here' -- pick the - # biggest, as above - exepath = sorted((os.path.getsize(f), f) - for f in glob.glob(os.path.join(here, '*')))[-1][1] - exename = os.path.basename(exepath) + for f in os.listdir(toplevel_MacOS): + if f == os.path.basename(trampoline): + # don't move the trampoline script we just made! + continue + fromwhere = os.path.join(toplevel_MacOS, f) + towhere = self.dst_path_of(f) + print "Moving %s => %s" % \ + (self.relpath(fromwhere, relbase), + self.relpath(towhere, relbase)) + # now do it, only without relativizing paths + os.rename(fromwhere, towhere) + + # Pick the biggest of the executables as the real viewer. + # Make (basename, fullpath) pairs; for each pair, + # expand to (size, basename, fullpath) triples; sort + # by size; pick the last triple; take the basename and + # fullpath from that. + _, exename, exepath = \ + sorted((os.path.getsize(path), name, path) + for name, path in + ((name, os.path.join(here, name)) + for name in os.listdir(here)))[-1] if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): -- cgit v1.2.3 From 9b7640d70ae820a954634ecf0dae43dfb33c0d3a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jun 2018 18:19:54 -0400 Subject: SL-821: Remove VSTool invocation to unbreak Windows TeamCity builds. --- indra/newview/CMakeLists.txt | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 23337ddbfb..f7b30007c9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1827,21 +1827,6 @@ if (WINDOWS) windows-crash-logger ) - # sets the 'working directory' for debugging from visual studio. - if (NOT UNATTENDED) - add_custom_command( - TARGET ${VIEWER_BINARY_NAME} POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe - ARGS - --solution - ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln - --workingdir - ${VIEWER_BINARY_NAME} - "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." - ) - endif (NOT UNATTENDED) - if (PACKAGE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 -- cgit v1.2.3 From 16776975e708f881c4e806c8b9a82f0f270636a7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jun 2018 18:25:17 -0400 Subject: SL-821: Merge removal of VSTool.exe invocation from CMake. --- indra/newview/CMakeLists.txt | 70 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f7b30007c9..ad65301d4d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -3,7 +3,12 @@ project(viewer) include(00-Common) +# DON'T move Linking.cmake to its place in the alphabetized list below: it +# sets variables on which the 3p .cmake files depend. +include(Linking) + include(Boost) +include(bugsplat) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) @@ -37,7 +42,6 @@ include(LLUI) include(LLVFS) include(LLWindow) include(LLXML) -include(Linking) include(NDOF) include(NVAPI) include(OPENAL) @@ -91,6 +95,7 @@ include_directories( ${LIBS_PREBUILT_DIR}/include/collada/1.4 ${LLAPPEARANCE_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} + ${BUGSPLAT_INCLUDE_DIR} ) include_directories(SYSTEM @@ -530,6 +535,7 @@ set(viewer_SOURCE_FILES llscriptfloater.cpp llscrollingpanelparam.cpp llscrollingpanelparambase.cpp + llsculptidsize.cpp llsearchcombobox.cpp llsearchhistory.cpp llsecapi.cpp @@ -1143,6 +1149,7 @@ set(viewer_HEADER_FILES llscriptruntimeperms.h llscrollingpanelparam.h llscrollingpanelparambase.h + llsculptidsize.h llsearchcombobox.h llsearchhistory.h llsecapi.h @@ -1354,6 +1361,14 @@ if (DARWIN) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) + set_source_files_properties( + llappdelegate-objc.mm + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + # BugsplatMac is a module, imported with @import. That language feature + # demands these switches. + COMPILE_FLAGS "-fmodules -fcxx-modules" + ) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1366,6 +1381,7 @@ if (DARWIN) ${AGL_LIBRARY} ${IOKIT_LIBRARY} ${COREAUDIO_LIBRARY} + ${BUGSPLAT_LIBRARIES} ) # Add resource files to the project. @@ -1393,6 +1409,11 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) + set_source_files_properties( + llappviewerlinux.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") @@ -1409,6 +1430,11 @@ if (WINDOWS) llappviewerwin32.cpp llwindebug.cpp ) + set_source_files_properties( + llappviewerwin32.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) list(APPEND viewer_HEADER_FILES llappviewerwin32.h @@ -1691,6 +1717,11 @@ if (SDL_FOUND) ) endif (SDL_FOUND) +if (DEFINED ENV{BUGSPLAT_DB}) + set_property(TARGET ${VIEWER_BINARY_NAME} + PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT") +endif (DEFINED ENV{BUGSPLAT_DB}) + # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) @@ -1789,7 +1820,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll ) endif (FMODEX) - + add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat COMMAND ${PYTHON_EXECUTABLE} @@ -1824,7 +1855,7 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin - windows-crash-logger + windows-crash-logger ) if (PACKAGE) @@ -1888,8 +1919,8 @@ else (WINDOWS) endif (WINDOWS) # *NOTE: - this list is very sensitive to ordering, test carefully on all -# platforms if you change the releative order of the entries here. -# In particular, cmake 2.6.4 (when buidling with linux/makefile generators) +# platforms if you change the relative order of the entries here. +# In particular, cmake 2.6.4 (when building with linux/makefile generators) # appears to sometimes de-duplicate redundantly listed dependencies improperly. # To work around this, higher level modules should be listed before the modules # that they depend upon. -brad @@ -1962,6 +1993,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLPHYSICS_LIBRARIES} ${LLPHYSICSEXTENSIONS_LIBRARIES} ${LLAPPEARANCE_LIBRARIES} + ${BUGSPLAT_LIBRARIES} ) set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH @@ -2037,25 +2069,35 @@ if (LINUX) endif (LINUX) if (DARWIN) - # These all get set with PROPERTIES - set(product "Second Life") + # These all get set with PROPERTIES. It's not that the property names are + # magically known to CMake -- it's that these names are referenced in the + # Info-SecondLife.plist file in the configure_file() directive below. + set(product "${VIEWER_CHANNEL}") # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") - set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + + # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ + set(CMAKE_MACOSX_RPATH 1) set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" + # From Contents/MacOS/SecondLife, look in Contents/Frameworks + INSTALL_RPATH "@loader_path/../Frameworks" + # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply + # does not work. Try this: + LINK_FLAGS "-rpath @loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) @@ -2126,7 +2168,7 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -if (PACKAGE) +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT DEFINED ENV{BUGSPLAT_DB}) set(SYMBOL_SEARCH_DIRS "") # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh if (WINDOWS) @@ -2145,8 +2187,8 @@ if (PACKAGE) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") - set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) @@ -2158,7 +2200,6 @@ if (PACKAGE) set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) endif (LINUX) - if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) if(CMAKE_CFG_INTDIR STREQUAL ".") set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) else(CMAKE_CFG_INTDIR STREQUAL ".") @@ -2185,8 +2226,7 @@ if (PACKAGE) add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}") endif (WINDOWS OR LINUX) add_dependencies(llpackage generate_breakpad_symbols) - endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) -endif (PACKAGE) +endif () if (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below -- cgit v1.2.3 From bb757b937c6cde205c59a80e83d8f970523edeeb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jun 2018 11:28:01 -0400 Subject: SL-820: gDirUtilp is never nullptr. It might point to an uninitialized LLDir, but that's a whole separate problem, one that wouldn't be detected by checking for nullptr. If we hit that, time to change to an LLSingleton. --- indra/newview/llappviewerwin32.cpp | 79 +++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 43 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 4701e7bbed..3efc94d7b5 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -565,61 +565,54 @@ bool LLAppViewerWin32::init() #else // LL_BUGSPLAT - if (! gDirUtilp) + std::string build_data_fname( + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); + std::ifstream inf(build_data_fname.c_str()); + if (! inf.is_open()) { - LL_WARNS() << "Can't initialize BugSplat, gDirUtilp not yet set" << LL_ENDL; + LL_WARNS() << "Can't initialize BugSplat, can't read '" << build_data_fname + << "'" << LL_ENDL; } else { - std::string build_data_fname( - gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); - std::ifstream inf(build_data_fname.c_str()); - if (! inf.is_open()) + Json::Reader reader; + Json::Value build_data; + if (! reader.parse(inf, build_data, false)) // don't collect comments { - LL_WARNS() << "Can't initialize BugSplat, can't read '" << build_data_fname - << "'" << LL_ENDL; + // gah, the typo is baked into their API + LL_WARNS() << "Can't initialize BugSplat, can't parse '" << build_data_fname + << "': " << reader.getFormatedErrorMessages() << LL_ENDL; } else { - Json::Reader reader; - Json::Value build_data; - if (! reader.parse(inf, build_data, false)) // don't collect comments + Json::Value BugSplat_DB = build_data["BugSplat DB"]; + if (! BugSplat_DB) { - // gah, the typo is baked into their API - LL_WARNS() << "Can't initialize BugSplat, can't parse '" << build_data_fname - << "': " << reader.getFormatedErrorMessages() << LL_ENDL; + LL_WARNS() << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" + << build_data_fname << "'" << LL_ENDL; } else { - Json::Value BugSplat_DB = build_data["BugSplat DB"]; - if (! BugSplat_DB) - { - LL_WARNS() << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" - << build_data_fname << "'" << LL_ENDL; - } - else - { - // Got BugSplat_DB, onward! - std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << - LL_VIEWER_VERSION_MINOR << '.' << - LL_VIEWER_VERSION_PATCH << '.' << - LL_VIEWER_VERSION_BUILD)); - - // have to convert normal wide strings to strings of __wchar_t - sBugSplatSender = new MiniDmpSender( - wunder(BugSplat_DB.asString()).c_str(), - wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), - wunder(version_string).c_str(), - nullptr); - sBugSplatSender->setCallback(bugsplatSendLog); - - // engage stringize() overload that converts from wstring - LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) - << stringize(version_string) << ')' << LL_ENDL; - } // got BugSplat_DB - } // parsed build_data.json - } // opened build_data.json - } // gDirUtilp set + // Got BugSplat_DB, onward! + std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << + LL_VIEWER_VERSION_MINOR << '.' << + LL_VIEWER_VERSION_PATCH << '.' << + LL_VIEWER_VERSION_BUILD)); + + // have to convert normal wide strings to strings of __wchar_t + sBugSplatSender = new MiniDmpSender( + wunder(BugSplat_DB.asString()).c_str(), + wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), + wunder(version_string).c_str(), + nullptr); + sBugSplatSender->setCallback(bugsplatSendLog); + + // engage stringize() overload that converts from wstring + LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) + << stringize(version_string) << ')' << LL_ENDL; + } // got BugSplat_DB + } // parsed build_data.json + } // opened build_data.json #endif // LL_BUGSPLAT #endif // LL_SEND_CRASH_REPORTS -- cgit v1.2.3 From f26ba0f0eccce2e6b66554dc1132ff29e6d0f3b1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jun 2018 11:45:03 -0400 Subject: SL-820: Make bugsplat.cmake and its symbols conditional. --- indra/newview/CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index ad65301d4d..d9c267324b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -8,7 +8,9 @@ include(00-Common) include(Linking) include(Boost) -include(bugsplat) +if (DEFINED ENV{BUGSPLAT_DB}) + include(bugsplat) +endif (DEFINED ENV{BUGSPLAT_DB}) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) @@ -95,8 +97,13 @@ include_directories( ${LIBS_PREBUILT_DIR}/include/collada/1.4 ${LLAPPEARANCE_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} + ) + +if (DEFINED ENV{BUGSPLAT_DB}) + include_directories( ${BUGSPLAT_INCLUDE_DIR} ) +endif (DEFINED ENV{BUGSPLAT_DB}) include_directories(SYSTEM ${LLCOMMON_SYSTEM_INCLUDE_DIRS} @@ -1381,9 +1388,14 @@ if (DARWIN) ${AGL_LIBRARY} ${IOKIT_LIBRARY} ${COREAUDIO_LIBRARY} - ${BUGSPLAT_LIBRARIES} ) + if (DEFINED ENV{BUGSPLAT_DB}) + list(APPEND viewer_LIBRARIES + ${BUGSPLAT_LIBRARIES} + ) + endif (DEFINED ENV{BUGSPLAT_DB}) + # Add resource files to the project. set(viewer_RESOURCE_FILES secondlife.icns @@ -1993,8 +2005,13 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLPHYSICS_LIBRARIES} ${LLPHYSICSEXTENSIONS_LIBRARIES} ${LLAPPEARANCE_LIBRARIES} + ) + +if (DEFINED ENV{BUGSPLAT_DB}) + target_link_libraries(${VIEWER_BINARY_NAME} ${BUGSPLAT_LIBRARIES} ) +endif (DEFINED ENV{BUGSPLAT_DB}) set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") -- cgit v1.2.3 From 448e82f39c472c82620bb52e0644e258b363d562 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jun 2018 16:48:20 -0400 Subject: SL-821: Try to add SecondLife.log file to Mac BugSplat crash report. Introduce new header file llappviewermacosx-for-objc.h to publish for llappdelegate-objc.mm and other Objective-C++ consumers the free functions in llappviewermacosx.cpp they consume. These were never before declared in any header file. Apparently, to date, we've been trusting to luck that Objective-C++ will infer the correct signature from calls -- and that the calls are correct with respect to the function definitions. :-P This gives us a place to introduce a new getLogFilePathname() function to query LLDir. (We don't simply #include "lldir.h" because of the pervasive use of BOOL in viewer headers; BOOL means something very different in Objective-C++.) --- indra/newview/llappdelegate-objc.mm | 17 +++++++++------ indra/newview/llappviewermacosx-for-objc.h | 34 ++++++++++++++++++++++++++++++ indra/newview/llappviewermacosx.cpp | 6 ++++++ 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 indra/newview/llappviewermacosx-for-objc.h (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 8e1ad169c9..ad5398721b 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -29,6 +29,7 @@ @import BugsplatMac; #endif #include "llwindowmacosx-objc.h" +#include "llappviewermacosx-for-objc.h" #include // Used for Text Input Services ("Safe" API - it's supported) @implementation LLAppDelegate @@ -189,18 +190,22 @@ return true; } -#if 0 // defined(LL_BUGSPLAT) +#if defined(LL_BUGSPLAT) @implementation BugsplatStartupManagerDelegate - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"example" withExtension:@"json"]; - NSData *data = [NSData dataWithContentsOfURL:fileURL]; - + std::string logfile = getLogFilePathname(); + NSString *ns_logfile = [NSString stringWithCString:logfile->c_str() + encoding:NSUTF8StringEncoding]; + NSData *data = [NSData dataWithContentsOfFile:ns_logfile]; + + // Apologies for the hard-coded log-file basename, but I do not know the + // incantation for "$(basename "$logfile")" in this language. BugsplatAttachment *attachment = - [[BugsplatAttachment alloc] initWithFilename:@"example.json" + [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log" attachmentData:data - contentType:@"application/json"]; + contentType:@"text/plain"]; return attachment; } diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h new file mode 100644 index 0000000000..ef5d90bfef --- /dev/null +++ b/indra/newview/llappviewermacosx-for-objc.h @@ -0,0 +1,34 @@ +/** + * @file llappviewermacosx-for-objc.h + * @author Nat Goodspeed + * @date 2018-06-15 + * @brief llappviewermacosx.h publishes the C++ API for + * llappviewermacosx.cpp, just as + * llappviewermacosx-objc.h publishes the Objective-C++ API for + * llappviewermacosx-objc.mm. + * + * This header is intended to publish for Objective-C++ consumers a + * subset of the C++ API presented by llappviewermacosx.cpp. It's a + * subset because, if an Objective-C++ consumer were to #include + * the full llappviewermacosx.h, we would almost surely run into + * trouble due to the discrepancy between Objective-C++'s BOOL versus + * classic Microsoft/Linden BOOL. + * + * $LicenseInfo:firstyear=2018&license=viewerlgpl$ + * Copyright (c) 2018, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) +#define LL_LLAPPVIEWERMACOSX_FOR_OBJC_H + +#include + +bool initViewer(); +void handleUrl(const char* url_utf8); +bool pumpMainLoop(); +void handleQuit(); +void cleanupViewer(); +std::string getLogFilePathname(); + +#endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */ diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index d472f8926b..cdbdb23d9a 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -36,6 +36,7 @@ #include "llappviewermacosx-objc.h" #include "llappviewermacosx.h" +#include "llappviewermacosx-for-objc.h" #include "llwindowmacosx-objc.h" #include "llcommandlineparser.h" @@ -147,6 +148,11 @@ void cleanupViewer() gViewerAppPtr = NULL; } +std::string getLogFilePathname() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"); +} + int main( int argc, char **argv ) { // Store off the command line args for use later. -- cgit v1.2.3 From 1d7687efb2bb8785b6a2a2f620d05fe1cb84f922 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jun 2018 17:58:00 -0400 Subject: SL-821: Fix up Objective-C++ syntax errors. --- indra/newview/llappdelegate-objc.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index ad5398721b..008203fd32 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -190,13 +190,15 @@ return true; } +@end + #if defined(LL_BUGSPLAT) @implementation BugsplatStartupManagerDelegate - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { std::string logfile = getLogFilePathname(); - NSString *ns_logfile = [NSString stringWithCString:logfile->c_str() + NSString *ns_logfile = [NSString stringWithCString:logfile.c_str() encoding:NSUTF8StringEncoding]; NSData *data = [NSData dataWithContentsOfFile:ns_logfile]; @@ -209,6 +211,6 @@ return attachment; } -#endif // LL_BUGSPLAT - @end + +#endif // LL_BUGSPLAT -- cgit v1.2.3 From b889c15cddccdfa5dd164388a566e4c63bbdf6f3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 18 Jun 2018 12:57:12 -0400 Subject: SL-821: Fix BugSplat attachment method override per BugSplat support. The example code on the BugSplat documentation page https://www.bugsplat.com/docs/platforms/os-x#configuration omits certain essential Objective-C++ boilerplate incantations. Adding them at least compiles successfully. --- indra/newview/llappdelegate-objc.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 008203fd32..11a4b5d48e 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -194,7 +194,11 @@ #if defined(LL_BUGSPLAT) -@implementation BugsplatStartupManagerDelegate +// per Geoff at BugSplat support +@interface AppDelegate : NSObject +@end + +@implementation AppDelegate - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { std::string logfile = getLogFilePathname(); -- cgit v1.2.3 From 6e790fc27d22e80527789cf8e783be6c90a23505 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 18 Jun 2018 16:38:49 -0400 Subject: SL-821: Add logging in the macOS BugSplat attachment override. --- indra/newview/llappdelegate-objc.mm | 4 ++++ indra/newview/llappviewermacosx-for-objc.h | 1 + indra/newview/llappviewermacosx.cpp | 5 +++++ 3 files changed, 10 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 11a4b5d48e..2c2302ecfb 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -202,9 +202,12 @@ - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { std::string logfile = getLogFilePathname(); + infos("Reached attachmentForBugsplatStartupManager with:"); + infos(logfile); NSString *ns_logfile = [NSString stringWithCString:logfile.c_str() encoding:NSUTF8StringEncoding]; NSData *data = [NSData dataWithContentsOfFile:ns_logfile]; + infos("Read logfile"); // Apologies for the hard-coded log-file basename, but I do not know the // incantation for "$(basename "$logfile")" in this language. @@ -212,6 +215,7 @@ [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log" attachmentData:data contentType:@"text/plain"]; + infos("returning attachment"); return attachment; } diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h index ef5d90bfef..e45cb85861 100644 --- a/indra/newview/llappviewermacosx-for-objc.h +++ b/indra/newview/llappviewermacosx-for-objc.h @@ -30,5 +30,6 @@ bool pumpMainLoop(); void handleQuit(); void cleanupViewer(); std::string getLogFilePathname(); +void infos(const std::string& message); #endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */ diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index cdbdb23d9a..562e7ebfde 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -153,6 +153,11 @@ std::string getLogFilePathname() return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"); } +void infos(const std::string& message) +{ + LL_INFOS() << message << LL_ENDL; +} + int main( int argc, char **argv ) { // Store off the command line args for use later. -- cgit v1.2.3 From c9898f1b69a53cd5d3e7bb49f77a764dde43772e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jun 2018 09:37:28 -0400 Subject: SL-821: Try again to override BugSplat Obj-C methods. --- indra/newview/llappdelegate-objc.mm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 2c2302ecfb..68b803c367 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -27,6 +27,9 @@ #import "llappdelegate-objc.h" #if defined(LL_BUGSPLAT) @import BugsplatMac; +// derived from BugsplatMac's BugsplatTester/AppDelegate.m +@interface LLAppDelegate () +@end #endif #include "llwindowmacosx-objc.h" #include "llappviewermacosx-for-objc.h" @@ -190,15 +193,14 @@ return true; } -@end - #if defined(LL_BUGSPLAT) -// per Geoff at BugSplat support -@interface AppDelegate : NSObject -@end - -@implementation AppDelegate +- (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager +{ +// return NSStringFromSelector(_cmd); + infos("Reached applicationLogForBugsplatStartupManager"); + return @"[contents of SecondLife.log]"; +} - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { std::string logfile = getLogFilePathname(); @@ -219,6 +221,6 @@ return attachment; } -@end - #endif // LL_BUGSPLAT + +@end -- cgit v1.2.3 From 3376b2acfbea2f6d2d8f79ecf890702e1ab60ae3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jun 2018 13:34:08 -0400 Subject: SL-821: Another Objective-C++ magic incantation from BugSplat support. --- indra/newview/llappdelegate-objc.mm | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 68b803c367..2ee294e1e6 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -76,6 +76,7 @@ // https://www.bugsplat.com/docs/platforms/os-x#initialization // [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; // [BugsplatStartupManager sharedManager].askUserDetails = NO; + [BugsplatStartupManager sharedManager].delegate = self; [[BugsplatStartupManager sharedManager] start]; #endif } -- cgit v1.2.3 From d26c931ae2c5d33adc5fc20842b7be838a2822b4 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jun 2018 15:08:56 -0400 Subject: SL-821: Send the SecondLife.log from the previous (crashed) run. Also clean up log messages. --- indra/newview/llappdelegate-objc.mm | 16 +++++++++++----- indra/newview/llappviewermacosx-for-objc.h | 2 +- indra/newview/llappviewermacosx.cpp | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 2ee294e1e6..4510f4070f 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -196,21 +196,27 @@ #if defined(LL_BUGSPLAT) +#if 0 +// Apparently this override method only contributes the User Description field +// of BugSplat's All Crashes table. Despite the method name, it would seem to +// be a bad place to try to stuff all of SecondLife.log. - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { // return NSStringFromSelector(_cmd); infos("Reached applicationLogForBugsplatStartupManager"); return @"[contents of SecondLife.log]"; } +#endif - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - std::string logfile = getLogFilePathname(); - infos("Reached attachmentForBugsplatStartupManager with:"); - infos(logfile); + // We get the *old* log file pathname (for SecondLife.old) because it's on + // the run *following* the crash that BugsplatStartupManager notices that + // the previous run crashed and calls this override. By that time, we've + // already renamed SecondLife.log to SecondLife.old. + std::string logfile = getOldLogFilePathname(); NSString *ns_logfile = [NSString stringWithCString:logfile.c_str() encoding:NSUTF8StringEncoding]; NSData *data = [NSData dataWithContentsOfFile:ns_logfile]; - infos("Read logfile"); // Apologies for the hard-coded log-file basename, but I do not know the // incantation for "$(basename "$logfile")" in this language. @@ -218,7 +224,7 @@ [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log" attachmentData:data contentType:@"text/plain"]; - infos("returning attachment"); + infos("attachmentForBugsplatStartupManager: attaching " + logfile); return attachment; } diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h index e45cb85861..c439297611 100644 --- a/indra/newview/llappviewermacosx-for-objc.h +++ b/indra/newview/llappviewermacosx-for-objc.h @@ -29,7 +29,7 @@ void handleUrl(const char* url_utf8); bool pumpMainLoop(); void handleQuit(); void cleanupViewer(); -std::string getLogFilePathname(); +std::string getOldLogFilePathname(); void infos(const std::string& message); #endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */ diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 562e7ebfde..d014e992f9 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -148,9 +148,9 @@ void cleanupViewer() gViewerAppPtr = NULL; } -std::string getLogFilePathname() +std::string getOldLogFilePathname() { - return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"); + return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.old"); } void infos(const std::string& message) -- cgit v1.2.3 From f6e7893a6e34190e8080d289a5f89d7f9c47d583 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 28 Jun 2018 12:39:42 -0400 Subject: MAINT-8797: Resurrect BugSplat crash reporting on Windows. The Breakpad symbol-file upload in the viewer's build.sh was failing on BugSplat builds since we weren't generating Breakpad symbol files. That upload was conditional on RELEASE_CRASH_REPORTING, so my first approach was to set RELEASE_CRASH_REPORTING=OFF for BugSplat builds. Unfortunately that symbol also propagates down into C++ compiles, and in llappviewerwin32.cpp, both Breakpad and BugSplat crash reporting is conditional on it. So that change inadvertently turned off the C++ logic to engage BugSplat. Stop forcing RELEASE_CRASH_REPORTING=OFF for BugSplat builds. Instead, make the Breakpad symbol-file upload check the BUGSPLAT_DB variable as well. Add #pragma messages to llappviewerwin32.cpp so we can detect whether it's being built for Breakpad or BugSplat or neither. --- indra/newview/llappviewerwin32.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 3efc94d7b5..247b94db3e 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -559,11 +559,13 @@ bool LLAppViewerWin32::init() #if LL_SEND_CRASH_REPORTS #if ! defined(LL_BUGSPLAT) +#pragma message("Building without BugSplat") LLAppViewer* pApp = LLAppViewer::instance(); pApp->initCrashReporting(); #else // LL_BUGSPLAT +#pragma message("Building with BugSplat") std::string build_data_fname( gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); @@ -579,7 +581,7 @@ bool LLAppViewerWin32::init() Json::Value build_data; if (! reader.parse(inf, build_data, false)) // don't collect comments { - // gah, the typo is baked into their API + // gah, the typo is baked into Json::Reader API LL_WARNS() << "Can't initialize BugSplat, can't parse '" << build_data_fname << "': " << reader.getFormatedErrorMessages() << LL_ENDL; } @@ -609,7 +611,7 @@ bool LLAppViewerWin32::init() // engage stringize() overload that converts from wstring LL_INFOS() << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) - << stringize(version_string) << ')' << LL_ENDL; + << ' ' << stringize(version_string) << ')' << LL_ENDL; } // got BugSplat_DB } // parsed build_data.json } // opened build_data.json -- cgit v1.2.3 From cd52724ef8f8a19ebe28c73f39a582b56fb58093 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 28 Jun 2018 21:49:07 -0400 Subject: DRTVWR-447: Suppress BugSplat UI; auto-fill certain BugSplat data. Direct BugSplat to send crash reports without prompting, on both Windows and Mac. Add a mechanism by which code called after LL_ERRS() can retrieve the fatal log message string. (How did the crash logger extract that for Linden crash logging?) Add that fatal message to crash reports on Windows. But as BugsplatMac is engaged only on the run _after_ the crash, we no longer have that message in memory. Also add user name and region location to Windows crash reports. On Mac, (a) we don't have the information from the previous run and (b) BugsplatMac doesn't provide an API to attach that information to the crash report. Add Mac logging to indicate the success or failure of sending the crash report. Add Windows logging to indicate we're about to send. --- indra/newview/llappdelegate-objc.mm | 34 +++++++++++++------ indra/newview/llappviewermacosx-for-objc.h | 2 ++ indra/newview/llappviewermacosx.cpp | 12 +++++++ indra/newview/llappviewerwin32.cpp | 53 +++++++++++++++++++++--------- 4 files changed, 76 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 4510f4070f..82e49540a4 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -74,9 +74,9 @@ #if defined(LL_BUGSPLAT) // https://www.bugsplat.com/docs/platforms/os-x#initialization -// [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; -// [BugsplatStartupManager sharedManager].askUserDetails = NO; - [BugsplatStartupManager sharedManager].delegate = self; + [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; + [BugsplatStartupManager sharedManager].askUserDetails = NO; + [BugsplatStartupManager sharedManager].delegate = self; [[BugsplatStartupManager sharedManager] start]; #endif } @@ -196,17 +196,20 @@ #if defined(LL_BUGSPLAT) -#if 0 -// Apparently this override method only contributes the User Description field -// of BugSplat's All Crashes table. Despite the method name, it would seem to -// be a bad place to try to stuff all of SecondLife.log. - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { -// return NSStringFromSelector(_cmd); infos("Reached applicationLogForBugsplatStartupManager"); - return @"[contents of SecondLife.log]"; + // Apparently this override method only contributes the User Description + // field of BugSplat's All Crashes table. Despite the method name, it + // would seem to be a bad place to try to stuff all of SecondLife.log. + return [NSString stringWithCString:getFatalMessage().c_str() + encoding:NSUTF8StringEncoding]; +} + +- (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugsplatStartupManager +{ + infos("Reached bugsplatStartupManagerWillSendCrashReport"); } -#endif - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { // We get the *old* log file pathname (for SecondLife.old) because it's on @@ -228,6 +231,17 @@ return attachment; } +- (void)bugsplatStartupManagerDidFinishSendingCrashReport:(BugsplatStartupManager *)bugsplatStartupManager +{ + infos("Sent crash report to BugSplat"); +} + +- (void)bugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager didFailWithError:(NSError *)error +{ + // TODO: message string from NSError + infos("Could not send crash report to BugSplat"); +} + #endif // LL_BUGSPLAT @end diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h index c439297611..ac85d7e8c3 100644 --- a/indra/newview/llappviewermacosx-for-objc.h +++ b/indra/newview/llappviewermacosx-for-objc.h @@ -30,6 +30,8 @@ bool pumpMainLoop(); void handleQuit(); void cleanupViewer(); std::string getOldLogFilePathname(); +std::string getFatalMessage(); +std::string getAgentFullname(); void infos(const std::string& message); #endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */ diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index d014e992f9..c3a3c3284a 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -45,6 +45,8 @@ #include "llmd5.h" #include "llfloaterworldmap.h" #include "llurldispatcher.h" +#include "llerrorcontrol.h" +#include "llvoavatarself.h" // for gAgentAvatarp->getFullname() #include #ifdef LL_CARBON_CRASH_HANDLER #include @@ -153,6 +155,16 @@ std::string getOldLogFilePathname() return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.old"); } +std::string getFatalMessage() +{ + return LLError::getFatalMessage(); +} + +std::string getAgentFullname() +{ + return gAgentAvatarp? gAgentAvatarp->getFullname() : std::string(); +} + void infos(const std::string& message) { LL_INFOS() << message << LL_ENDL; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 247b94db3e..1e135fa229 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -67,6 +67,7 @@ #include "stringize.h" #include "lldir.h" +#include "llerrorcontrol.h" #include #include @@ -74,7 +75,10 @@ // Bugsplat (http://bugsplat.com) crash reporting tool #ifdef LL_BUGSPLAT #include "BugSplat.h" -#include "reader.h" // JsonCpp +#include "reader.h" // JsonCpp +#include "llagent.h" // for agent location +#include "llviewerregion.h" +#include "llvoavatarself.h" // for agent name namespace { @@ -85,7 +89,8 @@ namespace // std::basic_string instance will survive until the function returns. // Calling c_str() on a std::basic_string local to wunder() would be // Undefined Behavior: we'd be left with a pointer into a destroyed - // std::basic_string instance. + // std::basic_string instance. But we can do that with a macro... + #define WCSTR(string) wunder(string).c_str() // It would be nice if, when wchar_t is the same as __wchar_t, this whole // function would optimize away. However, we use it only for the arguments @@ -111,19 +116,35 @@ namespace bool bugsplatSendLog(UINT nCode, LPVOID lpVal1, LPVOID lpVal2) { - // If we haven't yet initialized LLDir, don't bother trying to - // find our log file. - // Alternatively -- if we might encounter trouble trying to query - // LLDir during crash cleanup -- consider making gDirUtilp an - // LLPounceable, and attach a callback that stores the pathname to - // the log file here. - if (nCode == MDSCB_EXCEPTIONCODE && gDirUtilp) + if (nCode == MDSCB_EXCEPTIONCODE) { // send the main viewer log file // widen to wstring, convert to __wchar_t, then pass c_str() sBugSplatSender->sendAdditionalFile( - wunder(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log")).c_str()); - } + WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); + + if (gAgentAvatarp) + { + // user name, when we have it + sBugSplatSender->setDefaultUserName(WCSTR(gAgentAvatarp->getFullname())); + } + + // LL_ERRS message, when there is one + sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); + + if (gAgent.getRegion()) + { + // region location, when we have it + LLVector3 loc = gAgent.getPositionAgent(); + sBugSplatSender->resetAppIdentifier( + WCSTR(STRINGIZE(gAgent.getRegion()->getName() + << '/' << loc.mV[0] + << '/' << loc.mV[1] + << '/' << loc.mV[2]))); + } + + LL_INFOS() << "Sending crash report to BugSplat." << LL_ENDL; + } // MDSCB_EXCEPTIONCODE return false; } @@ -603,10 +624,12 @@ bool LLAppViewerWin32::init() // have to convert normal wide strings to strings of __wchar_t sBugSplatSender = new MiniDmpSender( - wunder(BugSplat_DB.asString()).c_str(), - wunder(LL_TO_WSTRING(LL_VIEWER_CHANNEL)).c_str(), - wunder(version_string).c_str(), - nullptr); + WCSTR(BugSplat_DB.asString()), + WCSTR(LL_TO_WSTRING(LL_VIEWER_CHANNEL)), + WCSTR(version_string), + nullptr, // szAppIdentifier -- set later + MDSF_NONINTERACTIVE | // automatically submit report without prompting + MDSF_PREVENTHIJACKING); // disallow swiping Exception filter sBugSplatSender->setCallback(bugsplatSendLog); // engage stringize() overload that converts from wstring -- cgit v1.2.3 From 93ea0d7026dcb7a9aec3bd4f8615eb62da159a02 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 29 Jun 2018 17:08:48 -0400 Subject: MAINT-8822: Revamp the LLManifest.prefix() calling convention. The way prefix("path_fragment") or prefix(src="path_fragment") has always worked is that unless you explicitly specify dst="", it adds "path_fragment" to the source AND dest prefix stacks! The most recent refactoring of viewer_manifest.py failed to copy CEF because it involved prefix(src="../some lengthy path fragment") -- forgetting to specify dst="" -- which added "../some lengthy path fragment" to the dest prefix stack -- which put it outside the viewer install staging area altogether. Having been bitten too many times by forgetting to add prefix(dst=""), we remove the necessity. The prefix() src=, build= and dst= prefix stacks are now completely independent. Add src_dst= keyword argument for when you DO want to add the same path fragment to both the source and dest prefix stacks. ("Explicit is better than implicit.") Change all existing calls accordingly. Now that the build prefix stack no longer tracks the src prefix stack, we were failing to pick up some things from the build area because NOBODY ever used build=, relying entirely on src= to point both to stuff in the source tree and stuff in the build tree. Try to use build= appropriately. If that proves too confusing, we might eliminate the separate build and artwork (!) prefix stacks entirely, requiring callers to reset the src stack explicitly when switching back and forth. --- indra/newview/viewer_manifest.py | 107 +++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 54 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 49dc732457..35cd7db161 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -64,7 +64,7 @@ class ViewerManifest(LLManifest): self.path(src="../../etc/message.xml", dst="app_settings/message.xml") if self.is_packaging_viewer(): - with self.prefix(src="app_settings"): + with self.prefix(src_dst="app_settings"): self.exclude("logcontrol.xml") self.exclude("logcontrol-dev.xml") self.path("*.ini") @@ -86,7 +86,7 @@ class ViewerManifest(LLManifest): # ... and the included spell checking dictionaries pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') - with self.prefix(src=pkgdir,dst=""): + with self.prefix(build=pkgdir): self.path("dictionaries") # include the extracted packages information (see BuildPackagesInfo.cmake) @@ -130,20 +130,20 @@ class ViewerManifest(LLManifest): src="environment") - with self.prefix(src="character"): + with self.prefix(src_dst="character"): self.path("*.llm") self.path("*.xml") self.path("*.tga") # Include our fonts - with self.prefix(src="fonts"): + with self.prefix(src_dst="fonts"): self.path("*.ttf") self.path("*.txt") # skins - with self.prefix(src="skins"): + with self.prefix(src_dst="skins"): # include the entire textures directory recursively - with self.prefix(src="*/textures"): + with self.prefix(src_dst="*/textures"): self.path("*/*.tga") self.path("*/*.j2c") self.path("*/*.jpg") @@ -171,7 +171,7 @@ class ViewerManifest(LLManifest): # local_assets dir (for pre-cached textures) - with self.prefix(src="local_assets"): + with self.prefix(src_dst="local_assets"): self.path("*.j2c") self.path("*.tga") @@ -494,19 +494,19 @@ 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()) - with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): + with self.prefix(build=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list self.path('SL_Launcher.exe') #IUM is not normally executed directly, just imported. No exe needed. self.path("InstallerUserMessage.py") - with self.prefix(src=self.icon_path(), dst="vmp_icons"): - self.path("secondlife.ico") - - #VMP Tkinter icons - with self.prefix("vmp_icons"): - self.path("*.png") - self.path("*.gif") + with self.prefix(dst="vmp_icons"): + with self.prefix(src=self.icon_path()): + self.path("secondlife.ico") + #VMP Tkinter icons + with self.prefix(src="vmp_icons"): + self.path("*.png") + self.path("*.gif") #before, we only needed llbase at build time. With VMP, we need it at run time. with self.prefix(src=os.path.join(pkgdir, "lib", "python", "llbase"), dst="llbase"): @@ -519,8 +519,7 @@ class WindowsManifest(ViewerManifest): "slplugin.exe") # Get shared libs from the shared libs staging directory - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']), - dst=""): + with self.prefix(build=os.path.join(os.pardir, 'sharedlibs', self.args['configuration'])): # Get llcommon and deps. If missing assume static linkage and continue. try: @@ -608,27 +607,27 @@ class WindowsManifest(ViewerManifest): self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") - with self.prefix(src=pkgdir,dst=""): + with self.prefix(build=pkgdir): self.path("ca-bundle.crt") # Media plugins - CEF with self.prefix(dst="llplugin"): - with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration']): + with self.prefix(build='../media_plugins/cef/%s' % self.args['configuration']): self.path("media_plugin_cef.dll") # Media plugins - LibVLC - with self.prefix(src='../media_plugins/libvlc/%s' % self.args['configuration']): + with self.prefix(build='../media_plugins/libvlc/%s' % self.args['configuration']): self.path("media_plugin_libvlc.dll") # Media plugins - Example (useful for debugging - not shipped with release viewer) if self.channel_type() != 'release': - with self.prefix(src='../media_plugins/example/%s' % self.args['configuration']): + with self.prefix(build='../media_plugins/example/%s' % self.args['configuration']): self.path("media_plugin_example.dll") # CEF runtime files - debug # CEF runtime files - not debug (release, relwithdebinfo etc.) config = 'debug' if self.args['configuration'].lower() == 'debug' else 'release' - with self.prefix(src=os.path.join(pkgdir, 'bin', config)): + with self.prefix(build=os.path.join(pkgdir, 'bin', config)): self.path("chrome_elf.dll") self.path("d3dcompiler_43.dll") self.path("d3dcompiler_47.dll") @@ -641,12 +640,12 @@ class WindowsManifest(ViewerManifest): self.path("widevinecdmadapter.dll") # MSVC DLLs needed for CEF and have to be in same directory as plugin - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release')): + with self.prefix(build=os.path.join(os.pardir, 'sharedlibs', 'Release')): self.path("msvcp120.dll") self.path("msvcr120.dll") # CEF files common to all configurations - with self.prefix(src=os.path.join(pkgdir, 'resources')): + with self.prefix(build=os.path.join(pkgdir, 'resources')): self.path("cef.pak") self.path("cef_100_percent.pak") self.path("cef_200_percent.pak") @@ -654,7 +653,7 @@ class WindowsManifest(ViewerManifest): self.path("devtools_resources.pak") self.path("icudtl.dat") - with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst='locales'): + with self.prefix(build=os.path.join(pkgdir, 'resources', 'locales'), dst='locales'): self.path("am.pak") self.path("ar.pak") self.path("bg.pak") @@ -709,7 +708,7 @@ class WindowsManifest(ViewerManifest): self.path("zh-CN.pak") self.path("zh-TW.pak") - with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): + with self.prefix(build=os.path.join(pkgdir, 'bin', 'release')): self.path("libvlc.dll") self.path("libvlccore.dll") self.path("plugins/") @@ -916,7 +915,7 @@ class DarwinManifest(ViewerManifest): # -------------------- top-level Second Life.app --------------------- # top-level Second Life application is only a container - with self.prefix(src="", dst="Contents"): # everything goes in Contents + with self.prefix(dst="Contents"): # everything goes in Contents # top-level Info.plist is as generated by CMake Info_plist = self.dst_path_of("Info.plist") @@ -945,10 +944,10 @@ open "%s" --args "$@" # rather than relsymlinkf(). self.symlinkf(os.path.join("Resources", viewer_app, "Contents", "Frameworks")) - with self.prefix(src="", dst="Resources"): + with self.prefix(dst="Resources"): # top-level Resources directory should be pretty sparse # need .icns file referenced by top-level Info.plist - with self.prefix(src=self.icon_path(), dst="") : + with self.prefix(src=self.icon_path()) : self.path(toplevel_icon) # ------------------- nested launcher_app -------------------- @@ -968,15 +967,15 @@ open "%s" --args "$@" #this copies over the python wrapper script, #associated utilities and required libraries, see #SL-321, SL-322, SL-323 - with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): + with self.prefix(build=os.path.join(pkgdir, "VMP")): self.path("SL_Launcher") self.path("*.py") # certifi will be imported by requests; this is # our custom version to get our ca-bundle.crt self.path("certifi") - with self.prefix(src=os.path.join(pkgdir, "lib", "python"), dst=""): + with self.prefix(build=os.path.join(pkgdir, "lib", "python")): # llbase provides our llrest service layer and llsd decoding - with self.prefix("llbase"): + with self.prefix(build="llbase", dst="llbase"): # (Why is llbase treated specially here? What # DON'T we want to copy out of lib/python/llbase?) self.path("*.py") @@ -989,12 +988,12 @@ open "%s" --args "$@" # launcher_app/Contents/Resources with self.prefix(dst="Resources"): - with self.prefix(src=self.icon_path(), dst="") : + with self.prefix(src=self.icon_path()) : self.path(launcher_icon) with self.prefix(dst="vmp_icons"): self.path("secondlife.ico") #VMP Tkinter icons - with self.prefix("vmp_icons"): + with self.prefix(src_dst="vmp_icons"): self.path("*.png") self.path("*.gif") @@ -1093,7 +1092,7 @@ open "%s" --args "$@" os.path.basename(Info_plist), "Info.plist") - with self.prefix(src="", dst="Frameworks"): + with self.prefix(dst="Frameworks"): # CEF framework goes inside viewer_app/Contents/Frameworks. CEF_framework = "Chromium Embedded Framework.framework" self.path2basename(relpkgdir, CEF_framework) @@ -1107,21 +1106,21 @@ open "%s" --args "$@" # nested Resources directory super(DarwinManifest, self).construct() - with self.prefix(src=self.icon_path(), dst="") : + with self.prefix(src=self.icon_path()) : self.path(viewer_icon) - with self.prefix(src=relpkgdir, dst=""): + with self.prefix(build=relpkgdir): self.path("libndofdev.dylib") self.path("libhunspell-1.3.0.dylib") - with self.prefix("cursors_mac"): + with self.prefix(src_dst="cursors_mac"): self.path("*.tif") self.path("licenses-mac.txt", dst="licenses.txt") self.path("featuretable_mac.txt") self.path("SecondLife.nib") - with self.prefix(src=pkgdir,dst=""): + with self.prefix(build=pkgdir): self.path("ca-bundle.crt") self.path("SecondLife.nib") @@ -1331,10 +1330,10 @@ open "%s" --args "$@" "media_plugin_libvlc.dylib") # copy LibVLC dynamic libraries - with self.prefix(src=relpkgdir, dst="lib"): + with self.prefix(build=relpkgdir, dst="lib"): self.path( "libvlc*.dylib*" ) # copy LibVLC plugins folder - with self.prefix(src='plugins', dst=""): + with self.prefix(build='plugins'): self.path( "*.dylib" ) self.path( "plugins.dat" ) @@ -1527,24 +1526,24 @@ class LinuxManifest(ViewerManifest): debpkgdir = os.path.join(pkgdir, "lib", "debug") self.path("licenses-linux.txt","licenses.txt") - with self.prefix("linux_tools", dst=""): + with self.prefix("linux_tools"): self.path("client-readme.txt","README-linux.txt") self.path("client-readme-voice.txt","README-linux-voice.txt") self.path("client-readme-joystick.txt","README-linux-joystick.txt") self.path("wrapper.sh","secondlife") - with self.prefix(src="", dst="etc"): + with self.prefix(dst="etc"): self.path("handle_secondlifeprotocol.sh") self.path("register_secondlifeprotocol.sh") self.path("refresh_desktop_app_entry.sh") self.path("launch_url.sh") self.path("install.sh") - with self.prefix(src="", dst="bin"): + with self.prefix(dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") self.path2basename("../llplugin/slplugin", "SLPlugin") #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 - with self.prefix(src="../viewer_components/manager", dst=""): + with self.prefix(src="../viewer_components/manager"): self.path("SL_Launcher") self.path("*.py") with self.prefix(src=os.path.join("lib", "python", "llbase"), dst="llbase"): @@ -1557,22 +1556,22 @@ class LinuxManifest(ViewerManifest): # Get the icons based on the channel type icon_path = self.icon_path() print "DEBUG: icon_path '%s'" % icon_path - with self.prefix(src=icon_path, dst="") : + with self.prefix(src=icon_path) : self.path("secondlife_256.png","secondlife_icon.png") - with self.prefix(src="",dst="res-sdl") : + with self.prefix(dst="res-sdl") : self.path("secondlife_256.BMP","ll_icon.BMP") # plugins - with self.prefix(src="../media_plugins", dst="bin/llplugin"): + with self.prefix(build="../media_plugins", dst="bin/llplugin"): self.path("gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") self.path2basename("libvlc", "libmedia_plugin_libvlc.so") - with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"): + with self.prefix(build=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"): self.path( "plugins.dat" ) self.path( "*/*.so" ) - with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"): + with self.prefix(build=os.path.join(pkgdir, 'lib' ), dst="lib"): self.path( "libvlc*.so*" ) # llcommon @@ -1581,7 +1580,7 @@ class LinuxManifest(ViewerManifest): self.path("featuretable_linux.txt") - with self.prefix(src=pkgdir,dst=""): + with self.prefix(build=pkgdir): self.path("ca-bundle.crt") def package_finish(self): @@ -1637,7 +1636,7 @@ class Linux_i686_Manifest(LinuxManifest): relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") - with self.prefix(relpkgdir, dst="lib"): + with self.prefix(build=relpkgdir, dst="lib"): self.path("libapr-1.so") self.path("libapr-1.so.0") self.path("libapr-1.so.0.4.5") @@ -1699,9 +1698,9 @@ class Linux_i686_Manifest(LinuxManifest): # Vivox runtimes - with self.prefix(src=relpkgdir, dst="bin"): + with self.prefix(build=relpkgdir, dst="bin"): self.path("SLVoice") - with self.prefix(src=relpkgdir, dst="lib"): + with self.prefix(build=relpkgdir, dst="lib"): self.path("libortp.so") self.path("libsndfile.so.1") #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib -- cgit v1.2.3 From 3e66dc9f193e4641041dd9ac4da1cf7ff7440ec0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 30 Jun 2018 10:08:35 -0400 Subject: MAINT-8822: Revert viewer_manifest to using src= instead of build=. Turns out that having multiple (source, build, artwork) prefix stacks isn't such a good idea after all. Many of our LLManifest.path() directives use wildcards -- and if _any files_ match the specified wildcard from a prefix stack other than what you had in mind, viewer_manifest will silently, cheerfully do the Wrong Thing. There is a good reason why all existing LLManifest.prefix() calls exclusively used src= and/or dst= instead of build=. --- indra/newview/viewer_manifest.py | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 35cd7db161..e1374b0518 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -86,7 +86,7 @@ class ViewerManifest(LLManifest): # ... and the included spell checking dictionaries pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') - with self.prefix(build=pkgdir): + with self.prefix(src=pkgdir): self.path("dictionaries") # include the extracted packages information (see BuildPackagesInfo.cmake) @@ -494,7 +494,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()) - with self.prefix(build=os.path.join(pkgdir, "VMP")): + with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list self.path('SL_Launcher.exe') #IUM is not normally executed directly, just imported. No exe needed. @@ -519,7 +519,7 @@ class WindowsManifest(ViewerManifest): "slplugin.exe") # Get shared libs from the shared libs staging directory - with self.prefix(build=os.path.join(os.pardir, 'sharedlibs', self.args['configuration'])): + with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration'])): # Get llcommon and deps. If missing assume static linkage and continue. try: @@ -607,27 +607,27 @@ class WindowsManifest(ViewerManifest): self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") - with self.prefix(build=pkgdir): + with self.prefix(src=pkgdir): self.path("ca-bundle.crt") # Media plugins - CEF with self.prefix(dst="llplugin"): - with self.prefix(build='../media_plugins/cef/%s' % self.args['configuration']): + with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration']): self.path("media_plugin_cef.dll") # Media plugins - LibVLC - with self.prefix(build='../media_plugins/libvlc/%s' % self.args['configuration']): + with self.prefix(src='../media_plugins/libvlc/%s' % self.args['configuration']): self.path("media_plugin_libvlc.dll") # Media plugins - Example (useful for debugging - not shipped with release viewer) if self.channel_type() != 'release': - with self.prefix(build='../media_plugins/example/%s' % self.args['configuration']): + with self.prefix(src='../media_plugins/example/%s' % self.args['configuration']): self.path("media_plugin_example.dll") # CEF runtime files - debug # CEF runtime files - not debug (release, relwithdebinfo etc.) config = 'debug' if self.args['configuration'].lower() == 'debug' else 'release' - with self.prefix(build=os.path.join(pkgdir, 'bin', config)): + with self.prefix(src=os.path.join(pkgdir, 'bin', config)): self.path("chrome_elf.dll") self.path("d3dcompiler_43.dll") self.path("d3dcompiler_47.dll") @@ -640,12 +640,12 @@ class WindowsManifest(ViewerManifest): self.path("widevinecdmadapter.dll") # MSVC DLLs needed for CEF and have to be in same directory as plugin - with self.prefix(build=os.path.join(os.pardir, 'sharedlibs', 'Release')): + with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release')): self.path("msvcp120.dll") self.path("msvcr120.dll") # CEF files common to all configurations - with self.prefix(build=os.path.join(pkgdir, 'resources')): + with self.prefix(src=os.path.join(pkgdir, 'resources')): self.path("cef.pak") self.path("cef_100_percent.pak") self.path("cef_200_percent.pak") @@ -653,7 +653,7 @@ class WindowsManifest(ViewerManifest): self.path("devtools_resources.pak") self.path("icudtl.dat") - with self.prefix(build=os.path.join(pkgdir, 'resources', 'locales'), dst='locales'): + with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst='locales'): self.path("am.pak") self.path("ar.pak") self.path("bg.pak") @@ -708,7 +708,7 @@ class WindowsManifest(ViewerManifest): self.path("zh-CN.pak") self.path("zh-TW.pak") - with self.prefix(build=os.path.join(pkgdir, 'bin', 'release')): + with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): self.path("libvlc.dll") self.path("libvlccore.dll") self.path("plugins/") @@ -967,15 +967,15 @@ open "%s" --args "$@" #this copies over the python wrapper script, #associated utilities and required libraries, see #SL-321, SL-322, SL-323 - with self.prefix(build=os.path.join(pkgdir, "VMP")): + with self.prefix(src=os.path.join(pkgdir, "VMP")): self.path("SL_Launcher") self.path("*.py") # certifi will be imported by requests; this is # our custom version to get our ca-bundle.crt self.path("certifi") - with self.prefix(build=os.path.join(pkgdir, "lib", "python")): + with self.prefix(src=os.path.join(pkgdir, "lib", "python")): # llbase provides our llrest service layer and llsd decoding - with self.prefix(build="llbase", dst="llbase"): + with self.prefix(src="llbase", dst="llbase"): # (Why is llbase treated specially here? What # DON'T we want to copy out of lib/python/llbase?) self.path("*.py") @@ -1109,7 +1109,7 @@ open "%s" --args "$@" with self.prefix(src=self.icon_path()) : self.path(viewer_icon) - with self.prefix(build=relpkgdir): + with self.prefix(src=relpkgdir): self.path("libndofdev.dylib") self.path("libhunspell-1.3.0.dylib") @@ -1120,7 +1120,7 @@ open "%s" --args "$@" self.path("featuretable_mac.txt") self.path("SecondLife.nib") - with self.prefix(build=pkgdir): + with self.prefix(src=pkgdir): self.path("ca-bundle.crt") self.path("SecondLife.nib") @@ -1330,10 +1330,10 @@ open "%s" --args "$@" "media_plugin_libvlc.dylib") # copy LibVLC dynamic libraries - with self.prefix(build=relpkgdir, dst="lib"): + with self.prefix(src=relpkgdir, dst="lib"): self.path( "libvlc*.dylib*" ) # copy LibVLC plugins folder - with self.prefix(build='plugins'): + with self.prefix(src='plugins'): self.path( "*.dylib" ) self.path( "plugins.dat" ) @@ -1562,16 +1562,16 @@ class LinuxManifest(ViewerManifest): self.path("secondlife_256.BMP","ll_icon.BMP") # plugins - with self.prefix(build="../media_plugins", dst="bin/llplugin"): + with self.prefix(src="../media_plugins", dst="bin/llplugin"): self.path("gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") self.path2basename("libvlc", "libmedia_plugin_libvlc.so") - with self.prefix(build=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"): + with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"): self.path( "plugins.dat" ) self.path( "*/*.so" ) - with self.prefix(build=os.path.join(pkgdir, 'lib' ), dst="lib"): + with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"): self.path( "libvlc*.so*" ) # llcommon @@ -1580,7 +1580,7 @@ class LinuxManifest(ViewerManifest): self.path("featuretable_linux.txt") - with self.prefix(build=pkgdir): + with self.prefix(src=pkgdir): self.path("ca-bundle.crt") def package_finish(self): @@ -1636,7 +1636,7 @@ class Linux_i686_Manifest(LinuxManifest): relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") - with self.prefix(build=relpkgdir, dst="lib"): + with self.prefix(src=relpkgdir, dst="lib"): self.path("libapr-1.so") self.path("libapr-1.so.0") self.path("libapr-1.so.0.4.5") @@ -1698,9 +1698,9 @@ class Linux_i686_Manifest(LinuxManifest): # Vivox runtimes - with self.prefix(build=relpkgdir, dst="bin"): + with self.prefix(src=relpkgdir, dst="bin"): self.path("SLVoice") - with self.prefix(build=relpkgdir, dst="lib"): + with self.prefix(src=relpkgdir, dst="lib"): self.path("libortp.so") self.path("libsndfile.so.1") #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib -- cgit v1.2.3 From 07d7e48f4157929b607c4183929aa02b8391444c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 10 Jul 2018 14:01:19 -0400 Subject: DRTVWR-447: Use absolute path prefixes for CEF components. viewer_manifest.py had LLManifest.prefix() calls starting with '..' (or os.pardir, same thing) which failed with new prefix() calling conventions. Explicitly starting with os.path.join(self.args['build'], os.pardir, etc.) where applicable works much better. --- indra/newview/viewer_manifest.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e1374b0518..ad6ba3ddff 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -221,8 +221,7 @@ class ViewerManifest(LLManifest): return self.channel().replace(CHANNEL_VENDOR_BASE, "").strip() def channel_type(self): # returns 'release', 'beta', 'project', or 'test' - global CHANNEL_VENDOR_BASE - channel_qualifier=self.channel().replace(CHANNEL_VENDOR_BASE, "").lower().strip() + channel_qualifier=self.channel_variant().lower() if channel_qualifier.startswith('release'): channel_type='release' elif channel_qualifier.startswith('beta'): @@ -519,7 +518,8 @@ class WindowsManifest(ViewerManifest): "slplugin.exe") # Get shared libs from the shared libs staging directory - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration'])): + with self.prefix(src=os.path.join(self.args['build'], os.pardir, + 'sharedlibs', self.args['configuration'])): # Get llcommon and deps. If missing assume static linkage and continue. try: @@ -612,17 +612,18 @@ class WindowsManifest(ViewerManifest): # Media plugins - CEF with self.prefix(dst="llplugin"): - with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration']): - self.path("media_plugin_cef.dll") + with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins')): + with self.prefix(src=os.path.join('cef', self.args['configuration'])): + self.path("media_plugin_cef.dll") - # Media plugins - LibVLC - with self.prefix(src='../media_plugins/libvlc/%s' % self.args['configuration']): - self.path("media_plugin_libvlc.dll") + # Media plugins - LibVLC + with self.prefix(src=os.path.join('libvlc', self.args['configuration'])): + self.path("media_plugin_libvlc.dll") - # Media plugins - Example (useful for debugging - not shipped with release viewer) - if self.channel_type() != 'release': - with self.prefix(src='../media_plugins/example/%s' % self.args['configuration']): - self.path("media_plugin_example.dll") + # Media plugins - Example (useful for debugging - not shipped with release viewer) + if self.channel_type() != 'release': + with self.prefix(src=os.path.join('example', self.args['configuration'])): + self.path("media_plugin_example.dll") # CEF runtime files - debug # CEF runtime files - not debug (release, relwithdebinfo etc.) @@ -640,7 +641,8 @@ class WindowsManifest(ViewerManifest): self.path("widevinecdmadapter.dll") # MSVC DLLs needed for CEF and have to be in same directory as plugin - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release')): + with self.prefix(src=os.path.join(self.args['build'], os.pardir, + 'sharedlibs', 'Release')): self.path("msvcp120.dll") self.path("msvcr120.dll") -- cgit v1.2.3 From 62eecd87a5610aae41cff6dc6ebcc81e7bcb474f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 10 Jul 2018 17:47:00 -0400 Subject: SL-932: Attach user's settings.xml file to Windows crash reports. It is not obvious whether the BugsplatMac attachment API even supports multiple file attachments. I've contacted BugSplat support. --- indra/newview/llappviewerwin32.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 1e135fa229..adb3a2bbe2 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -123,6 +123,9 @@ namespace sBugSplatSender->sendAdditionalFile( WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); + sBugSplatSender->sendAdditionalFile( + WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); + if (gAgentAvatarp) { // user name, when we have it -- cgit v1.2.3 From 66d083967ec25b5c46424689624b2aa366a2ae6b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 11 Jul 2018 16:01:48 -0400 Subject: DRTVWR-447: Add more diagnostic logging to Windows BugSplat crash. --- indra/newview/llappviewerwin32.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index adb3a2bbe2..5c7cb5b9c6 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -116,24 +116,38 @@ namespace bool bugsplatSendLog(UINT nCode, LPVOID lpVal1, LPVOID lpVal2) { + // When BugSplat intercepts a crash, logging seems to stop?! + // Maybe because our test crashes use LL_ERROR(). Try writing a + // special log file "by hand." + std::ofstream log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "BugSplat.log"), + std::ios_base::app); + log << "Entered bugsplatSendLog() callback\n"; if (nCode == MDSCB_EXCEPTIONCODE) { // send the main viewer log file // widen to wstring, convert to __wchar_t, then pass c_str() sBugSplatSender->sendAdditionalFile( WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); + log << "Attached " << gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log") << '\n'; sBugSplatSender->sendAdditionalFile( WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); + log << "Attached " << gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml") << '\n'; if (gAgentAvatarp) { // user name, when we have it sBugSplatSender->setDefaultUserName(WCSTR(gAgentAvatarp->getFullname())); + log << "Set default user name to '" << gAgentAvatarp->getFullname() << "'\n"; + } + else + { + log << "gAgentAvatarp is nullptr\n"; } // LL_ERRS message, when there is one sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); + log << "Set default user description to '" << LLError::getFatalMessage() << "'\n"; if (gAgent.getRegion()) { @@ -144,10 +158,25 @@ namespace << '/' << loc.mV[0] << '/' << loc.mV[1] << '/' << loc.mV[2]))); + log << "Set app identifier to '" + << gAgent.getRegion()->getName() + << '/' << loc.mV[0] + << '/' << loc.mV[1] + << '/' << log.mV[2] + << "'\n"; + } + else + { + log "gAgent.getRegion() is nullptr\n"; } LL_INFOS() << "Sending crash report to BugSplat." << LL_ENDL; + log << "Sending crash report to BugSplat.\n"; } // MDSCB_EXCEPTIONCODE + else + { + log << "nCode != MDSCB_EXCEPTIONCODE\n"; + } return false; } -- cgit v1.2.3 From 869d2f1fb2ed59e65dd9cb8b75a9ea560dbeab2d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 11 Jul 2018 18:26:27 -0400 Subject: DRTVWR-447: Fix silly typos --- indra/newview/llappviewerwin32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 5c7cb5b9c6..43b25699ca 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -162,12 +162,12 @@ namespace << gAgent.getRegion()->getName() << '/' << loc.mV[0] << '/' << loc.mV[1] - << '/' << log.mV[2] + << '/' << loc.mV[2] << "'\n"; } else { - log "gAgent.getRegion() is nullptr\n"; + log << "gAgent.getRegion() is nullptr\n"; } LL_INFOS() << "Sending crash report to BugSplat." << LL_ENDL; -- cgit v1.2.3 From c7616af624f784e6226f530f6a21b3541ba730cc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 11 Jul 2018 21:52:03 -0400 Subject: DRTVWR-447: Diagnostically try naively widening BugSplat metadata. --- indra/newview/llappviewerwin32.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 43b25699ca..b78d6bdc62 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -104,7 +104,11 @@ namespace // specific wstringize() overload inline std::basic_string<__wchar_t> wunder(const std::string& str) { - return wunder(wstringize(str)); +// return wunder(wstringize(str)); + // Is wstringize(const std::string&) doing the right thing? Try + // widening each character individually -- which works only for 8-bit + // characters, of course -- just diagnostically. + return { str.begin(), str.end() }; } // Irritatingly, MiniDmpSender::setCallback() is defined to accept a -- cgit v1.2.3 From b883ffaa750630ce15bd133c3ddd1f39896fee02 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 12 Jul 2018 14:45:14 -0400 Subject: DRTVWR-447: More diagnostic logging for BugSplat metadata strings. --- indra/newview/llappviewerwin32.cpp | 55 ++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index b78d6bdc62..43a61c3857 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -70,6 +70,7 @@ #include "llerrorcontrol.h" #include +#include #include // Bugsplat (http://bugsplat.com) crash reporting tool @@ -111,6 +112,38 @@ namespace return { str.begin(), str.end() }; } + // can only be used in a context in which 'log' is a valid std::ostream + #define WVCSTR(string) wview(log, WCSTR(string)) + + const __wchar_t* wview(std::ostream& out, const __wchar_t* wstr) + { + const size_t maxlen = 50; + char buffer[maxlen]; + size_t size; + // Classic-C loop to calculate size; also forcibly narrow each + // __wchar_t to plain char into 'buffer'. + for (size = 0; size < (maxlen - 1) && wstr[size]; ++size) + buffer[size] = char(wstr[size]); + buffer[size] = '\0'; + // Log the length, show the plain chars + out << "(length " << size << ") '" << buffer << "' "; + // Now dump the memory pointed to by wstr as raw bytes. + char oldfill = out.fill(); + out << std::hex << std::setfill('0') << std::setw(2); + unsigned char* bytes = reinterpret_cast(wstr); + // Increment by one __wchar_t so we display the final nul character; + // remember to multiply by the number of bytes in a __wchar_t. + for (size_t b = 0; b < ((size + 1) * sizeof(__wchar_t)); ++b) + { + // To display as hex, need to convert each byte to int -- if we engage + // the operator<<(ostream&, char) overload, we'll just get characters. + out << int(bytes[b]); + } + out << std::dec << std::setfill(oldfill) << std::setw(0); + out << '\n'; + return wstr; + } + // Irritatingly, MiniDmpSender::setCallback() is defined to accept a // classic-C function pointer instead of an arbitrary C++ callable. If it // did accept a modern callable, we could pass a lambda that binds our @@ -131,18 +164,18 @@ namespace // send the main viewer log file // widen to wstring, convert to __wchar_t, then pass c_str() sBugSplatSender->sendAdditionalFile( - WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); - log << "Attached " << gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log") << '\n'; + WVCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); + log << "sendAdditionalFile('" << gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log") << "')\n"; sBugSplatSender->sendAdditionalFile( - WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); - log << "Attached " << gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml") << '\n'; + WVCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); + log << "sendAdditionalFile('" << gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml") << "')\n"; if (gAgentAvatarp) { // user name, when we have it - sBugSplatSender->setDefaultUserName(WCSTR(gAgentAvatarp->getFullname())); - log << "Set default user name to '" << gAgentAvatarp->getFullname() << "'\n"; + sBugSplatSender->setDefaultUserName(WVCSTR(gAgentAvatarp->getFullname())); + log << "setDefaultUserName('" << gAgentAvatarp->getFullname() << "')\n"; } else { @@ -150,24 +183,24 @@ namespace } // LL_ERRS message, when there is one - sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); - log << "Set default user description to '" << LLError::getFatalMessage() << "'\n"; + sBugSplatSender->setDefaultUserDescription(WVCSTR(LLError::getFatalMessage())); + log << "setDefaultUserDescription('" << LLError::getFatalMessage() << "')\n"; if (gAgent.getRegion()) { // region location, when we have it LLVector3 loc = gAgent.getPositionAgent(); sBugSplatSender->resetAppIdentifier( - WCSTR(STRINGIZE(gAgent.getRegion()->getName() + WVCSTR(STRINGIZE(gAgent.getRegion()->getName() << '/' << loc.mV[0] << '/' << loc.mV[1] << '/' << loc.mV[2]))); - log << "Set app identifier to '" + log << "resetAppIdentifier('" << gAgent.getRegion()->getName() << '/' << loc.mV[0] << '/' << loc.mV[1] << '/' << loc.mV[2] - << "'\n"; + << "')\n"; } else { -- cgit v1.2.3 From 3888d1862a79ab927d118087b2ce662f15e27f41 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 12 Jul 2018 16:07:06 -0400 Subject: DRTVWR-447: For want of a 'const', the build was lost. --- indra/newview/llappviewerwin32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 43a61c3857..d2854c6b47 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -130,7 +130,7 @@ namespace // Now dump the memory pointed to by wstr as raw bytes. char oldfill = out.fill(); out << std::hex << std::setfill('0') << std::setw(2); - unsigned char* bytes = reinterpret_cast(wstr); + const unsigned char* bytes = reinterpret_cast(wstr); // Increment by one __wchar_t so we display the final nul character; // remember to multiply by the number of bytes in a __wchar_t. for (size_t b = 0; b < ((size + 1) * sizeof(__wchar_t)); ++b) -- cgit v1.2.3 From 234ca77f19e53de1c02f8a641530ba89c90f1298 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 14 Jul 2018 08:52:58 -0400 Subject: DRTVWR-447: Revert BugSplat diagnostic logging; add platform tag. --- indra/newview/llappviewerwin32.cpp | 86 +++++--------------------------------- 1 file changed, 11 insertions(+), 75 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d2854c6b47..adb340d40e 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -70,7 +70,6 @@ #include "llerrorcontrol.h" #include -#include #include // Bugsplat (http://bugsplat.com) crash reporting tool @@ -95,7 +94,7 @@ namespace // It would be nice if, when wchar_t is the same as __wchar_t, this whole // function would optimize away. However, we use it only for the arguments - // to make exactly one call to initialize BugSplat. + // to the BugSplat API -- a handful of calls. inline std::basic_string<__wchar_t> wunder(const std::wstring& str) { return { str.begin(), str.end() }; @@ -105,43 +104,7 @@ namespace // specific wstringize() overload inline std::basic_string<__wchar_t> wunder(const std::string& str) { -// return wunder(wstringize(str)); - // Is wstringize(const std::string&) doing the right thing? Try - // widening each character individually -- which works only for 8-bit - // characters, of course -- just diagnostically. - return { str.begin(), str.end() }; - } - - // can only be used in a context in which 'log' is a valid std::ostream - #define WVCSTR(string) wview(log, WCSTR(string)) - - const __wchar_t* wview(std::ostream& out, const __wchar_t* wstr) - { - const size_t maxlen = 50; - char buffer[maxlen]; - size_t size; - // Classic-C loop to calculate size; also forcibly narrow each - // __wchar_t to plain char into 'buffer'. - for (size = 0; size < (maxlen - 1) && wstr[size]; ++size) - buffer[size] = char(wstr[size]); - buffer[size] = '\0'; - // Log the length, show the plain chars - out << "(length " << size << ") '" << buffer << "' "; - // Now dump the memory pointed to by wstr as raw bytes. - char oldfill = out.fill(); - out << std::hex << std::setfill('0') << std::setw(2); - const unsigned char* bytes = reinterpret_cast(wstr); - // Increment by one __wchar_t so we display the final nul character; - // remember to multiply by the number of bytes in a __wchar_t. - for (size_t b = 0; b < ((size + 1) * sizeof(__wchar_t)); ++b) - { - // To display as hex, need to convert each byte to int -- if we engage - // the operator<<(ostream&, char) overload, we'll just get characters. - out << int(bytes[b]); - } - out << std::dec << std::setfill(oldfill) << std::setw(0); - out << '\n'; - return wstr; + return wunder(wstringize(str)); } // Irritatingly, MiniDmpSender::setCallback() is defined to accept a @@ -153,67 +116,40 @@ namespace bool bugsplatSendLog(UINT nCode, LPVOID lpVal1, LPVOID lpVal2) { - // When BugSplat intercepts a crash, logging seems to stop?! - // Maybe because our test crashes use LL_ERROR(). Try writing a - // special log file "by hand." - std::ofstream log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "BugSplat.log"), - std::ios_base::app); - log << "Entered bugsplatSendLog() callback\n"; if (nCode == MDSCB_EXCEPTIONCODE) { // send the main viewer log file // widen to wstring, convert to __wchar_t, then pass c_str() sBugSplatSender->sendAdditionalFile( - WVCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); - log << "sendAdditionalFile('" << gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log") << "')\n"; + WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"))); sBugSplatSender->sendAdditionalFile( - WVCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); - log << "sendAdditionalFile('" << gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml") << "')\n"; + WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); + + // We don't have an email address for any user. Hijack this + // metadata field for the platform identifier. + sBugSplatSender->setDefaultUserEmail(WCSTR(STRINGIZE("Windows" << ADDRESS_SIZE))); if (gAgentAvatarp) { // user name, when we have it - sBugSplatSender->setDefaultUserName(WVCSTR(gAgentAvatarp->getFullname())); - log << "setDefaultUserName('" << gAgentAvatarp->getFullname() << "')\n"; - } - else - { - log << "gAgentAvatarp is nullptr\n"; + sBugSplatSender->setDefaultUserName(WCSTR(gAgentAvatarp->getFullname())); } // LL_ERRS message, when there is one - sBugSplatSender->setDefaultUserDescription(WVCSTR(LLError::getFatalMessage())); - log << "setDefaultUserDescription('" << LLError::getFatalMessage() << "')\n"; + sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage())); if (gAgent.getRegion()) { // region location, when we have it LLVector3 loc = gAgent.getPositionAgent(); sBugSplatSender->resetAppIdentifier( - WVCSTR(STRINGIZE(gAgent.getRegion()->getName() + WCSTR(STRINGIZE(gAgent.getRegion()->getName() << '/' << loc.mV[0] << '/' << loc.mV[1] << '/' << loc.mV[2]))); - log << "resetAppIdentifier('" - << gAgent.getRegion()->getName() - << '/' << loc.mV[0] - << '/' << loc.mV[1] - << '/' << loc.mV[2] - << "')\n"; - } - else - { - log << "gAgent.getRegion() is nullptr\n"; } - - LL_INFOS() << "Sending crash report to BugSplat." << LL_ENDL; - log << "Sending crash report to BugSplat.\n"; } // MDSCB_EXCEPTIONCODE - else - { - log << "nCode != MDSCB_EXCEPTIONCODE\n"; - } return false; } -- cgit v1.2.3 From 59d2bf0622ceb5f6e09e7f850606e0cbcb794cb8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 2 Aug 2018 16:21:30 -0400 Subject: DRTVWR-447: Merge changesets from newly updated viewer-release. --- indra/newview/CMakeLists.txt | 100 ++++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 30 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2fc722d4c3..31c4c02d99 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -3,7 +3,14 @@ project(viewer) include(00-Common) +# DON'T move Linking.cmake to its place in the alphabetized list below: it +# sets variables on which the 3p .cmake files depend. +include(Linking) + include(Boost) +if (DEFINED ENV{BUGSPLAT_DB}) + include(bugsplat) +endif (DEFINED ENV{BUGSPLAT_DB}) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) @@ -37,7 +44,6 @@ include(LLUI) include(LLVFS) include(LLWindow) include(LLXML) -include(Linking) include(NDOF) include(NVAPI) include(OPENAL) @@ -93,6 +99,12 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) +if (DEFINED ENV{BUGSPLAT_DB}) + include_directories( + ${BUGSPLAT_INCLUDE_DIR} + ) +endif (DEFINED ENV{BUGSPLAT_DB}) + include_directories(SYSTEM ${LLCOMMON_SYSTEM_INCLUDE_DIRS} ${LLXML_SYSTEM_INCLUDE_DIRS} @@ -1356,6 +1368,14 @@ if (DARWIN) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) + set_source_files_properties( + llappdelegate-objc.mm + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + # BugsplatMac is a module, imported with @import. That language feature + # demands these switches. + COMPILE_FLAGS "-fmodules -fcxx-modules" + ) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1370,6 +1390,12 @@ if (DARWIN) ${COREAUDIO_LIBRARY} ) + if (DEFINED ENV{BUGSPLAT_DB}) + list(APPEND viewer_LIBRARIES + ${BUGSPLAT_LIBRARIES} + ) + endif (DEFINED ENV{BUGSPLAT_DB}) + # Add resource files to the project. set(viewer_RESOURCE_FILES secondlife.icns @@ -1395,6 +1421,11 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) + set_source_files_properties( + llappviewerlinux.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") @@ -1411,6 +1442,11 @@ if (WINDOWS) llappviewerwin32.cpp llwindebug.cpp ) + set_source_files_properties( + llappviewerwin32.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) list(APPEND viewer_HEADER_FILES llappviewerwin32.h @@ -1693,6 +1729,11 @@ if (SDL_FOUND) ) endif (SDL_FOUND) +if (DEFINED ENV{BUGSPLAT_DB}) + set_property(TARGET ${VIEWER_BINARY_NAME} + PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT") +endif (DEFINED ENV{BUGSPLAT_DB}) + # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) @@ -1791,7 +1832,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll ) endif (FMODEX) - + add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat COMMAND ${PYTHON_EXECUTABLE} @@ -1826,24 +1867,9 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin - windows-crash-logger + windows-crash-logger ) - # sets the 'working directory' for debugging from visual studio. - if (NOT UNATTENDED) - add_custom_command( - TARGET ${VIEWER_BINARY_NAME} POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe - ARGS - --solution - ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln - --workingdir - ${VIEWER_BINARY_NAME} - "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." - ) - endif (NOT UNATTENDED) - if (PACKAGE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 @@ -1905,8 +1931,8 @@ else (WINDOWS) endif (WINDOWS) # *NOTE: - this list is very sensitive to ordering, test carefully on all -# platforms if you change the releative order of the entries here. -# In particular, cmake 2.6.4 (when buidling with linux/makefile generators) +# platforms if you change the relative order of the entries here. +# In particular, cmake 2.6.4 (when building with linux/makefile generators) # appears to sometimes de-duplicate redundantly listed dependencies improperly. # To work around this, higher level modules should be listed before the modules # that they depend upon. -brad @@ -1981,6 +2007,12 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLAPPEARANCE_LIBRARIES} ) +if (DEFINED ENV{BUGSPLAT_DB}) + target_link_libraries(${VIEWER_BINARY_NAME} + ${BUGSPLAT_LIBRARIES} + ) +endif (DEFINED ENV{BUGSPLAT_DB}) + set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") @@ -2054,8 +2086,10 @@ if (LINUX) endif (LINUX) if (DARWIN) - # These all get set with PROPERTIES - set(product "Second Life") + # These all get set with PROPERTIES. It's not that the property names are + # magically known to CMake -- it's that these names are referenced in the + # Info-SecondLife.plist file in the configure_file() directive below. + set(product "${VIEWER_CHANNEL}") # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist if (PACKAGE) set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") @@ -2063,21 +2097,29 @@ if (DARWIN) # force the name of the actual executable to allow running it within Xcode for debugging set(MACOSX_WRAPPER_EXECUTABLE_NAME "../Resources/Second Life Viewer.app/Contents/MacOS/Second Life") endif (PACKAGE) - set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + + # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ + set(CMAKE_MACOSX_RPATH 1) set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" + # From Contents/MacOS/SecondLife, look in Contents/Frameworks + INSTALL_RPATH "@loader_path/../Frameworks" + # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply + # does not work. Try this: + LINK_FLAGS "-rpath @loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) @@ -2148,7 +2190,7 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -if (PACKAGE) +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT DEFINED ENV{BUGSPLAT_DB}) set(SYMBOL_SEARCH_DIRS "") # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh if (WINDOWS) @@ -2167,8 +2209,8 @@ if (PACKAGE) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") - set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) @@ -2180,7 +2222,6 @@ if (PACKAGE) set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) endif (LINUX) - if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) if(CMAKE_CFG_INTDIR STREQUAL ".") set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) else(CMAKE_CFG_INTDIR STREQUAL ".") @@ -2207,8 +2248,7 @@ if (PACKAGE) add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}") endif (WINDOWS OR LINUX) add_dependencies(llpackage generate_breakpad_symbols) - endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) -endif (PACKAGE) +endif () if (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below -- cgit v1.2.3 From bc5aeae202ba6683cdae363a91d054043dc09949 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 Aug 2018 16:41:19 -0400 Subject: DRTVWR-447: Simplify redundant if-key-in-dict-and-value-nonempty logic --- indra/newview/viewer_manifest.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ad6ba3ddff..ea0b3625be 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -108,17 +108,18 @@ class ViewerManifest(LLManifest): Type='String', Value='')) settings_install = {} - if 'sourceid' in self.args and self.args['sourceid']: + sourceid = self.args.get('sourceid') + if sourceid: settings_install['sourceid'] = settings_template['sourceid'].copy() - settings_install['sourceid']['Value'] = self.args['sourceid'] - print "Set sourceid in settings_install.xml to '%s'" % self.args['sourceid'] + settings_install['sourceid']['Value'] = sourceid + print "Set sourceid in settings_install.xml to '%s'" % sourceid - if 'channel_suffix' in self.args and self.args['channel_suffix']: + if self.args.get('channel_suffix'): settings_install['CmdLineChannel'] = settings_template['CmdLineChannel'].copy() settings_install['CmdLineChannel']['Value'] = self.channel_with_pkg_suffix() print "Set CmdLineChannel in settings_install.xml to '%s'" % self.channel_with_pkg_suffix() - if 'grid' in self.args and self.args['grid']: + if self.args.get('grid'): settings_install['CmdLineGridChoice'] = settings_template['CmdLineGridChoice'].copy() settings_install['CmdLineGridChoice']['Value'] = self.grid() print "Set CmdLineGridChoice in settings_install.xml to '%s'" % self.grid() @@ -212,8 +213,9 @@ class ViewerManifest(LLManifest): def channel_with_pkg_suffix(self): fullchannel=self.channel() - if 'channel_suffix' in self.args and self.args['channel_suffix']: - fullchannel+=' '+self.args['channel_suffix'] + channel_suffix = self.args.get('channel_suffix') + if channel_suffix: + fullchannel+=' '+channel_suffix return fullchannel def channel_variant(self): @@ -239,11 +241,12 @@ class ViewerManifest(LLManifest): if self.channel_type() == 'release': suffix=suffix.replace('Release', '').strip() # for the base release viewer, suffix will now be null - for any other, append what remains - if len(suffix) > 0: - suffix = "_"+ ("_".join(suffix.split())) + if suffix: + suffix = "_".join([''] + suffix.split()) # the additional_packages mechanism adds more to the installer name (but not to the app name itself) - if 'channel_suffix' in self.args and self.args['channel_suffix']: - suffix+='_'+("_".join(self.args['channel_suffix'].split())) + # ''.split() produces empty list, so suffix only changes if + # channel_suffix is non-empty + suffix = "_".join([suffix] + self.args.get('channel_suffix', '').split()) return suffix def installer_base_name(self): -- cgit v1.2.3 From 87763d964a95bc918e26ae35932a99d56961f159 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 21 Aug 2018 19:26:07 -0400 Subject: MAINT-8917: For BugSplat viewer, don't create dump-UUID directory. Just put the static_debug_info.log file in the parent logs directory. Also update that static_debug_info.log file with "FatalMessage" key taken from LL_ERRS() message string. --- indra/newview/llappviewer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 687b76c224..3e25b395c4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -781,12 +781,18 @@ bool LLAppViewer::init() initMaxHeapSize() ; LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize")); +#if LL_BUGSPLAT + // MAINT-8917: don't create a dump directory just for the + // static_debug_info.log file + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); +#else // ! LL_BUGSPLAT // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); +#endif // ! LL_BUGSPLAT mDumpPath = logdir; setMiniDumpDir(logdir); logdir += gDirUtilp->getDirDelimiter(); - setDebugFileNames(logdir); + setDebugFileNames(logdir); // Although initLoggingAndGetLastDuration() is the right place to mess with @@ -2172,6 +2178,12 @@ void errorCallback(const std::string &error_string) //Set the ErrorActivated global so we know to create a marker file gLLErrorActivated = true; + gDebugInfo["FatalMessage"] = error_string; + // We're not already crashing -- we simply *intend* to crash. Since we + // haven't actually trashed anything yet, we can afford to write the whole + // static info file. + LLAppViewer::instance()->writeDebugInfo(); + LLError::crashAndLoop(error_string); } -- cgit v1.2.3 From 302052700b4605605808b90bed8fb1c5a93ece22 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 21 Aug 2018 19:28:19 -0400 Subject: DRTVWR-447: Add static_debug_info.log file to Windows crash report. Also use the LLOSInfo information for platform rather than simply Windows32 or Windows64. --- indra/newview/llappviewerwin32.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index adb340d40e..9f85ca3edf 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -126,9 +126,14 @@ namespace sBugSplatSender->sendAdditionalFile( WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml"))); + sBugSplatSender->sendAdditionalFile( + WCSTR(*LLAppViewer::instance()->getStaticDebugFile())); + // We don't have an email address for any user. Hijack this // metadata field for the platform identifier. - sBugSplatSender->setDefaultUserEmail(WCSTR(STRINGIZE("Windows" << ADDRESS_SIZE))); + sBugSplatSender->setDefaultUserEmail( + WCSTR(STRINGIZE(LLOSInfo::instance().getOSStringSimple() << " (" + << ADDRESS_SIZE << "-bit)"))); if (gAgentAvatarp) { -- cgit v1.2.3 From 7dc014474de0c2d83a3cd314acd9dc0882622299 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 22 Aug 2018 10:48:29 -0400 Subject: DRTVWR-447: Attempt to post BugSplat metadata with Mac crash reports. Introduce CrashMetadata, an LLSingleton in llappviewermacosx.cpp, declared in llappviewermacosx-for-objc.h and accessed by the various BugsplatStartupManagerDelegate override methods. CrashMetadata is populated by reading the previous (presumably crashed) run's static_debug_info.log file. This replaces the previous getOldLogFilePathname(), getFatalMessage() and getAgentFullname() functions. To extend that suite for additional metadata, not only would we have to keep adding new free functions, but we'd have to keep rereading the static_debug_info.log file. Override the new applicationKeyForBugsplatStartupManager, defaultUserNameForBugsplatStartupManager, defaultUserEmailForBugsplatStartupManager methods to extract relevant fields from CrashMetadata. Change applicationLogForBugsplatStartupManager and attachmentForBugsplatStartupManager to do the same. Enhance llviewerregion.cpp to update the static_debug_info.log file every time we enter a new region. --- indra/newview/llappdelegate-objc.mm | 43 ++++++++++++++++++++++------ indra/newview/llappviewermacosx-for-objc.h | 21 ++++++++++++-- indra/newview/llappviewermacosx.cpp | 45 +++++++++++++++++++++++++----- indra/newview/llviewerregion.cpp | 19 +++++++++++++ 4 files changed, 109 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 82e49540a4..ba697d0f77 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -199,10 +199,34 @@ - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { infos("Reached applicationLogForBugsplatStartupManager"); - // Apparently this override method only contributes the User Description - // field of BugSplat's All Crashes table. Despite the method name, it - // would seem to be a bad place to try to stuff all of SecondLife.log. - return [NSString stringWithCString:getFatalMessage().c_str() + // This strangely-named override method contributes the User Description + // metadata field. + return [NSString stringWithCString:CrashMetadata_instance().fatalMessage.c_str() + encoding:NSUTF8StringEncoding]; +} + +- (NSString *)applicationKeyForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager signal:(NSString *)signal exceptionName:(NSString *)exceptionName exceptionReason:(NSString *)exceptionReason { + // TODO: exceptionName, exceptionReason + + // Windows sends location within region as well, but that's because + // BugSplat for Windows intercepts crashes during the same run, and that + // information can be queried once. On the Mac, any metadata we have is + // written (and rewritten) to the static_debug_info.log file that we read + // at the start of the next viewer run. It seems ridiculously expensive to + // rewrite that file on every frame in which the avatar moves. + return [NSString stringWithCString:CrashMetadata_instance().regionName.c_str() + encoding:NSUTF8StringEncoding]; +} + +- (NSString *)defaultUserNameForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { + return [NSString stringWithCString:CrashMetadata_instance().agentFullname.c_str() + encoding:NSUTF8StringEncoding]; +} + +- (NSString *)defaultUserEmailForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { + // Use the email field for OS version, just as we do on Windows, until + // BugSplat provides more metadata fields. + return [NSString stringWithCString:CrashMetadata_instance().OSInfo.c_str() encoding:NSUTF8StringEncoding]; } @@ -212,11 +236,12 @@ } - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - // We get the *old* log file pathname (for SecondLife.old) because it's on - // the run *following* the crash that BugsplatStartupManager notices that - // the previous run crashed and calls this override. By that time, we've - // already renamed SecondLife.log to SecondLife.old. - std::string logfile = getOldLogFilePathname(); + std::string logfile = CrashMetadata_instance().logFilePathname; + // Still to do: + // userSettingsPathname + // staticDebugPathname + // but the BugsplatMac version 1.0.5 BugsplatStartupManagerDelegate API + // doesn't yet provide a way to attach more than one file. NSString *ns_logfile = [NSString stringWithCString:logfile.c_str() encoding:NSUTF8StringEncoding]; NSData *data = [NSData dataWithContentsOfFile:ns_logfile]; diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h index ac85d7e8c3..79da453cbe 100644 --- a/indra/newview/llappviewermacosx-for-objc.h +++ b/indra/newview/llappviewermacosx-for-objc.h @@ -29,9 +29,24 @@ void handleUrl(const char* url_utf8); bool pumpMainLoop(); void handleQuit(); void cleanupViewer(); -std::string getOldLogFilePathname(); -std::string getFatalMessage(); -std::string getAgentFullname(); void infos(const std::string& message); +// This struct is malleable; it only serves as a way to convey a number of +// fields from llappviewermacosx.cpp's CrashMetadata_instance() function to the +// consuming functions in llappdelegate-objc.mm. As long as both those sources +// are compiled with this same header, the content and order of CrashMetadata +// can change as needed. +struct CrashMetadata +{ + std::string logFilePathname; + std::string userSettingsPathname; + std::string staticDebugPathname; + std::string OSInfo; + std::string agentFullname; + std::string regionName; + std::string fatalMessage; +}; + +CrashMetadata& CrashMetadata_instance(); + #endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */ diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index c3a3c3284a..7f7284a796 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -39,6 +39,7 @@ #include "llappviewermacosx-for-objc.h" #include "llwindowmacosx-objc.h" #include "llcommandlineparser.h" +#include "llsdserialize.h" #include "llviewernetwork.h" #include "llviewercontrol.h" @@ -53,6 +54,7 @@ #endif #include #include +#include #include "lldir.h" #include @@ -150,19 +152,48 @@ void cleanupViewer() gViewerAppPtr = NULL; } -std::string getOldLogFilePathname() +// The BugsplatMac API is structured as a number of different method +// overrides, each returning a different piece of metadata. But since we +// obtain such metadata by opening and parsing a file, it seems ridiculous to +// reopen and reparse it for every individual string desired. What we want is +// to open and parse the file once, retaining the data for subsequent +// requests. That's why this is an LLSingleton. +// Another approach would be to provide a function that simply returns +// CrashMetadata, storing the struct in LLAppDelegate, but nat doesn't know +// enough Objective-C++ to code that. We'd still have to detect which of the +// method overrides is called first so that the results are order-insensitive. +class CrashMetadataSingleton: public CrashMetadata, public LLSingleton { - return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.old"); -} + LLSINGLETON(CrashMetadataSingleton); +}; -std::string getFatalMessage() +// Populate the fields of our public base-class struct. +CrashMetadataSingleton::CrashMetadataSingleton() { - return LLError::getFatalMessage(); + // Note: we depend on being able to read the static_debug_info.log file + // from the *previous* run before we overwrite it with the new one for + // *this* run. LLAppViewer initialization must happen in the Right Order. + staticDebugPathname = *gViewerAppPtr->getStaticDebugFile(); + std::ifstream static_file(staticDebugPathname); + LLSD info; + if (static_file.is_open() && + LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) + { + logFilePathname = info["SLLog"].asString(); + userSettingsPathname = info["SettingsFilename"].asString(); + OSInfo = info["OSInfo"].asString(); + agentFullname = info["LoginName"].asString(); + // Translate underscores back to spaces + LLStringUtil::replaceChar(agentFullname, '_', ' '); + regionName = info["CurrentRegion"].asString(); + fatalMessage = info["FatalMessage"].asString(); + } } -std::string getAgentFullname() +// Avoid having to compile all of our LLSingleton machinery in Objective-C++. +CrashMetadata& CrashMetadata_instance() { - return gAgentAvatarp? gAgentAvatarp->getFullname() : std::string(); + return CrashMetadataSingleton::instance(); } void infos(const std::string& message) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index b759c2a3ab..ca452fc766 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -44,6 +44,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llappviewer.h" #include "llavatarrenderinfoaccountant.h" #include "llcallingcard.h" #include "llcommandhandler.h" @@ -104,6 +105,18 @@ typedef std::map CapabilityMap; static void log_capabilities(const CapabilityMap &capmap); +namespace +{ + +void newRegionEntry(LLViewerRegion& region) +{ + LL_INFOS("LLViewerRegion") << "Entering region [" << region.getName() << "]" << LL_ENDL; + gDebugInfo["CurrentRegion"] = region.getName(); + LLAppViewer::instance()->writeDebugInfo(); +} + +} // anonymous namespace + // support for secondlife:///app/region/{REGION} SLapps // N.B. this is defined to work exactly like the classic secondlife://{REGION} // However, the later syntax cannot support spaces in the region name because @@ -249,6 +262,9 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) return; // this error condition is not recoverable. } + // record that we just entered a new region + newRegionEntry(*regionp); + // After a few attempts, continue login. But keep trying to get the caps: if (mSeedCapAttempts >= mSeedCapMaxAttemptsBeforeLogin && STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) @@ -369,6 +385,9 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) break; // this error condition is not recoverable. } + // record that we just entered a new region + newRegionEntry(*regionp); + LLSD capabilityNames = LLSD::emptyArray(); buildCapabilityNames(capabilityNames); -- cgit v1.2.3 From 787053ffeb70f4e3d7ade36290ad7e75f1146b74 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 22 Aug 2018 13:26:19 -0400 Subject: DRTVWR-447: Add logging to BugsplatMac override methods. --- indra/newview/llappdelegate-objc.mm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index ba697d0f77..66bcf58961 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -198,10 +198,11 @@ - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - infos("Reached applicationLogForBugsplatStartupManager"); + std::string fatalMessage(CrashMetadata_instance().fatalMessage); + infos("applicationLogForBugsplatStartupManager -> '" + fatalMessage + "'"); // This strangely-named override method contributes the User Description // metadata field. - return [NSString stringWithCString:CrashMetadata_instance().fatalMessage.c_str() + return [NSString stringWithCString:fatalMessage.c_str() encoding:NSUTF8StringEncoding]; } @@ -214,25 +215,31 @@ // written (and rewritten) to the static_debug_info.log file that we read // at the start of the next viewer run. It seems ridiculously expensive to // rewrite that file on every frame in which the avatar moves. - return [NSString stringWithCString:CrashMetadata_instance().regionName.c_str() + std::string regionName(CrashMetadata_instance().regionName); + infos("applicationKeyForBugsplatStartupManager -> '" + regionName + "'"); + return [NSString stringWithCString:regionName.c_str() encoding:NSUTF8StringEncoding]; } - (NSString *)defaultUserNameForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - return [NSString stringWithCString:CrashMetadata_instance().agentFullname.c_str() + std::string agentFullname(CrashMetadata_instance().agentFullname); + infos("defaultUserNameForBugsplatStartupManager -> '" + agentFullname + "'"); + return [NSString stringWithCString:agentFullname.c_str() encoding:NSUTF8StringEncoding]; } - (NSString *)defaultUserEmailForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { // Use the email field for OS version, just as we do on Windows, until // BugSplat provides more metadata fields. - return [NSString stringWithCString:CrashMetadata_instance().OSInfo.c_str() + std::string OSInfo(CrashMetadata_instance().OSInfo); + infos("defaultUserEmailForBugsplatStartupManager -> '" + OSInfo + "'"); + return [NSString stringWithCString:OSInfo.c_str() encoding:NSUTF8StringEncoding]; } - (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugsplatStartupManager { - infos("Reached bugsplatStartupManagerWillSendCrashReport"); + infos("bugsplatStartupManagerWillSendCrashReport"); } - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { @@ -252,7 +259,7 @@ [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log" attachmentData:data contentType:@"text/plain"]; - infos("attachmentForBugsplatStartupManager: attaching " + logfile); + infos("attachmentForBugsplatStartupManager attaching " + logfile); return attachment; } -- cgit v1.2.3 From 8d4e6b6df0d21e18a24c8e1d9f6008c2092a24c5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 22 Aug 2018 16:16:26 -0400 Subject: DRTVWR-447: Additional logging getting metadata for previous run --- indra/newview/llappviewer.cpp | 7 ++----- indra/newview/llappviewermacosx.cpp | 33 +++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3e25b395c4..d324a82bf8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3051,14 +3051,11 @@ void LLAppViewer::writeDebugInfo(bool isStatic) ? getStaticDebugFile() : getDynamicDebugFile() ); - LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL; - llofstream out_file(debug_filename->c_str()); + LL_INFOS() << "Writing debug file " << *debug_filename << LL_ENDL; + llofstream out_file(debug_filename->c_str()); isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) : LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file); - - - out_file.close(); } LLSD LLAppViewer::getViewerInfo() const diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 7f7284a796..77a16f7307 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -165,6 +165,14 @@ void cleanupViewer() class CrashMetadataSingleton: public CrashMetadata, public LLSingleton { LLSINGLETON(CrashMetadataSingleton); + + // convenience method to log each metadata field retrieved by constructor + std::string get_metadata(const LLSD& info, const LLSD::String& key) const + { + std::string data(info[key].asString()); + LL_INFOS() << " " << key << "='" << data << "'" << LL_ENDL; + return data; + } }; // Populate the fields of our public base-class struct. @@ -176,17 +184,26 @@ CrashMetadataSingleton::CrashMetadataSingleton() staticDebugPathname = *gViewerAppPtr->getStaticDebugFile(); std::ifstream static_file(staticDebugPathname); LLSD info; - if (static_file.is_open() && - LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) + if (! static_file.is_open()) + { + LL_INFOS() << "Can't open '" << staticDebugPathname + << "'; no metadata about previous run" << LL_ENDL; + } + else if (! LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) + { + LL_INFOS() << "Can't parse '" << staticDebugPathname + << "'; no metadata about previous run" << LL_ENDL; + } { - logFilePathname = info["SLLog"].asString(); - userSettingsPathname = info["SettingsFilename"].asString(); - OSInfo = info["OSInfo"].asString(); - agentFullname = info["LoginName"].asString(); + LL_INFOS() << "Metadata from '" << staticDebugPathname << "':" << LL_ENDL; + logFilePathname = get_metadata(info, "SLLog"); + userSettingsPathname = get_metadata(info, "SettingsFilename"); + OSInfo = get_metadata(info, "OSInfo"); + agentFullname = get_metadata(info, "LoginName"); // Translate underscores back to spaces LLStringUtil::replaceChar(agentFullname, '_', ' '); - regionName = info["CurrentRegion"].asString(); - fatalMessage = info["FatalMessage"].asString(); + regionName = get_metadata(info, "CurrentRegion"); + fatalMessage = get_metadata(info, "FatalMessage"); } } -- cgit v1.2.3 From e674f11757ab55c5ca7aab4cb1c8e059fa98f466 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 23 Aug 2018 12:31:54 -0400 Subject: DRTVWR-447: Add (some) metadata to Mac crash reports. This required reordering certain operations during Mac viewer startup. Split llappviewermacosx.cpp's initViewer() function into constructViewer() (which instantiates LLAppViewerMacOSX) and initViewer() (which calls LLAppViewerMacOSX::init()). llappdelegate-objc.mm's applicationDidFinishLaunching override now calls [BugsplatStartupManager start] between constructViewer() and initViewer(): we want constructViewer() to have set up the logging subsystem so we can log the actions of BugsplatStartupManagerDelegate override methods, but otherwise we want BugsplatStartupManager in place as early as possible to catch any early crashes. Besides, initViewer() ends up overwriting the static_debug_info.log on which we depend for the *previous* run's crash metadata. Move the code that initializes the pathname of the static_debug_info.log file from LLAppViewerMacOSX::init() to the LLAppViewerMacOSX() constructor, since BugsplatStartupManagerDelegate override methods need to read (the previous run's) file. Add code to applicationLogForBugsplatStartupManager override to set new BugsplatMac 1.0.6 properties userName and userEmail. Don't log empty fields from static_debug_info.log if we couldn't read it. --- indra/newview/llappdelegate-objc.mm | 55 +++++++++++++++++++++++------- indra/newview/llappviewer.cpp | 29 +++++++++------- indra/newview/llappviewermacosx-for-objc.h | 1 + indra/newview/llappviewermacosx.cpp | 17 +++++---- 4 files changed, 69 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 66bcf58961..f55304f30b 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -54,6 +54,25 @@ - (void) applicationDidFinishLaunching:(NSNotification *)notification { + // Call constructViewer() first so our logging subsystem is in place. This + // risks missing crashes in the LLAppViewerMacOSX constructor, but for + // present purposes it's more important to get the startup sequence + // properly logged. + // Someday I would like to modify the logging system so that calls before + // it's initialized are cached in a std::ostringstream and then, once it's + // initialized, "played back" into whatever handlers have been set up. + constructViewer(); + +#if defined(LL_BUGSPLAT) + // Engage BugsplatStartupManager *before* calling initViewer() to handle + // any crashes during initialization. + // https://www.bugsplat.com/docs/platforms/os-x#initialization + [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; + [BugsplatStartupManager sharedManager].askUserDetails = NO; + [BugsplatStartupManager sharedManager].delegate = self; + [[BugsplatStartupManager sharedManager] start]; +#endif + frameTimer = nil; [self languageUpdated]; @@ -71,14 +90,6 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; // [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; - -#if defined(LL_BUGSPLAT) - // https://www.bugsplat.com/docs/platforms/os-x#initialization - [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; - [BugsplatStartupManager sharedManager].askUserDetails = NO; - [BugsplatStartupManager sharedManager].delegate = self; - [[BugsplatStartupManager sharedManager] start]; -#endif } - (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { @@ -198,11 +209,29 @@ - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - std::string fatalMessage(CrashMetadata_instance().fatalMessage); - infos("applicationLogForBugsplatStartupManager -> '" + fatalMessage + "'"); - // This strangely-named override method contributes the User Description - // metadata field. - return [NSString stringWithCString:fatalMessage.c_str() + CrashMetadata& meta(CrashMetadata_instance()); + // As of BugsplatMac 1.0.6, userName and userEmail properties are now + // exposed by the BugsplatStartupManager. Set them here, since the + // defaultUserNameForBugsplatStartupManager and + // defaultUserEmailForBugsplatStartupManager methods are called later, for + // the *current* run, rather than for the previous crashed run whose crash + // report we are about to send. + infos("applicationLogForBugsplatStartupManager setting userName = '" + + meta.agentFullname + '"'); + bugsplatStartupManager.userName = + [NSString stringWithCString:meta.agentFullname.c_str() + encoding:NSUTF8StringEncoding]; + // Use the email field for OS version, just as we do on Windows, until + // BugSplat provides more metadata fields. + infos("applicationLogForBugsplatStartupManager setting userEmail = '" + + meta.OSInfo + '"'); + bugsplatStartupManager.userEmail = + [NSString stringWithCString:meta.OSInfo.c_str() + encoding:NSUTF8StringEncoding]; + // This strangely-named override method's return value contributes the + // User Description metadata field. + infos("applicationLogForBugsplatStartupManager -> '" + meta.fatalMessage + "'"); + return [NSString stringWithCString:meta.fatalMessage.c_str() encoding:NSUTF8StringEncoding]; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d324a82bf8..846b937a4e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -707,6 +707,22 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString(), LLOSInfo::instance().getOSStringSimple()); + + // Under some circumstances we want to read the static_debug_info.log file + // from the previous viewer run between this constructor call and the + // init() call, which will overwrite the static_debug_info.log file for + // THIS run. So setDebugFileNames() early. +#if LL_BUGSPLAT + // MAINT-8917: don't create a dump directory just for the + // static_debug_info.log file + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); +#else // ! LL_BUGSPLAT + // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); +#endif // ! LL_BUGSPLAT + mDumpPath = logdir; + setMiniDumpDir(logdir); + setDebugFileNames(logdir); } LLAppViewer::~LLAppViewer() @@ -781,19 +797,6 @@ bool LLAppViewer::init() initMaxHeapSize() ; LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize")); -#if LL_BUGSPLAT - // MAINT-8917: don't create a dump directory just for the - // static_debug_info.log file - std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); -#else // ! LL_BUGSPLAT - // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. - std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); -#endif // ! LL_BUGSPLAT - mDumpPath = logdir; - setMiniDumpDir(logdir); - logdir += gDirUtilp->getDirDelimiter(); - setDebugFileNames(logdir); - // Although initLoggingAndGetLastDuration() is the right place to mess with // setFatalFunction(), we can't query gSavedSettings until after diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h index 79da453cbe..37e8a3917a 100644 --- a/indra/newview/llappviewermacosx-for-objc.h +++ b/indra/newview/llappviewermacosx-for-objc.h @@ -24,6 +24,7 @@ #include +void constructViewer(); bool initViewer(); void handleUrl(const char* url_utf8); bool pumpMainLoop(); diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 77a16f7307..81f04744f8 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -86,7 +86,7 @@ static void exceptionTerminateHandler() gOldTerminateHandler(); // call old terminate() handler } -bool initViewer() +void constructViewer() { // Set the working dir to /Contents/Resources if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) @@ -102,18 +102,20 @@ bool initViewer() gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); gViewerAppPtr->setErrorHandler(LLAppViewer::handleViewerCrash); +} - +bool initViewer() +{ bool ok = gViewerAppPtr->init(); if(!ok) { LL_WARNS() << "Application init failed." << LL_ENDL; } - else if (!gHandleSLURL.empty()) - { - dispatchUrl(gHandleSLURL); - gHandleSLURL = ""; - } + else if (!gHandleSLURL.empty()) + { + dispatchUrl(gHandleSLURL); + gHandleSLURL = ""; + } return ok; } @@ -194,6 +196,7 @@ CrashMetadataSingleton::CrashMetadataSingleton() LL_INFOS() << "Can't parse '" << staticDebugPathname << "'; no metadata about previous run" << LL_ENDL; } + else { LL_INFOS() << "Metadata from '" << staticDebugPathname << "':" << LL_ENDL; logFilePathname = get_metadata(info, "SLLog"); -- cgit v1.2.3 From c2178bb6ac139d47eb2bfdf9e85811a6f02810ed Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 24 Aug 2018 09:56:56 -0400 Subject: DRTVWR-447: Introduce explicit CMake BUGSPLAT_DB variable. Define the CMake cache variable, with empty string as its default. Make build.sh pass the BUGSPLAT_DB environment variable as a CMake command-line variable assignment. Change CMake 'if (DEFINED ENV{BUGSPLAT_DB})' to plain 'if (BUGSPLAT_DB)'. Make CMake pass new --bugsplat switch to every one of SIX different invocations of viewer_manifest.py. Give llmanifest.main() function an argument to allow supplementing the base set of command-line switches with additional application-specific switches. In viewer_manifest.py, define new --bugsplat command-line switch and pass to llmanifest.main(). Instead of consulting os.environ['BUGSPLAT_DB'], consult self.args['bugsplat']. --- indra/newview/CMakeLists.txt | 52 ++++++++++++++++++++++------------------ indra/newview/viewer_manifest.py | 45 ++++++++++++++++++---------------- 2 files changed, 53 insertions(+), 44 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 31c4c02d99..64a8e15c4b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -8,9 +8,9 @@ include(00-Common) include(Linking) include(Boost) -if (DEFINED ENV{BUGSPLAT_DB}) +if (BUGSPLAT_DB) include(bugsplat) -endif (DEFINED ENV{BUGSPLAT_DB}) +endif (BUGSPLAT_DB) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) @@ -99,11 +99,11 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -if (DEFINED ENV{BUGSPLAT_DB}) +if (BUGSPLAT_DB) include_directories( ${BUGSPLAT_INCLUDE_DIR} ) -endif (DEFINED ENV{BUGSPLAT_DB}) +endif (BUGSPLAT_DB) include_directories(SYSTEM ${LLCOMMON_SYSTEM_INCLUDE_DIRS} @@ -1390,11 +1390,11 @@ if (DARWIN) ${COREAUDIO_LIBRARY} ) - if (DEFINED ENV{BUGSPLAT_DB}) + if (BUGSPLAT_DB) list(APPEND viewer_LIBRARIES ${BUGSPLAT_LIBRARIES} ) - endif (DEFINED ENV{BUGSPLAT_DB}) + endif (BUGSPLAT_DB) # Add resource files to the project. set(viewer_RESOURCE_FILES @@ -1729,10 +1729,10 @@ if (SDL_FOUND) ) endif (SDL_FOUND) -if (DEFINED ENV{BUGSPLAT_DB}) +if (BUGSPLAT_DB) set_property(TARGET ${VIEWER_BINARY_NAME} PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT") -endif (DEFINED ENV{BUGSPLAT_DB}) +endif (BUGSPLAT_DB) # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST @@ -1841,15 +1841,16 @@ if (WINDOWS) --actions=copy --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py stage_third_party_libs @@ -1892,15 +1893,16 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2007,11 +2009,11 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLAPPEARANCE_LIBRARIES} ) -if (DEFINED ENV{BUGSPLAT_DB}) +if (BUGSPLAT_DB) target_link_libraries(${VIEWER_BINARY_NAME} ${BUGSPLAT_LIBRARIES} ) -endif (DEFINED ENV{BUGSPLAT_DB}) +endif (BUGSPLAT_DB) set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") @@ -2036,15 +2038,16 @@ if (LINUX) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${COPY_INPUT_DEPENDENCIES} @@ -2058,17 +2061,18 @@ if (LINUX) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --arch=${ARCH} --actions=copy + --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${COPY_INPUT_DEPENDENCIES} @@ -2137,15 +2141,16 @@ if (DARWIN) --actions=copy --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt - --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} --source=${CMAKE_CURRENT_SOURCE_DIR} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2170,15 +2175,16 @@ if (DARWIN) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt ${SIGNING_SETTING} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2190,7 +2196,7 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT DEFINED ENV{BUGSPLAT_DB}) +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT BUGSPLAT_DB) set(SYMBOL_SEARCH_DIRS "") # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh if (WINDOWS) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ea0b3625be..e5f0575e86 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -188,11 +188,10 @@ class ViewerManifest(LLManifest): "Address Size":self.address_size, "Update Service":"https://update.secondlife.com/update", } - try: - build_data_dict["BugSplat DB"] = os.environ["BUGSPLAT_DB"] - except KeyError: - # skip the assignment if there's no BUGSPLAT_DB variable - pass + # Only store this if it's both present and non-empty + bugsplat_db = self.args.get('bugsplat') + if bugsplat_db: + build_data_dict["BugSplat DB"] = bugsplat_db build_data_dict = self.finish_build_data_dict(build_data_dict) with open(os.path.join(os.pardir,'build_data.json'), 'w') as build_data_handle: json.dump(build_data_dict,build_data_handle) @@ -589,14 +588,15 @@ class WindowsManifest(ViewerManifest): self.path("libhunspell.dll") # 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") + 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") # For google-perftools tcmalloc allocator. try: @@ -1038,7 +1038,7 @@ open "%s" --args "$@" if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): # only if we're engaging BugSplat - if "BUGSPLAT_DB" in os.environ: + if self.args.get('bugsplat'): # Create a symbol archive BEFORE stripping the # binary. self.run_command(['dsymutil', exepath]) @@ -1085,13 +1085,11 @@ open "%s" --args "$@" # runs the executable, instead of launching the app) Info["CFBundleExecutable"] = exename Info["CFBundleIconFile"] = viewer_icon - try: + bugsplat_db = self.args.get('bugsplat') + if bugsplat_db: # https://www.bugsplat.com/docs/platforms/os-x#configuration Info["BugsplatServerURL"] = \ - "https://{BUGSPLAT_DB}.bugsplatsoftware.com/".format(**os.environ) - except KeyError: - # skip the assignment if there's no BUGSPLAT_DB variable - pass + "https://{}.bugsplatsoftware.com/".format(bugsplat_db) self.put_in_file( plistlib.writePlistToString(Info), os.path.basename(Info_plist), @@ -1104,7 +1102,8 @@ open "%s" --args "$@" # Remember where we parked this car. CEF_framework = self.dst_path_of(CEF_framework) - self.path2basename(relpkgdir, "BugsplatMac.framework") + if self.args.get('bugsplat'): + self.path2basename(relpkgdir, "BugsplatMac.framework") with self.prefix(dst="Resources"): # defer cross-platform file copies until we're in the right @@ -1727,4 +1726,8 @@ class Linux_x86_64_Manifest(LinuxManifest): ################################################################ if __name__ == "__main__": - main() + extra_arguments = [ + dict(name='bugsplat', description="""BugSplat database to which to post crashes, + if BugSplat crash reporting is desired""", default=''), + ] + main(extra=extra_arguments) -- cgit v1.2.3 From 3f7c75b8a075a5cd5765b1791a58f5d8e2b164dd Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 27 Aug 2018 13:55:50 -0400 Subject: SL-957: Explicitly pass VIEWER_SYMBOL_FILE from build.sh into CMake instead of relying on both indra/newview/CMakeLists.txt and build.sh generating the same file pathname. Make build.sh set VIEWER_SYMBOL_FILE (instead of symbolfile) in pre_build, and pass it to autobuild configure via -D switch. Then the uploads stanza can just use VIEWER_SYMBOL_FILE instead of performing its platform-sensitive case statement right there. Introduce VIEWER_SYMBOL_FILE CMake cache variable, default empty string. Make indra/newview/CMakeLists.txt generate_breakpad_symbols logic conditional on VIEWER_SYMBOL_FILE being non-empty, as well as everything else. Eliminate local set(VIEWER_SYMBOL_FILE) directives. --- indra/newview/CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 64a8e15c4b..28fa56b54b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2196,12 +2196,11 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT BUGSPLAT_DB) +# Note that the conventional VIEWER_SYMBOL_FILE is set by ../../build.sh +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT BUGSPLAT_DB AND VIEWER_SYMBOL_FILE) set(SYMBOL_SEARCH_DIRS "") - # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh if (WINDOWS) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") @@ -2214,14 +2213,12 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") -- cgit v1.2.3 From 5ff160f72e8f4eab7a74491a7b848348267a180a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 30 Aug 2018 12:12:37 -0400 Subject: SL-957: Generate the expected symbols tarball even with BugSplat. This is a separate step from generating and posting BugSplat symbols, since BugSplat needs the executable along with the symbols, and we don't need to consume that space in a symbols tarball. Move Mac BugSplat symbol generation logic to CMake land, the same general area where Breakpad symbols are generated. Add stanzas to pack up the usual tarball for Windows and Mac. Remove the build.sh test that suppressed uploading the symbols tarball for BugSplat builds. --- indra/newview/CMakeLists.txt | 194 +++++++++++++++++++++++++++------------ indra/newview/viewer_manifest.py | 35 +------ 2 files changed, 138 insertions(+), 91 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 28fa56b54b..717c835031 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2128,9 +2128,14 @@ if (DARWIN) "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) + set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app") + set(VIEWER_APP_EXECUTABLE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") + set(VIEWER_APP_DSYM "${VIEWER_APP_EXECUTABLE}.dSYM") + set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") + configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" - "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist" + "${VIEWER_APP_BUNDLE}/Contents/Info.plist" ) add_custom_command( @@ -2147,7 +2152,7 @@ if (DARWIN) --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app + --dest=${VIEWER_APP_BUNDLE} --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt @@ -2180,7 +2185,7 @@ if (DARWIN) --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app + --dest=${VIEWER_APP_BUNDLE} --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched @@ -2197,60 +2202,135 @@ if (INSTALL) endif (INSTALL) # Note that the conventional VIEWER_SYMBOL_FILE is set by ../../build.sh -if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT BUGSPLAT_DB AND VIEWER_SYMBOL_FILE) - set(SYMBOL_SEARCH_DIRS "") - if (WINDOWS) - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") - # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad - # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") - set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") - set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}") - set(VIEWER_COPY_MANIFEST copy_w_viewer_manifest) - endif (WINDOWS) - if (DARWIN) - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") - # *TODO: Generate these search dirs in the cmake files related to each binary. - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") - set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") - set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") - set(VIEWER_LIB_GLOB "*.dylib") - endif (DARWIN) - if (LINUX) - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") - set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") - set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") - set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") - set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) - endif (LINUX) - - if(CMAKE_CFG_INTDIR STREQUAL ".") - set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) - else(CMAKE_CFG_INTDIR STREQUAL ".") - # set LLBUILD_CONFIG to be a shell variable evaluated at build time - # reflecting the configuration we are currently building. - set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR}) - endif(CMAKE_CFG_INTDIR STREQUAL ".") - add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" - COMMAND "${PYTHON_EXECUTABLE}" - ARGS - "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py" - "${LLBUILD_CONFIG}" - "${SYMBOL_SEARCH_DIRS}" - "${VIEWER_EXE_GLOBS}" - "${VIEWER_LIB_GLOB}" - "${AUTOBUILD_INSTALL_DIR}/bin/dump_syms" - "${VIEWER_SYMBOL_FILE}" - DEPENDS generate_breakpad_symbols.py - VERBATIM) - - add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") - add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}") - if (WINDOWS OR LINUX) - add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}") - endif (WINDOWS OR LINUX) - add_dependencies(llpackage generate_breakpad_symbols) +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIEWER_SYMBOL_FILE) + if (NOT BUGSPLAT_DB) + # Breakpad symbol-file generation + set(SYMBOL_SEARCH_DIRS "") + if (WINDOWS) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad + # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") + set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") + set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}") + set(VIEWER_COPY_MANIFEST copy_w_viewer_manifest) + endif (WINDOWS) + if (DARWIN) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + # *TODO: Generate these search dirs in the cmake files related to each binary. + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") + set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") + set(VIEWER_LIB_GLOB "*.dylib") + endif (DARWIN) + if (LINUX) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") + set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") + set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") + set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") + set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) + endif (LINUX) + + if(CMAKE_CFG_INTDIR STREQUAL ".") + set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) + else(CMAKE_CFG_INTDIR STREQUAL ".") + # set LLBUILD_CONFIG to be a shell variable evaluated at build time + # reflecting the configuration we are currently building. + set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR}) + endif(CMAKE_CFG_INTDIR STREQUAL ".") + add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" + COMMAND "${PYTHON_EXECUTABLE}" + ARGS + "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py" + "${LLBUILD_CONFIG}" + "${SYMBOL_SEARCH_DIRS}" + "${VIEWER_EXE_GLOBS}" + "${VIEWER_LIB_GLOB}" + "${AUTOBUILD_INSTALL_DIR}/bin/dump_syms" + "${VIEWER_SYMBOL_FILE}" + DEPENDS generate_breakpad_symbols.py + VERBATIM) + + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") + add_dependencies(generate_symbols "${VIEWER_BINARY_NAME}") + if (WINDOWS OR LINUX) + add_dependencies(generate_symbols "${VIEWER_COPY_MANIFEST}") + endif (WINDOWS OR LINUX) + + else (NOT BUGSPLAT_DB) + # BugSplat symbol-file generation + if (WINDOWS) + # Just pack up a tarball containing only the .pdb file for the executable. + add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" + # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2; + # testing a string suffix is painful enough in CMake language that + # we'll continue assuming it until forced to generalize. + COMMAND "tar" + ARGS + "cjf" + "${VIEWER_SYMBOL_FILE}" + "-C" + "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + "secondlife-bin.pdb" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" + COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE}" + ) + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") + endif (WINDOWS) + if (DARWIN) + # Have to run dsymutil first, then pack up the resulting .dSYM directory + add_custom_command(OUTPUT "${VIEWER_APP_DSYM}" + COMMAND "dsymutil" + ARGS + "${VIEWER_APP_EXECUTABLE}" + DEPENDS "${VIEWER_APP_EXECUTABLE}" + COMMENT "Generating ${VIEWER_APP_DSYM}" + ) + 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_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" + COMMAND "zip" + ARGS + "-r" + "${VIEWER_APP_XCARCHIVE}" + "." + WORKING_DIRECTORY "${VIEWER_APP_DSYM}/.." + DEPENDS "${VIEWER_APP_DSYM}" + COMMENT "Generating xcarchive.zip for upload to BugSplat" + ) + # Have to create a stamp file, and depend on it, to force CMake to run + # the cleanup step. + 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}" + 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" + ) + endif (DARWIN) + if (LINUX) + # TBD + endif (LINUX) + endif (NOT BUGSPLAT_DB) + + # for both BUGSPLAT_DB and Breakpad + add_dependencies(llpackage generate_symbols) endif () if (LL_TESTS) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e5f0575e86..f73b444a6e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1037,39 +1037,6 @@ open "%s" --args "$@" if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): - # only if we're engaging BugSplat - if self.args.get('bugsplat'): - # Create a symbol archive BEFORE stripping the - # binary. - self.run_command(['dsymutil', exepath]) - # This should produce a Second Life.dSYM bundle directory. - try: - # Now pretend we're Xcode making a .xcarchive file. - # Put it as a sibling of the top-level .app. - # From "Dave" at BugSplat support: - # "More from our Mac lead: I think zipping - # a folder containing the binary and - # symbols would be sufficient. Assuming - # symbol files are created with CMake. I'm - # not sure if CMake strips symbols into - # separate files at build time, and if so - # they're in a supported format." - xcarchive = os.path.join(parentdir, - exename + '.xcarchive.zip') - with zipfile.ZipFile(xcarchive, 'w', - compression=zipfile.ZIP_DEFLATED) as zf: - print "Creating {}".format(xcarchive) - for base, dirs, files in os.walk(here): - for fn in files: - fullfn = os.path.join(base, fn) - relfn = os.path.relpath(fullfn, here) - print " {}".format(relfn) - zf.write(fullfn, relfn) - finally: - # Whether or not we were able to create the - # .xcarchive file, clean up the .dSYM bundle - shutil.rmtree(self.dst_path_of(exename + '.dSYM')) - # NOTE: the -S argument to strip causes it to keep # enough info for annotated backtraces (i.e. function # names in the crash log). 'strip' with no arguments @@ -1089,7 +1056,7 @@ open "%s" --args "$@" if bugsplat_db: # https://www.bugsplat.com/docs/platforms/os-x#configuration Info["BugsplatServerURL"] = \ - "https://{}.bugsplatsoftware.com/".format(bugsplat_db) + "https://{}.bugsplat.com/".format(bugsplat_db) self.put_in_file( plistlib.writePlistToString(Info), os.path.basename(Info_plist), -- cgit v1.2.3 From 34e6d5321df54d99fd91943f49c764849d77bff0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 30 Aug 2018 14:29:00 -0400 Subject: SL-957: Use cygpath to set up output pathname for cygwin tar. --- indra/newview/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 717c835031..7711488c0f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2261,7 +2261,12 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE else (NOT BUGSPLAT_DB) # BugSplat symbol-file generation if (WINDOWS) - # Just pack up a tarball containing only the .pdb file for the executable. + # Just pack up a tarball containing only the .pdb file for the + # executable. Because we intend to use cygwin tar, we must render + # VIEWER_SYMBOL_FILE in cygwin path syntax. + execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}" + OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN + OUTPUT_STRIP_TRAILING_WHITESPACE) add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2; # testing a string suffix is painful enough in CMake language that @@ -2269,12 +2274,11 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMAND "tar" ARGS "cjf" - "${VIEWER_SYMBOL_FILE}" - "-C" - "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + "${VIEWER_SYMBOL_FILE_CYGWIN}" "secondlife-bin.pdb" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" - COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE}" + COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" ) add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") endif (WINDOWS) -- cgit v1.2.3 From 29a29db7dd154b694c1ac414ceec8e37cb745335 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 30 Aug 2018 14:52:54 -0400 Subject: SL-957: Try to add enough CMake dependencies to generate Mac symbols. --- indra/newview/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7711488c0f..36dafa52ed 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2129,7 +2129,11 @@ if (DARWIN) ) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app") - set(VIEWER_APP_EXECUTABLE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") + # VIEWER_APP_EXECUTABLE was originally a prediction of the executable + # pathname that would result from running viewer_manifest.py, but CMake + # complained that there was no rule to make that executable. Try using the + # existing target. + set(VIEWER_APP_EXECUTABLE "${VIEWER_BINARY_NAME}") set(VIEWER_APP_DSYM "${VIEWER_APP_EXECUTABLE}.dSYM") set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") @@ -2291,6 +2295,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE DEPENDS "${VIEWER_APP_EXECUTABLE}" COMMENT "Generating ${VIEWER_APP_DSYM}" ) + add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") + add_dependencies(dsym_generate "${VIEWER_APP_EXECUTABLE}") add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # See above comments about "tar ...j" COMMAND "tar" @@ -2303,6 +2309,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE 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 @@ -2313,6 +2321,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE DEPENDS "${VIEWER_APP_DSYM}" COMMENT "Generating xcarchive.zip for upload to BugSplat" ) + add_custom_target(dsym_xcarchive DEPENDS "${VIEWER_APP_XCARCHIVE}") + add_dependencies(dsym_xcarchive dsym_generate) # Have to create a stamp file, and depend on it, to force CMake to run # the cleanup step. add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" @@ -2327,6 +2337,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE "${VIEWER_APP_XCARCHIVE}" "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" ) + add_dependencies(generate_symbols dsym_tarball dsym_xcarchive) endif (DARWIN) if (LINUX) # TBD -- cgit v1.2.3 From aa6d178b6917af0d933dd2fdcd0c0906285b768b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 30 Aug 2018 15:19:23 -0400 Subject: SL-957: Delay trying to pack up Windows PDB file until linker done. --- indra/newview/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 36dafa52ed..10210cd918 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2284,7 +2284,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" ) - add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_BINARY_NAME}") + add_dependencies(generate_symbols "${VIEWER_BINARY_NAME}") endif (WINDOWS) if (DARWIN) # Have to run dsymutil first, then pack up the resulting .dSYM directory -- cgit v1.2.3 From 822e3b15e2491ce8f3bd76c5b3ac70be695108e4 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 31 Aug 2018 14:17:00 -0400 Subject: SL-957: Use tar -C instead of changing tar's WORKING_DIRECTORY. Seems VIEWER_SYMBOL_FILE arrives from build.sh as a relative pathname, so passing that pathname to tar when we run tar with WORKING_DIRECTORY confuses it. But if we use tar's -C switch, we can achieve the effect we want (no leading directory prefixes in the tarball) without WORKING_DIRECTORY. Thing is, we have to run the desired directory through cygpath first, which is why we went with WORKING_DIRECTORY in the first place. --- indra/newview/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 10210cd918..a54ee7279c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2271,6 +2271,9 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}" OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN + OUTPUT_STRIP_TRAILING_WHITESPACE) add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2; # testing a string suffix is painful enough in CMake language that @@ -2279,8 +2282,9 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE ARGS "cjf" "${VIEWER_SYMBOL_FILE_CYGWIN}" + "-C" + "${PARENT_DIRECTORY_CYGWIN}" "secondlife-bin.pdb" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" ) -- cgit v1.2.3 From 392bf44a1f28dfac7583aca551745fe8499e9fe8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 31 Aug 2018 14:26:32 -0400 Subject: SL-957: Name VIEWER_BINARY_NAME directly, not an assigned variable. If this theory is correct, setting VIEWER_APP_EXECUTABLE to VIEWER_BINARY_NAME and then referencing VIEWER_APP_EXECUTABLE instead of VIEWER_BINARY_NAME confuses CMake as to the filename involved. --- indra/newview/CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a54ee7279c..6997a4330f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2129,12 +2129,7 @@ if (DARWIN) ) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app") - # VIEWER_APP_EXECUTABLE was originally a prediction of the executable - # pathname that would result from running viewer_manifest.py, but CMake - # complained that there was no rule to make that executable. Try using the - # existing target. - set(VIEWER_APP_EXECUTABLE "${VIEWER_BINARY_NAME}") - set(VIEWER_APP_DSYM "${VIEWER_APP_EXECUTABLE}.dSYM") + set(VIEWER_APP_DSYM "${VIEWER_BINARY_NAME}.dSYM") set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") configure_file( @@ -2296,12 +2291,12 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE add_custom_command(OUTPUT "${VIEWER_APP_DSYM}" COMMAND "dsymutil" ARGS - "${VIEWER_APP_EXECUTABLE}" - DEPENDS "${VIEWER_APP_EXECUTABLE}" + "${VIEWER_BINARY_NAME}" + DEPENDS "${VIEWER_BINARY_NAME}" COMMENT "Generating ${VIEWER_APP_DSYM}" ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") - add_dependencies(dsym_generate "${VIEWER_APP_EXECUTABLE}") + add_dependencies(dsym_generate "${VIEWER_BINARY_NAME}") add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # See above comments about "tar ...j" COMMAND "tar" -- cgit v1.2.3 From 92b64fd59e6ac83bec8c165eb2f1ee31ff5eb059 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 31 Aug 2018 16:04:31 -0400 Subject: SL-957: Try removing quotes from ${VIEWER_BINARY_NAME} in CMake deps. --- indra/newview/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6997a4330f..bed0132e23 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2251,8 +2251,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE DEPENDS generate_breakpad_symbols.py VERBATIM) - add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") - add_dependencies(generate_symbols "${VIEWER_BINARY_NAME}") + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME} "${VIEWER_COPY_MANIFEST}") + add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) if (WINDOWS OR LINUX) add_dependencies(generate_symbols "${VIEWER_COPY_MANIFEST}") endif (WINDOWS OR LINUX) @@ -2283,20 +2283,20 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" ) - add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_BINARY_NAME}") - add_dependencies(generate_symbols "${VIEWER_BINARY_NAME}") + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME}) + add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) endif (WINDOWS) if (DARWIN) # Have to run dsymutil first, then pack up the resulting .dSYM directory add_custom_command(OUTPUT "${VIEWER_APP_DSYM}" COMMAND "dsymutil" ARGS - "${VIEWER_BINARY_NAME}" - DEPENDS "${VIEWER_BINARY_NAME}" + ${VIEWER_BINARY_NAME} + DEPENDS ${VIEWER_BINARY_NAME} COMMENT "Generating ${VIEWER_APP_DSYM}" ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") - add_dependencies(dsym_generate "${VIEWER_BINARY_NAME}") + add_dependencies(dsym_generate ${VIEWER_BINARY_NAME}) add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # See above comments about "tar ...j" COMMAND "tar" -- cgit v1.2.3 From 444fbd1b44ae5c48e95030b326c0b14225e87dbe Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 4 Sep 2018 15:37:21 -0400 Subject: SL-957: Try removing redundant add_custom_command() dependency. --- indra/newview/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bed0132e23..915bfdc39e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2292,7 +2292,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMAND "dsymutil" ARGS ${VIEWER_BINARY_NAME} - DEPENDS ${VIEWER_BINARY_NAME} +## redundant with add_dependencies() below, and possibly harmful +## DEPENDS ${VIEWER_BINARY_NAME} COMMENT "Generating ${VIEWER_APP_DSYM}" ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") -- cgit v1.2.3 From 150199d542453f6e9a3b6c6e466e778ca5a027d0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 4 Sep 2018 16:43:34 -0400 Subject: SL-957: Try being more explicit about VIEWER_APP_DSYM full pathname. --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 915bfdc39e..f3b87cb93c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2129,7 +2129,7 @@ if (DARWIN) ) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app") - set(VIEWER_APP_DSYM "${VIEWER_BINARY_NAME}.dSYM") + set(VIEWER_APP_DSYM "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}.dSYM") set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") configure_file( -- cgit v1.2.3 From d1c6b9820c3c5eda2ca797df104927f4e8f02b24 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 4 Sep 2018 19:28:55 -0400 Subject: SL-957: Try passing dsymutil the full pathname of VIEWER_APP_EXE. --- indra/newview/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f3b87cb93c..e573b927d7 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2129,7 +2129,8 @@ if (DARWIN) ) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app") - set(VIEWER_APP_DSYM "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}.dSYM") + set(VIEWER_APP_EXE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") + set(VIEWER_APP_DSYM "${VIEWER_APP_EXE}.dSYM") set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") configure_file( @@ -2291,9 +2292,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE add_custom_command(OUTPUT "${VIEWER_APP_DSYM}" COMMAND "dsymutil" ARGS - ${VIEWER_BINARY_NAME} -## redundant with add_dependencies() below, and possibly harmful -## DEPENDS ${VIEWER_BINARY_NAME} + ${VIEWER_APP_EXE} COMMENT "Generating ${VIEWER_APP_DSYM}" ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") -- cgit v1.2.3 From 42931d67a15d9a018f06ec2e5fc8d78549ab4cd8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 5 Sep 2018 17:27:24 -0400 Subject: SL-957: Don't move viewer executable until final viewer_manifest run. viewer_manifest is run twice by CMakeLists.txt: once with --actions=copy and once with the default actions copy and package. The fact that we (try to) move the Mac viewer executable both times has confused things on a number of occasions. Currently it's bollixing our attempt to run dsymutil on the executable so we can package up the Mac symbols for both codeticket and BugSplat. Introduce DarwinManifest.is_rearranging() that tests whether either "package" or "unpacked" is in self.args["actions"], echoing an earlier test. Make several things conditional on that, notably moving the executable. --- indra/newview/viewer_manifest.py | 66 ++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f73b444a6e..d70dbed9e0 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -899,6 +899,12 @@ class DarwinManifest(ViewerManifest): # darwin requires full app bundle packaging even for debugging. return True + def is_rearranging(self): + # That said, some stuff should still only be performed once. + # Are either of these actions in 'actions'? Is the set intersection + # non-empty? + return bool(set(["package", "unpacked"]).intersection(self.args['actions'])) + def construct(self): # These are the names of the top-level application and the embedded # applications for the VMP and for the actual viewer, respectively. @@ -926,18 +932,19 @@ class DarwinManifest(ViewerManifest): # the one file in top-level MacOS directory is the trampoline to # our nested launcher_app - with self.prefix(dst="MacOS"): - toplevel_MacOS = self.get_dst_prefix() - trampoline = self.put_in_file("""\ + if self.is_rearranging(): + with self.prefix(dst="MacOS"): + toplevel_MacOS = self.get_dst_prefix() + trampoline = self.put_in_file("""\ #!/bin/bash open "%s" --args "$@" """ % - # up one directory from MacOS to its sibling Resources directory - os.path.join('$(dirname "$0")', os.pardir, 'Resources', launcher_app), - "SL_Launcher", # write this file - "trampoline") # flag to add to list of copied files - # Script must be executable - self.run_command(["chmod", "+x", trampoline]) + # up one directory from MacOS to its sibling Resources directory + os.path.join('$(dirname "$0")', os.pardir, 'Resources', launcher_app), + "SL_Launcher", # write this file + "trampoline") # flag to add to list of copied files + # Script must be executable + self.run_command(["chmod", "+x", trampoline]) # Make a symlink to a nested app Frameworks directory that doesn't # yet exist. We shouldn't need this; the only things that need @@ -1018,12 +1025,19 @@ open "%s" --args "$@" continue fromwhere = os.path.join(toplevel_MacOS, f) towhere = self.dst_path_of(f) - print "Moving %s => %s" % \ - (self.relpath(fromwhere, relbase), - self.relpath(towhere, relbase)) - # now do it, only without relativizing paths - os.rename(fromwhere, towhere) - + fromrel = self.relpath(fromwhere, relbase) + torel = self.relpath(towhere, relbase) + if not self.is_rearranging(): + print "Not yet moving {} => {}".format(fromrel, torel) + else: + print "Moving {} => {}".format(fromrel, torel) + # now do it, only without relativizing paths + os.rename(fromwhere, towhere) + + # If we haven't yet moved executables, find our viewer + # executable where it was linked, in toplevel_MacOS. + # If we have, find it here. + whichdir = here if self.is_rearranging() else toplevel_MacOS # Pick the biggest of the executables as the real viewer. # Make (basename, fullpath) pairs; for each pair, # expand to (size, basename, fullpath) triples; sort @@ -1032,11 +1046,10 @@ open "%s" --args "$@" _, exename, exepath = \ sorted((os.path.getsize(path), name, path) for name, path in - ((name, os.path.join(here, name)) - for name in os.listdir(here)))[-1] + ((name, os.path.join(whichdir, name)) + for name in os.listdir(whichdir)))[-1] - if ("package" in self.args['actions'] or - "unpacked" in self.args['actions']): + if self.is_rearranging(): # NOTE: the -S argument to strip causes it to keep # enough info for annotated backtraces (i.e. function # names in the crash log). 'strip' with no arguments @@ -1192,13 +1205,14 @@ open "%s" --args "$@" # our apps executable_path = {} - for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), - # plugin launcher - (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), - ): - self.path2basename(os.path.join(os.pardir, - app_bld_dir, self.args['configuration']), - app) + for app_bld_dir, app in ( + ("mac_crash_logger", "mac-crash-logger.app"), + # plugin launcher + (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), + ): + self.path2basename( + os.path.join(os.pardir, app_bld_dir, self.args['configuration']), + app) executable_path[app] = \ self.dst_path_of(os.path.join(app, "Contents", "MacOS")) -- cgit v1.2.3 From 137c8db8cc1aa49a306531413e9cba5688cb9990 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 5 Sep 2018 20:33:19 -0400 Subject: SL-957: Previous commit skipped a couple assignments used later. --- indra/newview/viewer_manifest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index d70dbed9e0..aa03780e19 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -930,11 +930,13 @@ class DarwinManifest(ViewerManifest): # top-level Info.plist is as generated by CMake Info_plist = self.dst_path_of("Info.plist") + toplevel_MacOS = self.dst_path_of("MacOS") # the one file in top-level MacOS directory is the trampoline to # our nested launcher_app - if self.is_rearranging(): + if not self.is_rearranging(): + trampoline = "" + else: with self.prefix(dst="MacOS"): - toplevel_MacOS = self.get_dst_prefix() trampoline = self.put_in_file("""\ #!/bin/bash open "%s" --args "$@" -- cgit v1.2.3 From 49c483eeb350f3620f26ce933007c3d4e9f66d4f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 5 Sep 2018 18:07:35 -0400 Subject: add more block structure to TeamCity log output for components --- indra/newview/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e573b927d7..560c9d0737 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1722,6 +1722,7 @@ add_executable(${VIEWER_BINARY_NAME} MACOSX_BUNDLE ${viewer_SOURCE_FILES} ) +buildscripts_block(${VIEWER_BINARY_NAME}) if (SDL_FOUND) set_property(TARGET ${VIEWER_BINARY_NAME} @@ -1914,6 +1915,7 @@ if (WINDOWS) ${CMAKE_CFG_INTDIR}/touched.bat windows-setup-build-all ) + buildscripts_block(llpackage) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) @@ -2253,6 +2255,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE VERBATIM) add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME} "${VIEWER_COPY_MANIFEST}") + buildscripts_block(generate_symbols) add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) if (WINDOWS OR LINUX) add_dependencies(generate_symbols "${VIEWER_COPY_MANIFEST}") @@ -2285,6 +2288,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" ) add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME}) + buildscripts_block(generate_symbols) add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) endif (WINDOWS) if (DARWIN) @@ -2296,6 +2300,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMENT "Generating ${VIEWER_APP_DSYM}" ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") + buildscripts_block(dsym_generate) add_dependencies(dsym_generate ${VIEWER_BINARY_NAME}) add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # See above comments about "tar ...j" @@ -2310,6 +2315,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMENT "Packing dSYM into ${VIEWER_SYMBOL_FILE}" ) add_custom_target(dsym_tarball DEPENDS "${VIEWER_SYMBOL_FILE}") + buildscripts_block(dsym_tarball) add_dependencies(dsym_tarball dsym_generate) add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" @@ -2337,6 +2343,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE "${VIEWER_APP_XCARCHIVE}" "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" ) + buildscripts_block(generate_symbols) add_dependencies(generate_symbols dsym_tarball dsym_xcarchive) endif (DARWIN) if (LINUX) -- cgit v1.2.3 From 10f2101515fe8ba230848cce41faaf7613c9b6d8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 6 Sep 2018 14:32:15 -0400 Subject: make the .app name channel sensitive to match cmake --- 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 aa03780e19..464f7aa3e9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -910,7 +910,8 @@ class DarwinManifest(ViewerManifest): # applications for the VMP and for the actual viewer, respectively. # These names, without the .app suffix, determine the flyover text for # their corresponding Dock icons. - toplevel_app, toplevel_icon = "Second Life.app", "secondlife.icns" + toplevel_app = self.channel()+".app" + toplevel_icon = "secondlife.icns" launcher_app, launcher_icon = "Second Life Launcher.app", "secondlife.icns" viewer_app, viewer_icon = "Second Life Viewer.app", "secondlife.icns" -- cgit v1.2.3 From 9fd463bd9496ba5d97abec6ee75b9c0c089aa69d Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 7 Sep 2018 09:13:57 -0400 Subject: remove only-partially-successful attempt to put teamcity blocks around targets --- indra/newview/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 560c9d0737..e573b927d7 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1722,7 +1722,6 @@ add_executable(${VIEWER_BINARY_NAME} MACOSX_BUNDLE ${viewer_SOURCE_FILES} ) -buildscripts_block(${VIEWER_BINARY_NAME}) if (SDL_FOUND) set_property(TARGET ${VIEWER_BINARY_NAME} @@ -1915,7 +1914,6 @@ if (WINDOWS) ${CMAKE_CFG_INTDIR}/touched.bat windows-setup-build-all ) - buildscripts_block(llpackage) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) @@ -2255,7 +2253,6 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE VERBATIM) add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME} "${VIEWER_COPY_MANIFEST}") - buildscripts_block(generate_symbols) add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) if (WINDOWS OR LINUX) add_dependencies(generate_symbols "${VIEWER_COPY_MANIFEST}") @@ -2288,7 +2285,6 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" ) add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME}) - buildscripts_block(generate_symbols) add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) endif (WINDOWS) if (DARWIN) @@ -2300,7 +2296,6 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMENT "Generating ${VIEWER_APP_DSYM}" ) add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") - buildscripts_block(dsym_generate) add_dependencies(dsym_generate ${VIEWER_BINARY_NAME}) add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" # See above comments about "tar ...j" @@ -2315,7 +2310,6 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE COMMENT "Packing dSYM into ${VIEWER_SYMBOL_FILE}" ) add_custom_target(dsym_tarball DEPENDS "${VIEWER_SYMBOL_FILE}") - buildscripts_block(dsym_tarball) add_dependencies(dsym_tarball dsym_generate) add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" @@ -2343,7 +2337,6 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE "${VIEWER_APP_XCARCHIVE}" "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" ) - buildscripts_block(generate_symbols) add_dependencies(generate_symbols dsym_tarball dsym_xcarchive) endif (DARWIN) if (LINUX) -- cgit v1.2.3 From 65dd31631f385d6ad85ed78b2fa07525dbd9d360 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 8 Sep 2018 10:05:26 -0400 Subject: DRTVWR-474, MAINT-9047: Restore viewer to top-level Mac app. The relationship to MAINT-9047 is that we hope this will improve the behavior of Mac code signing. --- indra/newview/viewer_manifest.py | 633 ++++++++++++++++----------------------- 1 file changed, 254 insertions(+), 379 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 541112a765..14ff2c194e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -880,394 +880,269 @@ class DarwinManifest(ViewerManifest): return True def construct(self): - # These are the names of the top-level application and the embedded - # applications for the VMP and for the actual viewer, respectively. - # These names, without the .app suffix, determine the flyover text for - # their corresponding Dock icons. - toplevel_app, toplevel_icon = "Second Life.app", "secondlife.icns" - launcher_app, launcher_icon = "Second Life Launcher.app", "secondlife.icns" - viewer_app, viewer_icon = "Second Life Viewer.app", "secondlife.icns" - # copy over the build result (this is a no-op if run within the xcode script) - self.path(os.path.join(self.args['configuration'], toplevel_app), dst="") + self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") - # -------------------- top-level Second Life.app --------------------- - # top-level Second Life application is only a container with self.prefix(src="", dst="Contents"): # everything goes in Contents - # top-level Info.plist is as generated by CMake - Info_plist = "Info.plist" - ## This self.path() call reports 0 files... skip? - self.path(Info_plist) - Info_plist = self.dst_path_of(Info_plist) - - # the one file in top-level MacOS directory is the trampoline to - # our nested launcher_app + # CEF framework goes inside Contents/Frameworks. + # Remember where we parked this car. + with self.prefix(src="", dst="Frameworks"): + CEF_framework = "Chromium Embedded Framework.framework" + self.path2basename(relpkgdir, CEF_framework) + CEF_framework = self.dst_path_of(CEF_framework) + with self.prefix(dst="MacOS"): - toplevel_MacOS = self.get_dst_prefix() - trampoline = self.put_in_file("""\ -#!/bin/bash -open "%s" --args "$@" -""" % - # up one directory from MacOS to its sibling Resources directory - os.path.join('$(dirname "$0")', os.pardir, 'Resources', launcher_app), - "SL_Launcher", # write this file - "trampoline") # flag to add to list of copied files - # Script must be executable - self.run_command(["chmod", "+x", trampoline]) - - # Make a symlink to a nested app Frameworks directory that doesn't - # yet exist. We shouldn't need this; the only things that need - # Frameworks are nested apps under viewer_app, and they should - # simply find its Contents/Frameworks by relative pathnames. But - # empirically, we do: if we omit this symlink, CEF doesn't work -- - # the login splash screen doesn't even display. SIIIIGH. - # We're passing a path that's already relative, hence symlinkf() - # rather than relsymlinkf(). - self.symlinkf(os.path.join("Resources", viewer_app, "Contents", "Frameworks")) - - with self.prefix(src="", dst="Resources"): - # top-level Resources directory should be pretty sparse - # need .icns file referenced by top-level Info.plist + # NOTE: the -S argument to strip causes it to keep + # enough info for annotated backtraces (i.e. function + # names in the crash log). 'strip' with no arguments + # yields a slightly smaller binary but makes crash + # logs mostly useless. This may be desirable for the + # final release. Or not. + if ("package" in self.args['actions'] or + "unpacked" in self.args['actions']): + self.run_command( + ['strip', '-S', self.dst_path_of('Second Life')]) + + with self.prefix(dst="Resources"): + # defer cross-platform file copies until we're in the + # nested Resources directory + super(DarwinManifest, self).construct() + + # need .icns file referenced by Info.plist with self.prefix(src=self.icon_path(), dst="") : - self.path(toplevel_icon) - - # ------------------- nested launcher_app -------------------- - with self.prefix(dst=os.path.join(launcher_app, "Contents")): - # Info.plist is just like top-level one... - Info = plistlib.readPlist(Info_plist) - # except for these replacements: - Info["CFBundleExecutable"] = "SL_Launcher" - Info["CFBundleIconFile"] = launcher_icon - self.put_in_file( - plistlib.writePlistToString(Info), - os.path.basename(Info_plist), - "Info.plist") - - # copy VMP libs to MacOS - with self.prefix(dst="MacOS"): - #this copies over the python wrapper script, - #associated utilities and required libraries, see - #SL-321, SL-322, SL-323 - with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): - self.path("SL_Launcher") - self.path("*.py") - # certifi will be imported by requests; this is - # our custom version to get our ca-bundle.crt - self.path("certifi") - with self.prefix(src=os.path.join(pkgdir, "lib", "python"), dst=""): - # llbase provides our llrest service layer and llsd decoding - with self.prefix("llbase"): - # (Why is llbase treated specially here? What - # DON'T we want to copy out of lib/python/llbase?) - self.path("*.py") - self.path("_cllsd.so") - #requests module needed by llbase/llrest.py - #this is only needed on POSIX, because in Windows - #we compile it into the EXE - for pypkg in "chardet", "idna", "requests", "urllib3": - self.path(pypkg) - - # launcher_app/Contents/Resources - with self.prefix(dst="Resources"): - with self.prefix(src=self.icon_path(), dst="") : - self.path(launcher_icon) - with self.prefix(dst="vmp_icons"): - self.path("secondlife.ico") - #VMP Tkinter icons - with self.prefix("vmp_icons"): - self.path("*.png") - self.path("*.gif") - - # -------------------- nested viewer_app --------------------- - with self.prefix(dst=os.path.join(viewer_app, "Contents")): - # Info.plist is just like top-level one... - Info = plistlib.readPlist(Info_plist) - # except for these replacements: - # (CFBundleExecutable may be moot: SL_Launcher directly - # runs the executable, instead of launching the app) - Info["CFBundleExecutable"] = "Second Life" - Info["CFBundleIconFile"] = viewer_icon - self.put_in_file( - plistlib.writePlistToString(Info), - os.path.basename(Info_plist), - "Info.plist") - - # CEF framework goes inside viewer_app/Contents/Frameworks. - # Remember where we parked this car. - with self.prefix(src="", dst="Frameworks"): - CEF_framework = "Chromium Embedded Framework.framework" - self.path2basename(relpkgdir, CEF_framework) - CEF_framework = self.dst_path_of(CEF_framework) - - with self.prefix(dst="MacOS"): - # CMake constructs the Second Life executable in the - # MacOS directory belonging to the top-level Second - # Life.app. Move it here. - here = self.get_dst_prefix() - relbase = os.path.realpath(os.path.dirname(Info_plist)) - self.cmakedirs(here) - for f in os.listdir(toplevel_MacOS): - if f == os.path.basename(trampoline): - # don't move the trampoline script we just made! - continue - fromwhere = os.path.join(toplevel_MacOS, f) - towhere = os.path.join(here, f) - print "Moving %s => %s" % \ - (self.relpath(fromwhere, relbase), - self.relpath(towhere, relbase)) - # now do it, only without relativizing paths - os.rename(fromwhere, towhere) - - # NOTE: the -S argument to strip causes it to keep - # enough info for annotated backtraces (i.e. function - # names in the crash log). 'strip' with no arguments - # yields a slightly smaller binary but makes crash - # logs mostly useless. This may be desirable for the - # final release. Or not. - if ("package" in self.args['actions'] or - "unpacked" in self.args['actions']): - self.run_command( - ['strip', '-S', self.dst_path_of('Second Life')]) - - with self.prefix(dst="Resources"): - # defer cross-platform file copies until we're in the right - # nested Resources directory - super(DarwinManifest, self).construct() - - with self.prefix(src=self.icon_path(), dst="") : - self.path(viewer_icon) - - with self.prefix(src=relpkgdir, dst=""): - self.path("libndofdev.dylib") - self.path("libhunspell-1.3.0.dylib") - - with self.prefix("cursors_mac"): - self.path("*.tif") - - self.path("licenses-mac.txt", dst="licenses.txt") - self.path("featuretable_mac.txt") - self.path("SecondLife.nib") - - with self.prefix(src=pkgdir,dst=""): - self.path("ca-bundle.crt") - - self.path("SecondLife.nib") - - # Translations - self.path("English.lproj/language.txt") - self.replace_in(src="English.lproj/InfoPlist.strings", - dst="English.lproj/InfoPlist.strings", - searchdict={'%%VERSION%%':'.'.join(self.args['version'])} - ) - self.path("German.lproj") - self.path("Japanese.lproj") - self.path("Korean.lproj") - self.path("da.lproj") - self.path("es.lproj") - self.path("fr.lproj") - self.path("hu.lproj") - self.path("it.lproj") - self.path("nl.lproj") - self.path("pl.lproj") - self.path("pt.lproj") - self.path("ru.lproj") - self.path("tr.lproj") - self.path("uk.lproj") - self.path("zh-Hans.lproj") - - def path_optional(src, dst): - """ - For a number of our self.path() calls, not only do we want - to deal with the absence of src, we also want to remember - which were present. Return either an empty list (absent) - or a list containing dst (present). Concatenate these - return values to get a list of all libs that are present. - """ - # This was simple before we started needing to pass - # wildcards. Fortunately, self.path() ends up appending a - # (source, dest) pair to self.file_list for every expanded - # file processed. Remember its size before the call. - oldlen = len(self.file_list) - self.path(src, dst) - # The dest appended to self.file_list has been prepended - # with self.get_dst_prefix(). Strip it off again. - added = [os.path.relpath(d, self.get_dst_prefix()) - for s, d in self.file_list[oldlen:]] - if not added: - print "Skipping %s" % dst - return added - - # dylibs is a list of all the .dylib files we expect to need - # in our bundled sub-apps. For each of these we'll create a - # symlink from sub-app/Contents/Resources to the real .dylib. - # Need to get the llcommon dll from any of the build directories as well. - libfile_parent = self.get_dst_prefix() - libfile = "libllcommon.dylib" - dylibs = path_optional(self.find_existing_file(os.path.join(os.pardir, - "llcommon", - self.args['configuration'], - libfile), - os.path.join(relpkgdir, libfile)), - dst=libfile) - - for libfile in ( - "libapr-1.0.dylib", - "libaprutil-1.0.dylib", - "libcollada14dom.dylib", - "libexpat.1.dylib", - "libexception_handler.dylib", - "libGLOD.dylib", - # libnghttp2.dylib is a symlink to - # libnghttp2.major.dylib, which is a symlink to - # libnghttp2.version.dylib. Get all of them. - "libnghttp2.*dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - - # SLVoice and vivox lols, no symlinks needed - for libfile in ( - 'libortp.dylib', - 'libsndfile.dylib', - 'libvivoxoal.dylib', - 'libvivoxsdk.dylib', - 'libvivoxplatform.dylib', - 'SLVoice', - ): - self.path2basename(relpkgdir, libfile) - - # dylibs that vary based on configuration - if self.args['configuration'].lower() == 'debug': - for libfile in ( - "libfmodexL.dylib", - ): - dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) - else: - for libfile in ( - "libfmodex.dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - - # our apps - executable_path = {} - for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), - # plugin launcher - (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), - ): - self.path2basename(os.path.join(os.pardir, - app_bld_dir, self.args['configuration']), - app) - executable_path[app] = \ - self.dst_path_of(os.path.join(app, "Contents", "MacOS")) - - # our apps dependencies on shared libs - # for each app, for each dylib we collected in dylibs, - # create a symlink to the real copy of the dylib. - with self.prefix(dst=os.path.join(app, "Contents", "Resources")): - for libfile in dylibs: - self.relsymlinkf(os.path.join(libfile_parent, libfile)) - - # Dullahan helper apps go inside SLPlugin.app - with self.prefix(dst=os.path.join( - "SLPlugin.app", "Contents", "Frameworks")): - - frameworkname = 'Chromium Embedded Framework' - - # This code constructs a relative symlink from the - # target framework folder back to the real CEF framework. - # It needs to be relative so that the symlink still works when - # (as is normal) the user moves the app bundle out of the DMG - # and into the /Applications folder. Note we pass catch=False, - # letting the uncaught exception terminate the process, since - # without this symlink, Second Life web media can't possibly work. - - # It might seem simpler just to symlink Frameworks back to - # the parent of Chromimum Embedded Framework.framework. But - # that would create a symlink cycle, which breaks our - # packaging step. So make a symlink from Chromium Embedded - # Framework.framework to the directory of the same name, which - # is NOT an ancestor of the symlink. - - # from SLPlugin.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework - SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False) - - # copy DullahanHelper.app - self.path2basename(relpkgdir, 'DullahanHelper.app') - - # and fix that up with a Frameworks/CEF symlink too - with self.prefix(dst=os.path.join( - 'DullahanHelper.app', 'Contents', 'Frameworks')): - # from Dullahan Helper.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework - # Since SLPlugin_framework is itself a - # symlink, don't let relsymlinkf() resolve -- - # explicitly call relpath(symlink=True) and - # create that symlink here. - DullahanHelper_framework = \ - self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), - catch=False) - - # change_command includes install_name_tool, the - # -change subcommand and the old framework rpath - # stamped into the executable. To use it with - # run_command(), we must still append the new - # framework path and the pathname of the - # executable to change. - change_command = [ - 'install_name_tool', '-change', - '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework'] - - with self.prefix(dst=os.path.join( - 'DullahanHelper.app', 'Contents', 'MacOS')): - # Now self.get_dst_prefix() is, at runtime, - # @executable_path. Locate the helper app - # framework (which is a symlink) from here. - newpath = os.path.join( - '@executable_path', - self.relpath(DullahanHelper_framework, symlink=True), - frameworkname) - # and restamp the DullahanHelper executable - self.run_command( - change_command + - [newpath, self.dst_path_of('DullahanHelper')]) - - # SLPlugin plugins - with self.prefix(dst="llplugin"): - dylibexecutable = 'media_plugin_cef.dylib' - self.path2basename("../media_plugins/cef/" + self.args['configuration'], - dylibexecutable) - - # Do this install_name_tool *after* media plugin is copied over. - # Locate the framework lib executable -- relative to - # SLPlugin.app/Contents/MacOS, which will be our - # @executable_path at runtime! - newpath = os.path.join( - '@executable_path', - self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"], - symlink=True), - frameworkname) - # restamp media_plugin_cef.dylib - self.run_command( - change_command + - [newpath, self.dst_path_of(dylibexecutable)]) - - # copy LibVLC plugin itself - self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], - "media_plugin_libvlc.dylib") - - # copy LibVLC dynamic libraries - with self.prefix(src=relpkgdir, dst="lib"): - self.path( "libvlc*.dylib*" ) - # copy LibVLC plugins folder - with self.prefix(src='plugins', dst=""): - self.path( "*.dylib" ) - self.path( "plugins.dat" ) + self.path("secondlife.icns") + + with self.prefix(src=relpkgdir, dst=""): + self.path("libndofdev.dylib") + self.path("libhunspell-1.3.0.dylib") + + with self.prefix("cursors_mac"): + self.path("*.tif") + + self.path("licenses-mac.txt", dst="licenses.txt") + self.path("featuretable_mac.txt") + self.path("SecondLife.nib") + + with self.prefix(src=pkgdir,dst=""): + self.path("ca-bundle.crt") + + self.path("SecondLife.nib") + + # Translations + self.path("English.lproj/language.txt") + self.replace_in(src="English.lproj/InfoPlist.strings", + dst="English.lproj/InfoPlist.strings", + searchdict={'%%VERSION%%':'.'.join(self.args['version'])} + ) + self.path("German.lproj") + self.path("Japanese.lproj") + self.path("Korean.lproj") + self.path("da.lproj") + self.path("es.lproj") + self.path("fr.lproj") + self.path("hu.lproj") + self.path("it.lproj") + self.path("nl.lproj") + self.path("pl.lproj") + self.path("pt.lproj") + self.path("ru.lproj") + self.path("tr.lproj") + self.path("uk.lproj") + self.path("zh-Hans.lproj") + + def path_optional(src, dst): + """ + For a number of our self.path() calls, not only do we want + to deal with the absence of src, we also want to remember + which were present. Return either an empty list (absent) + or a list containing dst (present). Concatenate these + return values to get a list of all libs that are present. + """ + # This was simple before we started needing to pass + # wildcards. Fortunately, self.path() ends up appending a + # (source, dest) pair to self.file_list for every expanded + # file processed. Remember its size before the call. + oldlen = len(self.file_list) + self.path(src, dst) + # The dest appended to self.file_list has been prepended + # with self.get_dst_prefix(). Strip it off again. + added = [os.path.relpath(d, self.get_dst_prefix()) + for s, d in self.file_list[oldlen:]] + if not added: + print "Skipping %s" % dst + return added + + # dylibs is a list of all the .dylib files we expect to need + # in our bundled sub-apps. For each of these we'll create a + # symlink from sub-app/Contents/Resources to the real .dylib. + # Need to get the llcommon dll from any of the build directories as well. + libfile_parent = self.get_dst_prefix() + libfile = "libllcommon.dylib" + dylibs = path_optional(self.find_existing_file(os.path.join(os.pardir, + "llcommon", + self.args['configuration'], + libfile), + os.path.join(relpkgdir, libfile)), + dst=libfile) + + for libfile in ( + "libapr-1.0.dylib", + "libaprutil-1.0.dylib", + "libcollada14dom.dylib", + "libexpat.1.dylib", + "libexception_handler.dylib", + "libGLOD.dylib", + # libnghttp2.dylib is a symlink to + # libnghttp2.major.dylib, which is a symlink to + # libnghttp2.version.dylib. Get all of them. + "libnghttp2.*dylib", + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + + # SLVoice and vivox lols, no symlinks needed + for libfile in ( + 'libortp.dylib', + 'libsndfile.dylib', + 'libvivoxoal.dylib', + 'libvivoxsdk.dylib', + 'libvivoxplatform.dylib', + 'SLVoice', + ): + self.path2basename(relpkgdir, libfile) + + # dylibs that vary based on configuration + if self.args['configuration'].lower() == 'debug': + for libfile in ( + "libfmodexL.dylib", + ): + dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) + else: + for libfile in ( + "libfmodex.dylib", + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + + # our apps + executable_path = {} + for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), + # plugin launcher + (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), + ): + self.path2basename(os.path.join(os.pardir, + app_bld_dir, self.args['configuration']), + app) + executable_path[app] = \ + self.dst_path_of(os.path.join(app, "Contents", "MacOS")) + + # our apps dependencies on shared libs + # for each app, for each dylib we collected in dylibs, + # create a symlink to the real copy of the dylib. + with self.prefix(dst=os.path.join(app, "Contents", "Resources")): + for libfile in dylibs: + self.relsymlinkf(os.path.join(libfile_parent, libfile)) + + # Dullahan helper apps go inside SLPlugin.app + with self.prefix(dst=os.path.join( + "SLPlugin.app", "Contents", "Frameworks")): + + frameworkname = 'Chromium Embedded Framework' + + # This code constructs a relative symlink from the + # target framework folder back to the real CEF framework. + # It needs to be relative so that the symlink still works when + # (as is normal) the user moves the app bundle out of the DMG + # and into the /Applications folder. Note we pass catch=False, + # letting the uncaught exception terminate the process, since + # without this symlink, Second Life web media can't possibly work. + + # It might seem simpler just to symlink Frameworks back to + # the parent of Chromimum Embedded Framework.framework. But + # that would create a symlink cycle, which breaks our + # packaging step. So make a symlink from Chromium Embedded + # Framework.framework to the directory of the same name, which + # is NOT an ancestor of the symlink. + + # from SLPlugin.app/Contents/Frameworks/Chromium Embedded + # Framework.framework back to + # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework + SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False) + + # copy DullahanHelper.app + self.path2basename(relpkgdir, 'DullahanHelper.app') + + # and fix that up with a Frameworks/CEF symlink too + with self.prefix(dst=os.path.join( + 'DullahanHelper.app', 'Contents', 'Frameworks')): + # from Dullahan Helper.app/Contents/Frameworks/Chromium Embedded + # Framework.framework back to + # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework + # Since SLPlugin_framework is itself a + # symlink, don't let relsymlinkf() resolve -- + # explicitly call relpath(symlink=True) and + # create that symlink here. + DullahanHelper_framework = \ + self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), + catch=False) + + # change_command includes install_name_tool, the + # -change subcommand and the old framework rpath + # stamped into the executable. To use it with + # run_command(), we must still append the new + # framework path and the pathname of the + # executable to change. + change_command = [ + 'install_name_tool', '-change', + '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework'] + + with self.prefix(dst=os.path.join( + 'DullahanHelper.app', 'Contents', 'MacOS')): + # Now self.get_dst_prefix() is, at runtime, + # @executable_path. Locate the helper app + # framework (which is a symlink) from here. + newpath = os.path.join( + '@executable_path', + self.relpath(DullahanHelper_framework, symlink=True), + frameworkname) + # and restamp the DullahanHelper executable + self.run_command( + change_command + + [newpath, self.dst_path_of('DullahanHelper')]) + + # SLPlugin plugins + with self.prefix(dst="llplugin"): + dylibexecutable = 'media_plugin_cef.dylib' + self.path2basename("../media_plugins/cef/" + self.args['configuration'], + dylibexecutable) + + # Do this install_name_tool *after* media plugin is copied over. + # Locate the framework lib executable -- relative to + # SLPlugin.app/Contents/MacOS, which will be our + # @executable_path at runtime! + newpath = os.path.join( + '@executable_path', + self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"], + symlink=True), + frameworkname) + # restamp media_plugin_cef.dylib + self.run_command( + change_command + + [newpath, self.dst_path_of(dylibexecutable)]) + + # copy LibVLC plugin itself + self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], + "media_plugin_libvlc.dylib") + + # copy LibVLC dynamic libraries + with self.prefix(src=relpkgdir, dst="lib"): + self.path( "libvlc*.dylib*" ) + # copy LibVLC plugins folder + with self.prefix(src='plugins', dst=""): + self.path( "*.dylib" ) + self.path( "plugins.dat" ) def package_finish(self): global CHANNEL_VENDOR_BASE -- cgit v1.2.3 From a74b3691aff94dfbd0fbfdce05f8a03168328ca7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sun, 9 Sep 2018 09:22:06 -0400 Subject: DRTVWR-474, MAINT-9047: Make viewer_manifest use same bundle name. --- indra/newview/viewer_manifest.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 14ff2c194e..bddacf357d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -871,6 +871,9 @@ class Windows_x86_64_Manifest(WindowsManifest): class DarwinManifest(ViewerManifest): build_data_json_platform = 'mac' + def app_bundle(self): + return self.app_name() + ".app" + def finish_build_data_dict(self, build_data_dict): build_data_dict.update({'Bundle Id':self.args['bundleid']}) return build_data_dict @@ -881,7 +884,10 @@ 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'], "Second Life.app"), dst="") + # Second Life.app is what CMake / Xcode builds + # self.app_bundle() is what we ultimately expect to sign and package + self.path(os.path.join(self.args['configuration'], "Second Life.app"), + dst=self.app_bundle()) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -930,8 +936,6 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") - self.path("SecondLife.nib") - # Translations self.path("English.lproj/language.txt") self.replace_in(src="English.lproj/InfoPlist.strings", @@ -1180,8 +1184,6 @@ class DarwinManifest(ViewerManifest): # 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 @@ -1195,7 +1197,7 @@ class DarwinManifest(ViewerManifest): if not os.path.exists (self.src_path_of(dmg_template)): dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') - for s,d in {self.get_dst_prefix():app_name + ".app", + for s,d in {self.get_dst_prefix(): self.app_bundle(), 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(): @@ -1238,7 +1240,7 @@ class DarwinManifest(ViewerManifest): # 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") + app_in_dmg=os.path.join(volpath,self.app_bundle()) print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] if identity == '': @@ -1293,9 +1295,6 @@ class DarwinManifest(ViewerManifest): raise self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg]) - imagename="SecondLife_" + '_'.join(self.args['version']) - - finally: # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From 886da87c43447040afbafa6628e158e66965141d Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 10 Sep 2018 09:31:08 -0400 Subject: by default print location in log files --- indra/newview/app_settings/logcontrol.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 8ced81fdb3..71445ea541 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -2,6 +2,7 @@ default-level INFO + print-location true settings -- cgit v1.2.3 From 299d4807ab6bc35c3643134a142fb59d5931bed9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 10 Sep 2018 12:23:42 -0400 Subject: DRTVWR-474, MAINT-9047: Back out changeset 2ed01671b974. We'll try to address the Mac app bundle name discrepancy a different way. --- indra/newview/viewer_manifest.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index bddacf357d..14ff2c194e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -871,9 +871,6 @@ class Windows_x86_64_Manifest(WindowsManifest): class DarwinManifest(ViewerManifest): build_data_json_platform = 'mac' - def app_bundle(self): - return self.app_name() + ".app" - def finish_build_data_dict(self, build_data_dict): build_data_dict.update({'Bundle Id':self.args['bundleid']}) return build_data_dict @@ -884,10 +881,7 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) - # Second Life.app is what CMake / Xcode builds - # self.app_bundle() is what we ultimately expect to sign and package - self.path(os.path.join(self.args['configuration'], "Second Life.app"), - dst=self.app_bundle()) + self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -936,6 +930,8 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") + self.path("SecondLife.nib") + # Translations self.path("English.lproj/language.txt") self.replace_in(src="English.lproj/InfoPlist.strings", @@ -1184,6 +1180,8 @@ class DarwinManifest(ViewerManifest): # 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 @@ -1197,7 +1195,7 @@ class DarwinManifest(ViewerManifest): if not os.path.exists (self.src_path_of(dmg_template)): dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') - for s,d in {self.get_dst_prefix(): self.app_bundle(), + for s,d in {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(): @@ -1240,7 +1238,7 @@ class DarwinManifest(ViewerManifest): # 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_bundle()) + 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 == '': @@ -1295,6 +1293,9 @@ class DarwinManifest(ViewerManifest): raise self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg]) + imagename="SecondLife_" + '_'.join(self.args['version']) + + finally: # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From 298a52f96a92f4368b3c5d955eab6b37a58f4931 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 10 Sep 2018 17:01:53 -0400 Subject: DRTVWR-474, MAINT-9047: Try *not* copying the viewer built by CMake. The start of viewer_manifest.DarwinManifest.construct() is a path() call to copy the whole viewer tree from where CMake constructs it. The comment is: "(this is a no-op if run within the xcode script)." Unfortunately, for unclear reasons, this has recently started nesting Second Life.app within the Second Life.app directory, and even to multiple levels. When that happens, copying the outermost .app directory to the sparseimage in order to convert to dmg runs out of room because we're trying to pack multiple copies of the whole viewer tree into the fixed-size sparseimage. But if it works to simply skip that entire initial copy operation, so much the better. --- indra/newview/viewer_manifest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 14ff2c194e..d16b5d9a7c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -880,8 +880,8 @@ class DarwinManifest(ViewerManifest): return True 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'], "Second Life.app"), dst="") +## # copy over the build result (this is a no-op if run within the xcode script) +## self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -1238,6 +1238,11 @@ class DarwinManifest(ViewerManifest): # the signature are preserved; moving the files using python will leave them behind # and invalidate the signatures. if 'signature' in self.args: + print 72*'=' + print 'In {}:'.format(volpath) + for f in os.listdir(volpath): + print ' {}'.format(f) + print 72*'=' app_in_dmg=os.path.join(volpath,self.app_name()+".app") print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] -- cgit v1.2.3 From e0467f506136dd1fa044da130c7ffd3e817acc07 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 09:18:56 -0400 Subject: DRTVWR-474, MAINT-9047: Must copy CMake-built viewer for EDU. --- indra/newview/viewer_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index d16b5d9a7c..4e6c112cda 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -880,8 +880,8 @@ class DarwinManifest(ViewerManifest): return True 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'], "Second Life.app"), dst="") + # copy over the build result (this is a no-op if run within the xcode script) + self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From c6865bcd366379028029a24281812cf320de8aff Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 13:56:21 -0400 Subject: DRTVWR-474, MAINT-9047: Make failing spctl command more verbose. --- 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 4e6c112cda..de296bec75 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1296,7 +1296,7 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise - self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg]) + self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) imagename="SecondLife_" + '_'.join(self.args['version']) -- cgit v1.2.3 From 517e1605e9feb203c9ccd9a115a21cae9bbc704b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 16:04:33 -0400 Subject: DRTVWR-474, MAINT-9047: Display top-level app bundle in sparseimage. codesign claims to succeed, but spctl says: /Volumes/Second Life Installer/Second Life Test.app: rejected (the code is valid but does not seem to be an app) Why not? Display what's in Second Life.app/Contents on the mounted sparseimage: show Info.plist, list Frameworks, MacOS, Resources. --- indra/newview/viewer_manifest.py | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index de296bec75..5078f323ae 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1238,11 +1238,6 @@ class DarwinManifest(ViewerManifest): # the signature are preserved; moving the files using python will leave them behind # and invalidate the signatures. if 'signature' in self.args: - print 72*'=' - print 'In {}:'.format(volpath) - for f in os.listdir(volpath): - print ' {}'.format(f) - print 72*'=' app_in_dmg=os.path.join(volpath,self.app_name()+".app") print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] @@ -1296,11 +1291,36 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise + print 72*'=' + import stat + print app_in_dmg + # Second Life.app + for sub0 in os.listdir(app_in_dmg): + print '--{}'.format(sub0) + path0 = os.path.join(app_in_dmg, sub0) + if os.path.isfile(path0): + # shouldn't be any file here + with open(path0) as inf: + for line in inf: + print ' {}'.format(line.rstrip()) + elif os.path.isdir(path0): + # Contents + for sub1 in os.listdir(path0): + print '----{}'.format(sub1) + path1 = os.path.join(path0, sub1) + if os.path.isfile(path1): + # Info.plist, PkgInfo + with open(path1) as inf: + for line in inf: + print ' {}'.format(line.rstrip()) + elif os.path.isdir(path1): + # Frameworks, MacOS, Resources + for sub2 in os.listdir(path1): + path2 = os.path.join(path1, sub2) + print ' {:04o} {}'.format(stat.S_IMODE(os.stat(path2).st_mode), sub2) + print 72*'=' self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) - imagename="SecondLife_" + '_'.join(self.args['version']) - - finally: # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From e3d16dcb70da26c7952b45252b74716b1a632b97 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 19:57:42 -0400 Subject: DRTVWR-474: Remove nag about SL_Launcher. --- indra/newview/llappviewer.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 687b76c224..dd1d4cea39 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1083,26 +1083,6 @@ bool LLAppViewer::init() } } -// don't nag developers who need to run the executable directly -#if LL_RELEASE_FOR_DOWNLOAD - // MAINT-8305: If we're processing a SLURL, skip the launcher check. - if (gSavedSettings.getString("CmdLineLoginLocation").empty()) - { - const char* PARENT = getenv("PARENT"); - if (! (PARENT && std::string(PARENT) == "SL_Launcher")) - { - // Don't directly run this executable. Please run the launcher, which - // will run the viewer itself. - // Naturally we do not consider this bulletproof. The point is to - // gently remind a user who *inadvertently* finds him/herself in this - // situation to do things the Right Way. Anyone who intentionally - // bypasses this mechanism needs no reminder that s/he's shooting - // him/herself in the foot. - LLNotificationsUtil::add("RunLauncher"); - } - } -#endif - #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) { -- cgit v1.2.3 From aaf45f0f63a1c79393e6316e04f78476d2a2af6e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 19:59:03 -0400 Subject: DRTVWR-474, MAINT-9047: Set viewer name in Info.plist, not launcher. --- indra/newview/CMakeLists.txt | 8 +------- indra/newview/Info-SecondLife.plist | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2fc722d4c3..212677717e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2056,13 +2056,7 @@ endif (LINUX) if (DARWIN) # These all get set with PROPERTIES set(product "Second Life") - # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist - if (PACKAGE) - set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") - else (PACKAGE) - # force the name of the actual executable to allow running it within Xcode for debugging - set(MACOSX_WRAPPER_EXECUTABLE_NAME "../Resources/Second Life Viewer.app/Contents/MacOS/Second Life") - endif (PACKAGE) + set(MACOSX_EXECUTABLE_NAME "Second Life") set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index af4cf26ac6..31b4201f47 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleExecutable - ${MACOSX_WRAPPER_EXECUTABLE_NAME} + ${MACOSX_EXECUTABLE_NAME} CFBundleGetInfoString ${MACOSX_BUNDLE_INFO_STRING} CFBundleIconFile -- cgit v1.2.3 From 2081b8a654fa78c4414ec2619522c8ef461a1881 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Sep 2018 12:15:41 -0400 Subject: DRTVWR-474: Make NSIS run new updater.exe after install. But change shortcuts and registry entries and everything else back to the real viewer executable, so that every subsequent run directly launches the viewer. Eliminate SL_Launcher references from viewer_manifest.py. --- .../installers/windows/installer_template.nsi | 41 ++++++++++++++-------- indra/newview/viewer_manifest.py | 9 +++-- 2 files changed, 31 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 14c8dba39f..c53d7989fc 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -299,7 +299,7 @@ StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT" SetOutPath "$INSTDIR" CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \ @@ -317,9 +317,9 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ # Other shortcuts SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' @@ -327,7 +327,7 @@ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE" +WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$VIEWER_EXE" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "Publisher" "Linden Research, Inc." WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLInfoAbout" "http://secondlife.com/whatis/" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLUpdateInfo" "http://secondlife.com/support/downloads/" @@ -338,10 +338,10 @@ WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninst WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "EstimatedSize" "0x0001D500" # ~117 MB # from FS:Ansariel -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$INSTEXE"' +WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' # BUG-2707 Disable SEHOP for installed viewer. -WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" "DisableExceptionChainValidation" 1 +WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 # Write URL registry info WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" @@ -358,9 +358,8 @@ WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$ # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks. WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' -# Only allow Launcher to be the icon -WriteRegStr HKEY_CLASSES_ROOT "Applications\$INSTEXE" "IsHostApp" "" -WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" "" +WriteRegStr HKEY_CLASSES_ROOT "Applications\$VIEWER_EXE" "IsHostApp" "" +##WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" "" # Write out uninstaller WriteUninstaller "$INSTDIR\uninst.exe" @@ -398,8 +397,8 @@ Call un.CloseSecondLife DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" # BUG-2707 Remove entry that disabled SEHOP -DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" -DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" +DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" +##DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" DeleteRegKey HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" # Clean up shortcuts @@ -537,6 +536,7 @@ Function RemoveProgFilesOnInst # Remove old SecondLife.exe to invalidate any old shortcuts to it that may be in non-standard locations. See MAINT-3575 Delete "$INSTDIR\$INSTEXE" +Delete "$INSTDIR\$VIEWER_EXE" # Remove old shader files first so fallbacks will work. See DEV-5663 RMDir /r "$INSTDIR\app_settings\shaders" @@ -673,7 +673,7 @@ FunctionEnd ;; After install completes, launch app ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess -Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. + Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. Push $R0 Push $0 ;; MAINT-7812: Only write nsis.winstall file with /marker switch @@ -694,8 +694,21 @@ Call CheckWindowsServPack # Warn if not on the latest SP before asking to launc Pop $R0 Push $R0 # Option value, unused# StrCmp $SKIP_AUTORUN "true" +2; -# Assumes SetOutPath $INSTDIR - Exec '"$WINDIR\explorer.exe" "$INSTDIR\$INSTSHORTCUT.lnk"' + # Assumes SetOutPath $INSTDIR + # Run INSTEXE (our updater), passing VIEWER_EXE plus the command-line + # arguments built into our shortcuts. This gives the updater a chance + # to verify that the viewer we just installed is appropriate for the + # running system -- or, if not, to download and install a different + # viewer. For instance, if a user running 32-bit Windows installs a + # 64-bit viewer, it cannot run on this system. But since the updater + # is a 32-bit executable even in the 64-bit viewer package, the + # updater can detect the problem and adapt accordingly. + # Once everything is in order, the updater will run the specified + # viewer with the specified params. + # Quote the updater executable and the viewer executable because each + # must be a distinct command-line token, but DO NOT quote the language + # string because it must decompose into separate command-line tokens. + Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 5078f323ae..6540aa9f6b 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -490,7 +490,7 @@ class WindowsManifest(ViewerManifest): with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): # include the compiled launcher scripts so that it gets included in the file_list - self.path('SL_Launcher.exe') + self.path('updater.exe') #IUM is not normally executed directly, just imported. No exe needed. self.path("InstallerUserMessage.py") @@ -768,7 +768,7 @@ class WindowsManifest(ViewerManifest): substitution_strings['installer_file'] = installer_file version_vars = """ - !define INSTEXE "SL_Launcher.exe" + !define INSTEXE "updater.exe" !define VERSION "%(version_short)s" !define VERSION_LONG "%(version)s" !define VERSION_DASHES "%(version_dashes)s" @@ -812,7 +812,7 @@ class WindowsManifest(ViewerManifest): # 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 ( - "SL_Launcher.exe", + "updater.exe", ): self.sign(exe) @@ -1376,7 +1376,6 @@ class LinuxManifest(ViewerManifest): self.path2basename("../llplugin/slplugin", "SLPlugin") #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 with self.prefix(src="../viewer_components/manager", dst=""): - self.path("SL_Launcher") self.path("*.py") with self.prefix(src=os.path.join("lib", "python", "llbase"), dst="llbase"): self.path("*.py") @@ -1455,7 +1454,7 @@ class LinuxManifest(ViewerManifest): self.run_command( ["find"] + [os.path.join(self.get_dst_prefix(), dir) for dir in ('bin', 'lib')] + - ['-type', 'f', '!', '-name', '*.py', '!', '-name', 'SL_Launcher', + ['-type', 'f', '!', '-name', '*.py', '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) class Linux_i686_Manifest(LinuxManifest): -- cgit v1.2.3 From d41245f252442d91432f06b039abea81831cc083 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Sep 2018 20:13:53 -0400 Subject: DRTVWR-474: $VIEWER_EXE, rather than plain VIEWER_EXE --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index c53d7989fc..3117cf6b85 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -708,7 +708,7 @@ Function .onInstSuccess # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From 289813994eb492d16e3af0fa30835e2b26a84ced Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:20:05 -0400 Subject: DRTVWR-474: Clean up use of LLDir::getAppRODataDir(), esp. on Mac. Clearly it's not obvious to maintainers that on the Mac, getAppRODataDir() returns the app's Resources directory: in a number of places the code starts with the executable directory and appends "../Resources" to find that. --- indra/newview/llstartup.cpp | 3 +-- indra/newview/llvoicevivox.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7a4c41779a..4c51873715 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -479,8 +479,7 @@ bool idle_startup() if (!found_template) { message_template_path = - gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, - "../Resources/app_settings", + gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "message_template.msg"); found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */ } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index b90e09b739..88d17a31a4 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -770,14 +770,13 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() { #ifndef VIVOXDAEMON_REMOTEHOST // Launch the voice daemon - std::string exe_path = gDirUtilp->getExecutableDir(); - exe_path += gDirUtilp->getDirDelimiter(); + std::string exe_path = gDirUtilp->getAppRODataDir(); #if LL_WINDOWS - exe_path += "SLVoice.exe"; + gDirUtilp->append(exe_path, "SLVoice.exe"); #elif LL_DARWIN - exe_path += "../Resources/SLVoice"; + gDirUtilp->append(exe_path, "SLVoice"); #else - exe_path += "SLVoice"; + gDirUtilp->append(exe_path, "SLVoice"); #endif // See if the vivox executable exists llstat s; -- cgit v1.2.3 From 83b40329fd822277ff5b47e6f36a7897c85e6260 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:22:38 -0400 Subject: DRTVWR-474: Make NSIS installer invoke updater precheck subcommand. --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 3117cf6b85..76187b49a5 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -708,7 +708,7 @@ Function .onInstSuccess # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From cc99cd65cf0355f201157d8f71743899af6f2ade Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:23:45 -0400 Subject: DRTVWR-474: Copy updater and its icons into Mac app's Resources. --- indra/newview/viewer_manifest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 6540aa9f6b..32ff7f6ea8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -470,7 +470,7 @@ class WindowsManifest(ViewerManifest): pass except NoMatchingAssemblyException as err: pass - + self.ccopy(src,dst) else: raise Exception("Directories are not supported by test_CRT_and_copy_action()") @@ -916,6 +916,15 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=self.icon_path(), dst="") : self.path("secondlife.icns") + # Copy in the updater script and helper modules + self.path(src=os.path.join(pkgdir, 'VMP'), dst="updater") + + with self.prefix(src="", dst=os.path.join("updater", "icons")): + self.path2basename(os.path.join(self.icon_path(), "secondlife.ico")) + with self.prefix(src="vmp_icons", dst=""): + self.path("*.png") + self.path("*.gif") + with self.prefix(src=relpkgdir, dst=""): self.path("libndofdev.dylib") self.path("libhunspell-1.3.0.dylib") -- cgit v1.2.3 From a6e2201d2cff8fe03c83a75a2766d1ab71d35a21 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:24:53 -0400 Subject: DRTVWR-474: Run the new updater in LEAP mode. --- indra/newview/llappviewer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dd1d4cea39..68bb20386a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,6 +1130,21 @@ bool LLAppViewer::init() gGLActive = FALSE; +#if LL_WINDOWS + std::string updater( + "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") + "\""); +#elif LL_DARWIN + std::string updater( + "python \"" + gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") + "\""); +#else + std::string updater( + "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") + "\""); +#endif + + // Run the updater, specifying LEAP mode. An exception from the updater + // should bother us. + LLLeap::create("updater process", (updater + " leap"), true); + // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand")); -- cgit v1.2.3 From e00a8dee3f9675296df5c614b4483509c2ff55bb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 20:26:21 -0400 Subject: DRTVWR-474: Fix path2basename("secondlife.ico") call. --- 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 32ff7f6ea8..4f0f4b17d9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -920,7 +920,7 @@ class DarwinManifest(ViewerManifest): self.path(src=os.path.join(pkgdir, 'VMP'), dst="updater") with self.prefix(src="", dst=os.path.join("updater", "icons")): - self.path2basename(os.path.join(self.icon_path(), "secondlife.ico")) + self.path2basename(self.icon_path(), "secondlife.ico") with self.prefix(src="vmp_icons", dst=""): self.path("*.png") self.path("*.gif") -- cgit v1.2.3 From 807992adca4708bd2050b1fee8074d3e4521dd30 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 20:55:05 -0400 Subject: DRTVWR-474: Pass updater cmd to LLLeap::create() as vector. This avoids having to tokenize a single string, avoiding swallowing backslashes in Windows pathnames in the mistaken belief they're escape characters. Alternatively, it avoids us having to double-escape them or convert them to forward slashes or whatever. --- indra/newview/llappviewer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 68bb20386a..c0fcdd7c79 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1131,19 +1131,21 @@ bool LLAppViewer::init() gGLActive = FALSE; #if LL_WINDOWS - std::string updater( - "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") + "\""); + std::vector updater + { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; #elif LL_DARWIN - std::string updater( - "python \"" + gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") + "\""); + // explicitly run the system Python interpreter on updater.py + std::vector updater + { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; #else - std::string updater( - "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") + "\""); + std::vector updater + { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; #endif + // add LEAP mode command-line argument to whichever of these we selected + updater.push_back("leap"); - // Run the updater, specifying LEAP mode. An exception from the updater - // should bother us. - LLLeap::create("updater process", (updater + " leap"), true); + // Run the updater. An exception from the updater should bother us. + LLLeap::create("updater process", updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. -- cgit v1.2.3 From 8761e87ac526034f7a601eee5fdb667eba6eefda Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 24 Sep 2018 14:02:23 -0400 Subject: DRTVWR-474: Remove Python autobuild packages and references to them. We expect the viewer-manager package to be self-contained: we expect it to bring with it any Python packages it requires. We no longer force developers to wrap third-party Python packages as autobuild packages. --- indra/newview/CMakeLists.txt | 2 -- indra/newview/viewer_manifest.py | 8 -------- 2 files changed, 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 212677717e..e7111ebe54 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -16,7 +16,6 @@ include(GLOD) include(Hunspell) include(JsonCpp) include(LLAppearance) -include(LLBase) include(LLAudio) include(LLCA) include(LLCharacter) @@ -44,7 +43,6 @@ include(OPENAL) include(OpenGL) include(OpenSSL) include(PNG) -include(Requests) include(TemplateCheck) include(UI) include(UnixInstall) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4f0f4b17d9..57da87a3ee 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -502,11 +502,6 @@ class WindowsManifest(ViewerManifest): self.path("*.png") self.path("*.gif") - #before, we only needed llbase at build time. With VMP, we need it at run time. - with self.prefix(src=os.path.join(pkgdir, "lib", "python", "llbase"), dst="llbase"): - self.path("*.py") - self.path("_cllsd.so") - # Plugin host application self.path2basename(os.path.join(os.pardir, 'llplugin', 'slplugin', self.args['configuration']), @@ -1386,9 +1381,6 @@ class LinuxManifest(ViewerManifest): #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 with self.prefix(src="../viewer_components/manager", dst=""): self.path("*.py") - with self.prefix(src=os.path.join("lib", "python", "llbase"), dst="llbase"): - self.path("*.py") - self.path("_cllsd.so") # recurses, packaged again self.path("res-sdl") -- cgit v1.2.3 From 182a091ad961fb296aafc974509746a4dff54421 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 27 Sep 2018 17:41:26 -0400 Subject: DRTVWR-474: Pass the leap updater the parameters it requires. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8e8cce5787..26572a7917 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4316,6 +4316,17 @@ Value 96.0 + ForceAddressSize + + Comment + Force Windows update to 32-bit or 64-bit viewer. + Persist + 1 + Type + U32 + Value + 0 + ForceAssetFail Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5a374755f7..776fc85a2d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,21 +1130,29 @@ bool LLAppViewer::init() gGLActive = FALSE; -#if LL_WINDOWS std::vector updater +#if LL_WINDOWS { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; #elif LL_DARWIN // explicitly run the system Python interpreter on updater.py - std::vector updater { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; #else - std::vector updater { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; #endif // add LEAP mode command-line argument to whichever of these we selected updater.push_back("leap"); - - // Run the updater. An exception from the updater should bother us. + // UpdaterServiceSettings + updater.push_back(stringize(gSavedSettings.getU32("UpdaterServiceSetting"))); + // channel + updater.push_back(LLVersionInfo::getChannel()); + // testok + updater.push_back(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); + // UpdaterServiceURL + updater.push_back(gSavedSettings.getString("UpdaterServiceURL")); + // ForceAddressSize + updater.push_back(stringize(gSavedSettings.getU32("ForceAddressSize"))); + + // Run the updater. An exception from launching the updater should bother us. LLLeap::create("updater process", updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if -- cgit v1.2.3 From 6e1b2e137e2b6c6d92d14f478b6908c0c2f1e231 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 28 Sep 2018 17:16:49 -0400 Subject: DRTVWR-474: Make SkipBenchmark a Persistent setting --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 26572a7917..ca13c60768 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16183,7 +16183,7 @@ if true, disables running the GPU benchmark at startup (default to class 1) Persist - 0 + 1 Type Boolean Value -- cgit v1.2.3 From b1955d4247a4d28a3a4c259036390ff632e80008 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 3 Oct 2018 14:00:05 -0400 Subject: DRTVWR-474: Do NOT autokill updater process on viewer termination. The updater is required to survive beyond termination of the viewer that launched it so it can launch the next installer, or a replacement viewer. Having the old viewer forcibly terminate it on shutdown would be counter- productive. Introduce a third LLLeap::create() overload taking LLProcess::Params, which gives access to autokill, cwd and other options previously unsupported by LLLeap. Reimplement the existing create() overloads in terms of this new one, since LLLeapImpl::LLLeapImpl() is already based on LLProcess::Params anyway. Use LLProcess::Params in LLAppViewer::init() to specify the updater process, setting autokill=false. Refactoring LLLeapImpl() apparently involved engaging an LLInitParam::Block feature never before used: had to drag operator() into Multiple from its base class TypedParam (as has been done in other TypedParam subclasses). --- indra/newview/llappviewer.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 776fc85a2d..bc4ce19f77 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,30 +1130,35 @@ bool LLAppViewer::init() gGLActive = FALSE; - std::vector updater + LLProcess::Params updater; + updater.desc = "updater process"; + // Because it's the updater, it MUST persist beyond the lifespan of the + // viewer itself. + updater.autokill = false; #if LL_WINDOWS - { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe"); #elif LL_DARWIN // explicitly run the system Python interpreter on updater.py - { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; + updater.executable = "python"; + updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py")); #else - { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater"); #endif // add LEAP mode command-line argument to whichever of these we selected - updater.push_back("leap"); + updater.args.add("leap"); // UpdaterServiceSettings - updater.push_back(stringize(gSavedSettings.getU32("UpdaterServiceSetting"))); + updater.args.add(stringize(gSavedSettings.getU32("UpdaterServiceSetting"))); // channel - updater.push_back(LLVersionInfo::getChannel()); + updater.args.add(LLVersionInfo::getChannel()); // testok - updater.push_back(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); + updater.args.add(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); // UpdaterServiceURL - updater.push_back(gSavedSettings.getString("UpdaterServiceURL")); + updater.args.add(gSavedSettings.getString("UpdaterServiceURL")); // ForceAddressSize - updater.push_back(stringize(gSavedSettings.getU32("ForceAddressSize"))); + updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); // Run the updater. An exception from launching the updater should bother us. - LLLeap::create("updater process", updater, true); + LLLeap::create(updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. @@ -3923,12 +3928,6 @@ void LLAppViewer::requestQuit() gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent. } - // Try to send last batch of avatar rez metrics. - if (!gDisconnected && isAgentAvatarValid()) - { - gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent. - } - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); -- cgit v1.2.3 From 05068186c349294caf4fef3c970f9d75a9f30460 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 4 Oct 2018 16:35:38 -0400 Subject: DRTVWR-474: Make login coroutine sync with updater process on failure. Specifically, introduce an LLEventMailDrop("LoginSync"). When the updater detects that an update is required, it will post to that rendezvous point. When login.cgi responds with login failure, make the login coroutine wait (a few seconds) for that ping from the updater. If we receive that ping and if it contains a "reply" key, make the fail.login listener respond to the updater with an indication of whether to proceed with update. If both login.cgi and the updater concur that an update is required, produce a new confirmation message for the user and then (once user responds) tell the updater to proceed. Otherwise, produce the usual login-failure message and tell the updater never mind. Introduce LLCoro::OverrideConsuming to provide temporary save/restore of the set_consuming() / get_consuming() flag. It's a good idea to set the consuming flag when retrieving data from an LLEventMailDrop. --- indra/newview/lllogininstance.cpp | 63 ++++++++++++++++++---- indra/newview/lllogininstance.h | 6 ++- .../newview/skins/default/xui/en/notifications.xml | 13 ++++- 3 files changed, 71 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index bc93fa2c20..126c6be388 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -253,14 +253,12 @@ bool LLLoginInstance::handleLoginEvent(const LLSD& event) mLoginState = event["state"].asString(); mResponseData = event["data"]; - + if(event.has("transfer_rate")) { mTransferRate = event["transfer_rate"].asReal(); } - - // Call the method registered in constructor, if any, for more specific // handling mDispatcher.try_call(event); @@ -276,6 +274,14 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) // Login has failed. // Figure out why and respond... LLSD response = event["data"]; + LLSD updater = response["updater"]; + + // Always provide a response to the updater, if in fact the updater + // contacted us, if in fact the ping contains a 'reply' key. Most code + // paths tell it not to proceed with updating. + ResponsePtr resp(std::make_shared + (LLSDMap("update", false), updater)); + std::string reason_response = response["reason"].asString(); std::string message_response = response["message"].asString(); LL_DEBUGS("LLLogin") << "reason " << reason_response @@ -328,17 +334,44 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) } else if(reason_response == "update") { - // This shouldn't happen - the viewer manager should have forced an update; - // possibly the user ran the viewer directly and bypassed the update check + // This can happen if the user clicked Login quickly, before we heard + // back from the Viewer Version Manager, but login failed because + // login.cgi is insisting on a required update. We were called with an + // event that bundles both the login.cgi 'response' and the + // synchronization event from the 'updater'. std::string required_version = response["message_args"]["VERSION"]; LL_WARNS("LLLogin") << "Login failed because an update to version " << required_version << " is required." << LL_ENDL; if (gViewerWindow) gViewerWindow->setShowProgress(FALSE); - LLSD data(LLSD::emptyMap()); - data["VERSION"] = required_version; - LLNotificationsUtil::add("RequiredUpdate", data, LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2)); + LLSD args(LLSDMap("VERSION", required_version)); + if (updater.isUndefined()) + { + // If the updater failed to shake hands, better advise the user to + // download the update him/herself. + LLNotificationsUtil::add( + "RequiredUpdate", + args, + updater, + boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2)); + } + else + { + // If we've heard from the updater that an update is required, + // then display the prompt that assures the user we'll take care + // of it. This is the one case in which we bind 'resp': + // instead of destroying our Response object (and thus sending a + // negative reply to the updater) as soon as we exit this + // function, bind our shared_ptr so it gets passed into + // syncWithUpdater. That ensures that the response is delayed + // until the user has responded to the notification. + LLNotificationsUtil::add( + "PauseForUpdate", + args, + updater, + boost::bind(&LLLoginInstance::syncWithUpdater, this, resp, _1, _2)); + } } else if( reason_response == "key" || reason_response == "presence" @@ -361,6 +394,19 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) } } +void LLLoginInstance::syncWithUpdater(ResponsePtr resp, const LLSD& notification, const LLSD& response) +{ + LL_INFOS("LLLogin") << "LLLoginInstance::syncWithUpdater" << LL_ENDL; + // 'resp' points to an instance of LLEventAPI::Response that will be + // destroyed as soon as we return and the notification response functor is + // unregistered. Modify it so that it tells the updater to go ahead and + // perform the update. Naturally, if we allowed the user a choice as to + // whether to proceed or not, this assignment would reflect the user's + // selection. + (*resp)["update"] = true; + attemptComplete(); +} + void LLLoginInstance::handleLoginDisallowed(const LLSD& notification, const LLSD& response) { attemptComplete(); @@ -420,7 +466,6 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key) return true; } - std::string construct_start_string() { std::string start; diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 651ad10afb..b759b43474 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -28,8 +28,10 @@ #define LL_LLLOGININSTANCE_H #include "lleventdispatcher.h" +#include "lleventapi.h" #include #include +#include // std::shared_ptr #include "llsecapi.h" class LLLogin; class LLEventStream; @@ -68,6 +70,7 @@ public: LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } private: + typedef std::shared_ptr ResponsePtr; void constructAuthParams(LLPointer user_credentials); void updateApp(bool mandatory, const std::string& message); bool updateDialogCallback(const LLSD& notification, const LLSD& response); @@ -77,7 +80,8 @@ private: void handleLoginSuccess(const LLSD& event); void handleDisconnect(const LLSD& event); void handleIndeterminate(const LLSD& event); - void handleLoginDisallowed(const LLSD& notification, const LLSD& response); + void handleLoginDisallowed(const LLSD& notification, const LLSD& response); + void syncWithUpdater(ResponsePtr resp, const LLSD& notification, const LLSD& response); bool handleTOSResponse(bool v, const std::string& key); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9eaa5330c3..5f9b8adc89 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3841,7 +3841,6 @@ Finished download of raw terrain file to: name="RequiredUpdate" type="alertmodal"> Version [VERSION] is required for login. -This should have been updated for you but apparently was not. Please download from https://secondlife.com/support/downloads/ confirm + +Version [VERSION] is required for login. +Click OK to download and install. + confirm + + + Date: Fri, 5 Oct 2018 14:38:25 -0400 Subject: DRTVWR-474: Add OptionaUpdateReady, PromptOptionalUpdate notifications. --- .../newview/skins/default/xui/en/notifications.xml | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5f9b8adc89..e2859603e0 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3860,6 +3860,32 @@ Click OK to download and install. yestext="OK"/> + +Version [VERSION] has been downloaded and is ready to install. +Click OK to install. + confirm + + + + +Version [VERSION] has been downloaded and is ready to install. +Proceed? + confirm + + + Date: Thu, 11 Oct 2018 14:17:52 -0400 Subject: Modify logging so that the in-viewer console and stderr do not escape line breaks Improve the implementation so that escaping is computed only once --- indra/newview/app_settings/logcontrol.xml | 1 - indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llappviewer.cpp | 7 +------ indra/newview/llviewerwindow.cpp | 3 +++ 4 files changed, 4 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 71445ea541..8ced81fdb3 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -2,7 +2,6 @@ default-level INFO - print-location true settings diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8e8cce5787..44aa22b387 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13980,17 +13980,6 @@ Value 1 - VerboseLogs - - Comment - Display source file and line number for each log item for debugging purposes - Persist - 1 - Type - Boolean - Value - 0 - VertexShaderEnable Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dd82aa735f..b3f09a73a2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -885,11 +885,6 @@ bool LLAppViewer::init() mNumSessions++; gSavedSettings.setS32("NumSessions", mNumSessions); - if (gSavedSettings.getBOOL("VerboseLogs")) - { - LLError::setPrintLocation(true); - } - // LLKeyboard relies on LLUI to know what some accelerator keys are called. LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString ); @@ -1702,7 +1697,7 @@ bool LLAppViewer::cleanup() release_start_screen(); // just in case - LLError::logToFixedBuffer(NULL); + LLError::logToFixedBuffer(NULL); // stop the fixed buffer recorder LL_INFOS() << "Cleaning Up" << LL_ENDL; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 01ec703fe6..873d011acc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -306,6 +306,9 @@ private: RecordToChatConsole::RecordToChatConsole(): mRecorder(new RecordToChatConsoleRecorder()) { + mRecorder->showTags(false); + mRecorder->showLocation(false); + mRecorder->showMultiline(true); } //////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 9cdcef4d501f4a7fec3b1c7051037df9db082278 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 16 Oct 2018 16:53:06 -0400 Subject: DRTVWR-447: Use new attachmentsForBugsplatStartupManager SDK method to attach user settings file and static debug info file to Mac crash reports, as well as SecondLife.log, just like Windows crash reports. --- indra/newview/llappdelegate-objc.mm | 74 +++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index f55304f30b..1d55537427 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -26,6 +26,8 @@ #import "llappdelegate-objc.h" #if defined(LL_BUGSPLAT) +#include +#include @import BugsplatMac; // derived from BugsplatMac's BugsplatTester/AppDelegate.m @interface LLAppDelegate () @@ -271,25 +273,59 @@ infos("bugsplatStartupManagerWillSendCrashReport"); } -- (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - std::string logfile = CrashMetadata_instance().logFilePathname; - // Still to do: - // userSettingsPathname - // staticDebugPathname - // but the BugsplatMac version 1.0.5 BugsplatStartupManagerDelegate API - // doesn't yet provide a way to attach more than one file. - NSString *ns_logfile = [NSString stringWithCString:logfile.c_str() - encoding:NSUTF8StringEncoding]; - NSData *data = [NSData dataWithContentsOfFile:ns_logfile]; - - // Apologies for the hard-coded log-file basename, but I do not know the - // incantation for "$(basename "$logfile")" in this language. - BugsplatAttachment *attachment = - [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log" - attachmentData:data - contentType:@"text/plain"]; - infos("attachmentForBugsplatStartupManager attaching " + logfile); - return attachment; +struct AttachmentInfo +{ + AttachmentInfo(const std::string& path, const std::string& type): + pathname(path), + basename(boost::filesystem::path(path).filename().string()), + mimetype(type) + {} + + std::string pathname, basename, mimetype; +}; + +- (NSArray *)attachmentsForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager +{ + const CrashMetadata& metadata(CrashMetadata_instance()); + + // Since we must do very similar processing for each of several file + // pathnames, start by collecting them into a vector so we can iterate + // instead of spelling out the logic for each. + std::vector info{ + AttachmentInfo(metadata.logFilePathname, "text/plain"), + AttachmentInfo(metadata.userSettingsPathname, "text/xml"), + AttachmentInfo(metadata.staticDebugPathname, "text/xml") + }; + + // We "happen to know" that info[0].basename is "SecondLife.old" -- due to + // the fact that BugsplatMac only notices a crash during the viewer run + // following the crash. Replace .old with .log to reduce confusion. + info[0].basename = + boost::filesystem::path(info[0].pathname).stem().string() + ".log"; + + NSMutableArray *attachments = [[NSMutableArray alloc] init]; + + // Iterate over each AttachmentInfo in info vector + for (const AttachmentInfo& attach : info) + { + NSString *nspathname = [NSString stringWithCString:attach.pathname.c_str() + encoding:NSUTF8StringEncoding]; + NSString *nsbasename = [NSString stringWithCString:attach.basename.c_str() + encoding:NSUTF8StringEncoding]; + NSString *nsmimetype = [NSString stringWithCString:attach.mimetype.c_str() + encoding:NSUTF8StringEncoding]; + NSData *nsdata = [NSData dataWithContentsOfFile:nspathname]; + + BugsplatAttachment *attachment = + [[BugsplatAttachment alloc] initWithFilename:nsbasename + attachmentData:nsdata + contentType:nsmimetype]; + + [attachments addObject:attachment]; + infos("attachmentsForBugsplatStartupManager attaching " + attach.pathname); + } + + return attachments; } - (void)bugsplatStartupManagerDidFinishSendingCrashReport:(BugsplatStartupManager *)bugsplatStartupManager -- cgit v1.2.3 From d81863d23d49f3a71fb477d7e5c9d149b14da9f2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 Oct 2018 10:56:43 -0400 Subject: DRTVWR-447: Finish merging Poseidon into BugSplat --- indra/newview/CMakeLists.txt | 339 +++++++++++++++++++++++++++------------ indra/newview/viewer_manifest.py | 318 +++++++++++++++++++----------------- 2 files changed, 412 insertions(+), 245 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e7111ebe54..5c918fc3b2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -3,7 +3,14 @@ project(viewer) include(00-Common) +# DON'T move Linking.cmake to its place in the alphabetized list below: it +# sets variables on which the 3p .cmake files depend. +include(Linking) + include(Boost) +if (BUGSPLAT_DB) + include(bugsplat) +endif (BUGSPLAT_DB) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) @@ -36,7 +43,6 @@ include(LLUI) include(LLVFS) include(LLWindow) include(LLXML) -include(Linking) include(NDOF) include(NVAPI) include(OPENAL) @@ -91,6 +97,12 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) +if (BUGSPLAT_DB) + include_directories( + ${BUGSPLAT_INCLUDE_DIR} + ) +endif (BUGSPLAT_DB) + include_directories(SYSTEM ${LLCOMMON_SYSTEM_INCLUDE_DIRS} ${LLXML_SYSTEM_INCLUDE_DIRS} @@ -1354,6 +1366,14 @@ if (DARWIN) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) + set_source_files_properties( + llappdelegate-objc.mm + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + # BugsplatMac is a module, imported with @import. That language feature + # demands these switches. + COMPILE_FLAGS "-fmodules -fcxx-modules" + ) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1368,6 +1388,12 @@ if (DARWIN) ${COREAUDIO_LIBRARY} ) + if (BUGSPLAT_DB) + list(APPEND viewer_LIBRARIES + ${BUGSPLAT_LIBRARIES} + ) + endif (BUGSPLAT_DB) + # Add resource files to the project. set(viewer_RESOURCE_FILES secondlife.icns @@ -1393,6 +1419,11 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) + set_source_files_properties( + llappviewerlinux.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") @@ -1409,6 +1440,11 @@ if (WINDOWS) llappviewerwin32.cpp llwindebug.cpp ) + set_source_files_properties( + llappviewerwin32.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" + ) list(APPEND viewer_HEADER_FILES llappviewerwin32.h @@ -1691,6 +1727,11 @@ if (SDL_FOUND) ) endif (SDL_FOUND) +if (BUGSPLAT_DB) + set_property(TARGET ${VIEWER_BINARY_NAME} + PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT") +endif (BUGSPLAT_DB) + # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) @@ -1789,7 +1830,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll ) endif (FMODEX) - + add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat COMMAND ${PYTHON_EXECUTABLE} @@ -1798,15 +1839,16 @@ if (WINDOWS) --actions=copy --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py stage_third_party_libs @@ -1824,24 +1866,9 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin - windows-crash-logger + windows-crash-logger ) - # sets the 'working directory' for debugging from visual studio. - if (NOT UNATTENDED) - add_custom_command( - TARGET ${VIEWER_BINARY_NAME} POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe - ARGS - --solution - ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln - --workingdir - ${VIEWER_BINARY_NAME} - "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." - ) - endif (NOT UNATTENDED) - if (PACKAGE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 @@ -1864,15 +1891,16 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -1903,8 +1931,8 @@ else (WINDOWS) endif (WINDOWS) # *NOTE: - this list is very sensitive to ordering, test carefully on all -# platforms if you change the releative order of the entries here. -# In particular, cmake 2.6.4 (when buidling with linux/makefile generators) +# platforms if you change the relative order of the entries here. +# In particular, cmake 2.6.4 (when building with linux/makefile generators) # appears to sometimes de-duplicate redundantly listed dependencies improperly. # To work around this, higher level modules should be listed before the modules # that they depend upon. -brad @@ -1979,6 +2007,12 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLAPPEARANCE_LIBRARIES} ) +if (BUGSPLAT_DB) + target_link_libraries(${VIEWER_BINARY_NAME} + ${BUGSPLAT_LIBRARIES} + ) +endif (BUGSPLAT_DB) + set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") @@ -2002,15 +2036,16 @@ if (LINUX) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${COPY_INPUT_DEPENDENCIES} @@ -2024,17 +2059,18 @@ if (LINUX) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --arch=${ARCH} --actions=copy + --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${COPY_INPUT_DEPENDENCIES} @@ -2052,31 +2088,45 @@ if (LINUX) endif (LINUX) if (DARWIN) - # These all get set with PROPERTIES - set(product "Second Life") - set(MACOSX_EXECUTABLE_NAME "Second Life") - set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + # These all get set with PROPERTIES. It's not that the property names are + # magically known to CMake -- it's that these names are referenced in the + # Info-SecondLife.plist file in the configure_file() directive below. + set(product "${VIEWER_CHANNEL}") + set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + + # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ + set(CMAKE_MACOSX_RPATH 1) set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" + # From Contents/MacOS/SecondLife, look in Contents/Frameworks + INSTALL_RPATH "@loader_path/../Frameworks" + # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply + # does not work. Try this: + LINK_FLAGS "-rpath @loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) + set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app") + set(VIEWER_APP_EXE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") + set(VIEWER_APP_DSYM "${VIEWER_APP_EXE}.dSYM") + set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") + configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" - "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist" + "${VIEWER_APP_BUNDLE}/Contents/Info.plist" ) add_custom_command( @@ -2087,15 +2137,16 @@ if (DARWIN) --actions=copy --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app + --dest=${VIEWER_APP_BUNDLE} --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt - --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} --source=${CMAKE_CURRENT_SOURCE_DIR} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2120,15 +2171,16 @@ if (DARWIN) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} --artwork=${ARTWORK_DIR} + "--bugsplat=${BUGSPLAT_DB}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} + "--channel=${VIEWER_CHANNEL}" --configuration=${CMAKE_CFG_INTDIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app + --dest=${VIEWER_APP_BUNDLE} --grid=${GRID} - "--channel=${VIEWER_CHANNEL}" - --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt ${SIGNING_SETTING} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2140,67 +2192,152 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -if (PACKAGE) - set(SYMBOL_SEARCH_DIRS "") - # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh - if (WINDOWS) - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") - # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad - # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") - set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") - set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}") - set(VIEWER_COPY_MANIFEST copy_w_viewer_manifest) - endif (WINDOWS) - if (DARWIN) - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") - # *TODO: Generate these search dirs in the cmake files related to each binary. - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") - set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") - set(VIEWER_LIB_GLOB "*.dylib") - endif (DARWIN) - if (LINUX) - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") - set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") - set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") - set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") - set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) - endif (LINUX) - - if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) - if(CMAKE_CFG_INTDIR STREQUAL ".") - set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) - else(CMAKE_CFG_INTDIR STREQUAL ".") - # set LLBUILD_CONFIG to be a shell variable evaluated at build time - # reflecting the configuration we are currently building. - set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR}) - endif(CMAKE_CFG_INTDIR STREQUAL ".") - add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" - COMMAND "${PYTHON_EXECUTABLE}" - ARGS - "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py" - "${LLBUILD_CONFIG}" - "${SYMBOL_SEARCH_DIRS}" - "${VIEWER_EXE_GLOBS}" - "${VIEWER_LIB_GLOB}" - "${AUTOBUILD_INSTALL_DIR}/bin/dump_syms" - "${VIEWER_SYMBOL_FILE}" - DEPENDS generate_breakpad_symbols.py - VERBATIM) - - add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") - add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}") - if (WINDOWS OR LINUX) - add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}") - endif (WINDOWS OR LINUX) - add_dependencies(llpackage generate_breakpad_symbols) - endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) -endif (PACKAGE) +# Note that the conventional VIEWER_SYMBOL_FILE is set by ../../build.sh +if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIEWER_SYMBOL_FILE) + if (NOT BUGSPLAT_DB) + # Breakpad symbol-file generation + set(SYMBOL_SEARCH_DIRS "") + if (WINDOWS) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad + # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") + set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") + set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}") + set(VIEWER_COPY_MANIFEST copy_w_viewer_manifest) + endif (WINDOWS) + if (DARWIN) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + # *TODO: Generate these search dirs in the cmake files related to each binary. + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") + set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger") + set(VIEWER_LIB_GLOB "*.dylib") + endif (DARWIN) + if (LINUX) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") + set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") + set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") + set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") + set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) + endif (LINUX) + + if(CMAKE_CFG_INTDIR STREQUAL ".") + set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) + else(CMAKE_CFG_INTDIR STREQUAL ".") + # set LLBUILD_CONFIG to be a shell variable evaluated at build time + # reflecting the configuration we are currently building. + set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR}) + endif(CMAKE_CFG_INTDIR STREQUAL ".") + add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" + COMMAND "${PYTHON_EXECUTABLE}" + ARGS + "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py" + "${LLBUILD_CONFIG}" + "${SYMBOL_SEARCH_DIRS}" + "${VIEWER_EXE_GLOBS}" + "${VIEWER_LIB_GLOB}" + "${AUTOBUILD_INSTALL_DIR}/bin/dump_syms" + "${VIEWER_SYMBOL_FILE}" + DEPENDS generate_breakpad_symbols.py + VERBATIM) + + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME} "${VIEWER_COPY_MANIFEST}") + add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) + if (WINDOWS OR LINUX) + add_dependencies(generate_symbols "${VIEWER_COPY_MANIFEST}") + endif (WINDOWS OR LINUX) + + else (NOT BUGSPLAT_DB) + # BugSplat symbol-file generation + if (WINDOWS) + # Just pack up a tarball containing only the .pdb file for the + # executable. Because we intend to use cygwin tar, we must render + # VIEWER_SYMBOL_FILE in cygwin path syntax. + execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}" + OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN + OUTPUT_STRIP_TRAILING_WHITESPACE) + add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" + # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2; + # testing a string suffix is painful enough in CMake language that + # we'll continue assuming it until forced to generalize. + COMMAND "tar" + ARGS + "cjf" + "${VIEWER_SYMBOL_FILE_CYGWIN}" + "-C" + "${PARENT_DIRECTORY_CYGWIN}" + "secondlife-bin.pdb" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" + COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" + ) + add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME}) + add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) + endif (WINDOWS) + if (DARWIN) + # Have to run dsymutil first, then pack up the resulting .dSYM directory + add_custom_command(OUTPUT "${VIEWER_APP_DSYM}" + COMMAND "dsymutil" + ARGS + ${VIEWER_APP_EXE} + COMMENT "Generating ${VIEWER_APP_DSYM}" + ) + 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 + "-r" + "${VIEWER_APP_XCARCHIVE}" + "." + WORKING_DIRECTORY "${VIEWER_APP_DSYM}/.." + DEPENDS "${VIEWER_APP_DSYM}" + COMMENT "Generating xcarchive.zip for upload to BugSplat" + ) + add_custom_target(dsym_xcarchive DEPENDS "${VIEWER_APP_XCARCHIVE}") + add_dependencies(dsym_xcarchive dsym_generate) + # Have to create a stamp file, and depend on it, to force CMake to run + # the cleanup step. + 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}" + 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) + endif (DARWIN) + if (LINUX) + # TBD + endif (LINUX) + endif (NOT BUGSPLAT_DB) + + # for both BUGSPLAT_DB and Breakpad + add_dependencies(llpackage generate_symbols) +endif () if (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 57da87a3ee..5dd4d13a3a 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -26,19 +26,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA $/LicenseInfo$ """ -import sys -import os -import os.path -import shutil import errno import json +import os +import os.path 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. @@ -63,7 +64,7 @@ class ViewerManifest(LLManifest): self.path(src="../../etc/message.xml", dst="app_settings/message.xml") if self.is_packaging_viewer(): - with self.prefix(src="app_settings"): + with self.prefix(src_dst="app_settings"): self.exclude("logcontrol.xml") self.exclude("logcontrol-dev.xml") self.path("*.ini") @@ -85,7 +86,7 @@ class ViewerManifest(LLManifest): # ... and the included spell checking dictionaries pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') - with self.prefix(src=pkgdir,dst=""): + with self.prefix(src=pkgdir): self.path("dictionaries") # include the extracted packages information (see BuildPackagesInfo.cmake) @@ -107,17 +108,18 @@ class ViewerManifest(LLManifest): Type='String', Value='')) settings_install = {} - if 'sourceid' in self.args and self.args['sourceid']: + sourceid = self.args.get('sourceid') + if sourceid: settings_install['sourceid'] = settings_template['sourceid'].copy() - settings_install['sourceid']['Value'] = self.args['sourceid'] - print "Set sourceid in settings_install.xml to '%s'" % self.args['sourceid'] + settings_install['sourceid']['Value'] = sourceid + print "Set sourceid in settings_install.xml to '%s'" % sourceid - if 'channel_suffix' in self.args and self.args['channel_suffix']: + if self.args.get('channel_suffix'): settings_install['CmdLineChannel'] = settings_template['CmdLineChannel'].copy() settings_install['CmdLineChannel']['Value'] = self.channel_with_pkg_suffix() print "Set CmdLineChannel in settings_install.xml to '%s'" % self.channel_with_pkg_suffix() - if 'grid' in self.args and self.args['grid']: + if self.args.get('grid'): settings_install['CmdLineGridChoice'] = settings_template['CmdLineGridChoice'].copy() settings_install['CmdLineGridChoice']['Value'] = self.grid() print "Set CmdLineGridChoice in settings_install.xml to '%s'" % self.grid() @@ -129,20 +131,20 @@ class ViewerManifest(LLManifest): src="environment") - with self.prefix(src="character"): + with self.prefix(src_dst="character"): self.path("*.llm") self.path("*.xml") self.path("*.tga") # Include our fonts - with self.prefix(src="fonts"): + with self.prefix(src_dst="fonts"): self.path("*.ttf") self.path("*.txt") # skins - with self.prefix(src="skins"): + with self.prefix(src_dst="skins"): # include the entire textures directory recursively - with self.prefix(src="*/textures"): + with self.prefix(src_dst="*/textures"): self.path("*/*.tga") self.path("*/*.j2c") self.path("*/*.jpg") @@ -170,7 +172,7 @@ class ViewerManifest(LLManifest): # local_assets dir (for pre-cached textures) - with self.prefix(src="local_assets"): + with self.prefix(src_dst="local_assets"): self.path("*.j2c") self.path("*.tga") @@ -186,6 +188,10 @@ class ViewerManifest(LLManifest): "Address Size":self.address_size, "Update Service":"https://update.secondlife.com/update", } + # Only store this if it's both present and non-empty + bugsplat_db = self.args.get('bugsplat') + if bugsplat_db: + build_data_dict["BugSplat DB"] = bugsplat_db build_data_dict = self.finish_build_data_dict(build_data_dict) with open(os.path.join(os.pardir,'build_data.json'), 'w') as build_data_handle: json.dump(build_data_dict,build_data_handle) @@ -206,8 +212,9 @@ class ViewerManifest(LLManifest): def channel_with_pkg_suffix(self): fullchannel=self.channel() - if 'channel_suffix' in self.args and self.args['channel_suffix']: - fullchannel+=' '+self.args['channel_suffix'] + channel_suffix = self.args.get('channel_suffix') + if channel_suffix: + fullchannel+=' '+channel_suffix return fullchannel def channel_variant(self): @@ -215,8 +222,7 @@ class ViewerManifest(LLManifest): return self.channel().replace(CHANNEL_VENDOR_BASE, "").strip() def channel_type(self): # returns 'release', 'beta', 'project', or 'test' - global CHANNEL_VENDOR_BASE - channel_qualifier=self.channel().replace(CHANNEL_VENDOR_BASE, "").lower().strip() + channel_qualifier=self.channel_variant().lower() if channel_qualifier.startswith('release'): channel_type='release' elif channel_qualifier.startswith('beta'): @@ -234,11 +240,12 @@ class ViewerManifest(LLManifest): if self.channel_type() == 'release': suffix=suffix.replace('Release', '').strip() # for the base release viewer, suffix will now be null - for any other, append what remains - if len(suffix) > 0: - suffix = "_"+ ("_".join(suffix.split())) + if suffix: + suffix = "_".join([''] + suffix.split()) # the additional_packages mechanism adds more to the installer name (but not to the app name itself) - if 'channel_suffix' in self.args and self.args['channel_suffix']: - suffix+='_'+("_".join(self.args['channel_suffix'].split())) + # ''.split() produces empty list, so suffix only changes if + # channel_suffix is non-empty + suffix = "_".join([suffix] + self.args.get('channel_suffix', '').split()) return suffix def installer_base_name(self): @@ -488,19 +495,19 @@ 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()) - with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): + with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list self.path('updater.exe') #IUM is not normally executed directly, just imported. No exe needed. self.path("InstallerUserMessage.py") - with self.prefix(src=self.icon_path(), dst="vmp_icons"): - self.path("secondlife.ico") - - #VMP Tkinter icons - with self.prefix("vmp_icons"): - self.path("*.png") - self.path("*.gif") + with self.prefix(dst="vmp_icons"): + with self.prefix(src=self.icon_path()): + self.path("secondlife.ico") + #VMP Tkinter icons + with self.prefix(src="vmp_icons"): + self.path("*.png") + self.path("*.gif") # Plugin host application self.path2basename(os.path.join(os.pardir, @@ -508,8 +515,8 @@ class WindowsManifest(ViewerManifest): "slplugin.exe") # Get shared libs from the shared libs staging directory - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']), - dst=""): + with self.prefix(src=os.path.join(self.args['build'], os.pardir, + 'sharedlibs', self.args['configuration'])): # Get llcommon and deps. If missing assume static linkage and continue. try: @@ -575,6 +582,17 @@ class WindowsManifest(ViewerManifest): # Hunspell self.path("libhunspell.dll") + # 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") + # For google-perftools tcmalloc allocator. try: if self.args['configuration'].lower() == 'debug': @@ -584,114 +602,116 @@ class WindowsManifest(ViewerManifest): except: print "Skipping libtcmalloc_minimal.dll" - self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") - with self.prefix(src=pkgdir,dst=""): + with self.prefix(src=pkgdir): self.path("ca-bundle.crt") # Media plugins - CEF - with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_cef.dll") - - # Media plugins - LibVLC - with self.prefix(src='../media_plugins/libvlc/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_libvlc.dll") - - # Media plugins - Example (useful for debugging - not shipped with release viewer) - if self.channel_type() != 'release': - with self.prefix(src='../media_plugins/example/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_example.dll") - - # CEF runtime files - debug - # CEF runtime files - not debug (release, relwithdebinfo etc.) - config = 'debug' if self.args['configuration'].lower() == 'debug' else 'release' - with self.prefix(src=os.path.join(pkgdir, 'bin', config), dst="llplugin"): - self.path("chrome_elf.dll") - self.path("d3dcompiler_43.dll") - self.path("d3dcompiler_47.dll") - self.path("libcef.dll") - self.path("libEGL.dll") - self.path("libGLESv2.dll") - self.path("dullahan_host.exe") - self.path("natives_blob.bin") - self.path("snapshot_blob.bin") - self.path("widevinecdmadapter.dll") - - # MSVC DLLs needed for CEF and have to be in same directory as plugin - with self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release'), dst="llplugin"): - self.path("msvcp120.dll") - self.path("msvcr120.dll") - - # CEF files common to all configurations - with self.prefix(src=os.path.join(pkgdir, 'resources'), dst="llplugin"): - self.path("cef.pak") - self.path("cef_100_percent.pak") - self.path("cef_200_percent.pak") - self.path("cef_extensions.pak") - self.path("devtools_resources.pak") - self.path("icudtl.dat") - - with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst=os.path.join('llplugin', 'locales')): - self.path("am.pak") - self.path("ar.pak") - self.path("bg.pak") - self.path("bn.pak") - self.path("ca.pak") - self.path("cs.pak") - self.path("da.pak") - self.path("de.pak") - self.path("el.pak") - self.path("en-GB.pak") - self.path("en-US.pak") - self.path("es-419.pak") - self.path("es.pak") - self.path("et.pak") - self.path("fa.pak") - self.path("fi.pak") - self.path("fil.pak") - self.path("fr.pak") - self.path("gu.pak") - self.path("he.pak") - self.path("hi.pak") - self.path("hr.pak") - self.path("hu.pak") - self.path("id.pak") - self.path("it.pak") - self.path("ja.pak") - self.path("kn.pak") - self.path("ko.pak") - self.path("lt.pak") - self.path("lv.pak") - self.path("ml.pak") - self.path("mr.pak") - self.path("ms.pak") - self.path("nb.pak") - self.path("nl.pak") - self.path("pl.pak") - self.path("pt-BR.pak") - self.path("pt-PT.pak") - self.path("ro.pak") - self.path("ru.pak") - self.path("sk.pak") - self.path("sl.pak") - self.path("sr.pak") - self.path("sv.pak") - self.path("sw.pak") - self.path("ta.pak") - self.path("te.pak") - self.path("th.pak") - self.path("tr.pak") - self.path("uk.pak") - self.path("vi.pak") - self.path("zh-CN.pak") - self.path("zh-TW.pak") - - with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="llplugin"): - self.path("libvlc.dll") - self.path("libvlccore.dll") - self.path("plugins/") + with self.prefix(dst="llplugin"): + with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins')): + with self.prefix(src=os.path.join('cef', self.args['configuration'])): + self.path("media_plugin_cef.dll") + + # Media plugins - LibVLC + with self.prefix(src=os.path.join('libvlc', self.args['configuration'])): + self.path("media_plugin_libvlc.dll") + + # Media plugins - Example (useful for debugging - not shipped with release viewer) + if self.channel_type() != 'release': + with self.prefix(src=os.path.join('example', self.args['configuration'])): + self.path("media_plugin_example.dll") + + # CEF runtime files - debug + # CEF runtime files - not debug (release, relwithdebinfo etc.) + config = 'debug' if self.args['configuration'].lower() == 'debug' else 'release' + with self.prefix(src=os.path.join(pkgdir, 'bin', config)): + self.path("chrome_elf.dll") + self.path("d3dcompiler_43.dll") + self.path("d3dcompiler_47.dll") + self.path("libcef.dll") + self.path("libEGL.dll") + self.path("libGLESv2.dll") + self.path("dullahan_host.exe") + self.path("natives_blob.bin") + self.path("snapshot_blob.bin") + self.path("widevinecdmadapter.dll") + + # MSVC DLLs needed for CEF and have to be in same directory as plugin + with self.prefix(src=os.path.join(self.args['build'], os.pardir, + 'sharedlibs', 'Release')): + self.path("msvcp120.dll") + self.path("msvcr120.dll") + + # CEF files common to all configurations + with self.prefix(src=os.path.join(pkgdir, 'resources')): + self.path("cef.pak") + self.path("cef_100_percent.pak") + self.path("cef_200_percent.pak") + self.path("cef_extensions.pak") + self.path("devtools_resources.pak") + self.path("icudtl.dat") + + with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst='locales'): + self.path("am.pak") + self.path("ar.pak") + self.path("bg.pak") + self.path("bn.pak") + self.path("ca.pak") + self.path("cs.pak") + self.path("da.pak") + self.path("de.pak") + self.path("el.pak") + self.path("en-GB.pak") + self.path("en-US.pak") + self.path("es-419.pak") + self.path("es.pak") + self.path("et.pak") + self.path("fa.pak") + self.path("fi.pak") + self.path("fil.pak") + self.path("fr.pak") + self.path("gu.pak") + self.path("he.pak") + self.path("hi.pak") + self.path("hr.pak") + self.path("hu.pak") + self.path("id.pak") + self.path("it.pak") + self.path("ja.pak") + self.path("kn.pak") + self.path("ko.pak") + self.path("lt.pak") + self.path("lv.pak") + self.path("ml.pak") + self.path("mr.pak") + self.path("ms.pak") + self.path("nb.pak") + self.path("nl.pak") + self.path("pl.pak") + self.path("pt-BR.pak") + self.path("pt-PT.pak") + self.path("ro.pak") + self.path("ru.pak") + self.path("sk.pak") + self.path("sl.pak") + self.path("sr.pak") + self.path("sv.pak") + self.path("sw.pak") + self.path("ta.pak") + self.path("te.pak") + self.path("th.pak") + self.path("tr.pak") + self.path("uk.pak") + self.path("vi.pak") + self.path("zh-CN.pak") + self.path("zh-TW.pak") + + with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): + self.path("libvlc.dll") + self.path("libvlccore.dll") + self.path("plugins/") # pull in the crash logger and updater from other projects # tag:"crash-logger" here as a cue to the exporter @@ -874,6 +894,12 @@ class DarwinManifest(ViewerManifest): # darwin requires full app bundle packaging even for debugging. return True + def is_rearranging(self): + # That said, some stuff should still only be performed once. + # Are either of these actions in 'actions'? Is the set intersection + # non-empty? + 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'], "Second Life.app"), dst="") @@ -1362,19 +1388,19 @@ class LinuxManifest(ViewerManifest): debpkgdir = os.path.join(pkgdir, "lib", "debug") self.path("licenses-linux.txt","licenses.txt") - with self.prefix("linux_tools", dst=""): + with self.prefix("linux_tools"): self.path("client-readme.txt","README-linux.txt") self.path("client-readme-voice.txt","README-linux-voice.txt") self.path("client-readme-joystick.txt","README-linux-joystick.txt") self.path("wrapper.sh","secondlife") - with self.prefix(src="", dst="etc"): + with self.prefix(dst="etc"): self.path("handle_secondlifeprotocol.sh") self.path("register_secondlifeprotocol.sh") self.path("refresh_desktop_app_entry.sh") self.path("launch_url.sh") self.path("install.sh") - with self.prefix(src="", dst="bin"): + with self.prefix(dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") self.path2basename("../llplugin/slplugin", "SLPlugin") @@ -1388,9 +1414,9 @@ class LinuxManifest(ViewerManifest): # Get the icons based on the channel type icon_path = self.icon_path() print "DEBUG: icon_path '%s'" % icon_path - with self.prefix(src=icon_path, dst="") : + with self.prefix(src=icon_path) : self.path("secondlife_256.png","secondlife_icon.png") - with self.prefix(src="",dst="res-sdl") : + with self.prefix(dst="res-sdl") : self.path("secondlife_256.BMP","ll_icon.BMP") # plugins @@ -1412,7 +1438,7 @@ class LinuxManifest(ViewerManifest): self.path("featuretable_linux.txt") - with self.prefix(src=pkgdir,dst=""): + with self.prefix(src=pkgdir): self.path("ca-bundle.crt") def package_finish(self): @@ -1468,7 +1494,7 @@ class Linux_i686_Manifest(LinuxManifest): relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") - with self.prefix(relpkgdir, dst="lib"): + with self.prefix(src=relpkgdir, dst="lib"): self.path("libapr-1.so") self.path("libapr-1.so.0") self.path("libapr-1.so.0.4.5") @@ -1554,4 +1580,8 @@ class Linux_x86_64_Manifest(LinuxManifest): ################################################################ if __name__ == "__main__": - main() + extra_arguments = [ + dict(name='bugsplat', description="""BugSplat database to which to post crashes, + if BugSplat crash reporting is desired""", default=''), + ] + main(extra=extra_arguments) -- cgit v1.2.3 From 2c5d7199f69984ddba602ac50f8f55c6fd73fc9d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 Oct 2018 13:53:37 -0400 Subject: DRTVWR-447: Restore channel-name sensitivity of Mac BugSplat viewer. --- indra/newview/viewer_manifest.py | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 5dd4d13a3a..0aea31d563 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -902,7 +902,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'], "Second Life.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") @@ -926,7 +926,7 @@ class DarwinManifest(ViewerManifest): if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): self.run_command( - ['strip', '-S', self.dst_path_of('Second Life')]) + ['strip', '-S', self.dst_path_of(self.channel())]) with self.prefix(dst="Resources"): # defer cross-platform file copies until we're in the @@ -960,8 +960,6 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") - self.path("SecondLife.nib") - # Translations self.path("English.lproj/language.txt") self.replace_in(src="English.lproj/InfoPlist.strings", @@ -1321,34 +1319,6 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise - print 72*'=' - import stat - print app_in_dmg - # Second Life.app - for sub0 in os.listdir(app_in_dmg): - print '--{}'.format(sub0) - path0 = os.path.join(app_in_dmg, sub0) - if os.path.isfile(path0): - # shouldn't be any file here - with open(path0) as inf: - for line in inf: - print ' {}'.format(line.rstrip()) - elif os.path.isdir(path0): - # Contents - for sub1 in os.listdir(path0): - print '----{}'.format(sub1) - path1 = os.path.join(path0, sub1) - if os.path.isfile(path1): - # Info.plist, PkgInfo - with open(path1) as inf: - for line in inf: - print ' {}'.format(line.rstrip()) - elif os.path.isdir(path1): - # Frameworks, MacOS, Resources - for sub2 in os.listdir(path1): - path2 = os.path.join(path1, sub2) - print ' {:04o} {}'.format(stat.S_IMODE(os.stat(path2).st_mode), sub2) - print 72*'=' self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) finally: -- cgit v1.2.3 From a3ca2c9ac830f58dbd6fa49090a936134f5cbf19 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 Oct 2018 16:47:05 -0400 Subject: DRTVWR-447: Restore diagnostic output to Mac app bundle packaging. --- indra/newview/viewer_manifest.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 0aea31d563..40fa6cacf3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1319,6 +1319,34 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise + print 72*'=' + import stat + print app_in_dmg + # Second Life.app + for sub0 in os.listdir(app_in_dmg): + print '--{}'.format(sub0) + path0 = os.path.join(app_in_dmg, sub0) + if os.path.isfile(path0): + # shouldn't be any file here + with open(path0) as inf: + for line in inf: + print ' {}'.format(line.rstrip()) + elif os.path.isdir(path0): + # Contents + for sub1 in os.listdir(path0): + print '----{}'.format(sub1) + path1 = os.path.join(path0, sub1) + if os.path.isfile(path1): + # Info.plist, PkgInfo + with open(path1) as inf: + for line in inf: + print ' {}'.format(line.rstrip()) + elif os.path.isdir(path1): + # Frameworks, MacOS, Resources + for sub2 in os.listdir(path1): + path2 = os.path.join(path1, sub2) + print ' {:04o} {}'.format(stat.S_IMODE(os.stat(path2).st_mode), sub2) + print 72*'=' self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) finally: -- cgit v1.2.3 From d86b311b2cdc2f58ef53aa2f7a8d180fe4a61353 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 Oct 2018 22:34:58 -0400 Subject: DRTVWR-447: Restore MACOSX_EXECUTABLE_NAME, used for Info.plist. --- indra/newview/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5c918fc3b2..1b19497354 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2092,6 +2092,7 @@ if (DARWIN) # magically known to CMake -- it's that these names are referenced in the # Info-SecondLife.plist file in the configure_file() directive below. set(product "${VIEWER_CHANNEL}") + set(MACOSX_EXECUTABLE_NAME "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") -- cgit v1.2.3 From c532e3075c7857f3f3f0097890d93bd90ff82db0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Oct 2018 15:31:44 -0400 Subject: DRTVWR-447: Re-inject BugsplatServerURL into Mac's Info.plist. --- indra/newview/viewer_manifest.py | 41 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 40fa6cacf3..fb132732a5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -909,6 +909,19 @@ class DarwinManifest(ViewerManifest): debpkgdir = os.path.join(pkgdir, "lib", "debug") with self.prefix(src="", dst="Contents"): # everything goes in Contents + bugsplat_db = self.args.get('bugsplat') + if bugsplat_db: + # Inject BugsplatServerURL into Info.plist if provided. + Info_plist = self.dst_path_of("Info.plist") + Info = plistlib.readPlist(Info_plist) + # https://www.bugsplat.com/docs/platforms/os-x#configuration + Info["BugsplatServerURL"] = \ + "https://{}.bugsplat.com/".format(bugsplat_db) + self.put_in_file( + plistlib.writePlistToString(Info), + os.path.basename(Info_plist), + "Info.plist") + # CEF framework goes inside Contents/Frameworks. # Remember where we parked this car. with self.prefix(src="", dst="Frameworks"): @@ -1319,34 +1332,6 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise - print 72*'=' - import stat - print app_in_dmg - # Second Life.app - for sub0 in os.listdir(app_in_dmg): - print '--{}'.format(sub0) - path0 = os.path.join(app_in_dmg, sub0) - if os.path.isfile(path0): - # shouldn't be any file here - with open(path0) as inf: - for line in inf: - print ' {}'.format(line.rstrip()) - elif os.path.isdir(path0): - # Contents - for sub1 in os.listdir(path0): - print '----{}'.format(sub1) - path1 = os.path.join(path0, sub1) - if os.path.isfile(path1): - # Info.plist, PkgInfo - with open(path1) as inf: - for line in inf: - print ' {}'.format(line.rstrip()) - elif os.path.isdir(path1): - # Frameworks, MacOS, Resources - for sub2 in os.listdir(path1): - path2 = os.path.join(path1, sub2) - print ' {:04o} {}'.format(stat.S_IMODE(os.stat(path2).st_mode), sub2) - print 72*'=' self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) finally: -- cgit v1.2.3 From f55d3071e16f06c7afc0940928fa2e9a620556d9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 22 Oct 2018 14:21:35 -0400 Subject: DRTVWR-447: Restore copying BugsplatMac.framework into Mac package. --- indra/newview/viewer_manifest.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index fb132732a5..ed9b5a35fd 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -929,6 +929,9 @@ class DarwinManifest(ViewerManifest): self.path2basename(relpkgdir, CEF_framework) CEF_framework = self.dst_path_of(CEF_framework) + if self.args.get('bugsplat'): + self.path2basename(relpkgdir, "BugsplatMac.framework") + with self.prefix(dst="MacOS"): # NOTE: the -S argument to strip causes it to keep # enough info for annotated backtraces (i.e. function -- cgit v1.2.3 From 32e30386d8cef58533610d31eaba3d3ac976ab76 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 23 Oct 2018 10:52:06 -0400 Subject: DRTVWR-447: Try to defeat scary Mac Gatekeeper popups by replacing the viewer's baked-in BugsplatMac.framework @rpath path with one based on @executable_path. --- indra/newview/viewer_manifest.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ed9b5a35fd..508c5cb043 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -933,6 +933,34 @@ class DarwinManifest(ViewerManifest): self.path2basename(relpkgdir, "BugsplatMac.framework") with self.prefix(dst="MacOS"): + executable = self.dst_path_of(self.channel()) + if self.args.get('bugsplat'): + # According to Apple Technical Note TN2206: + # https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG207 + # "If an app uses @rpath or an absolute path to link to a + # dynamic library outside of the app, the app will be + # rejected by Gatekeeper. ... Neither the codesign nor the + # spctl tool will show the error." + # (Thanks, Apple. Maybe fix spctl to warn?) + # The BugsplatMac framework embeds @rpath, which is + # causing scary Gatekeeper popups at viewer start. Work + # around this by changing the reference baked into our + # viewer. The install_name_tool -change option needs the + # previous value. Instead of guessing -- which might + # silently be defeated by a BugSplat SDK update that + # changes their baked-in @rpath -- ask for the path + # stamped into the framework. + # Let exception, if any, propagate -- if this doesn't + # 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")] + ).splitlines()[-1] # take the last line of output + self.run_command( + ['install_name_tool', '-change', oldpath, + '@executable_path/../Frameworks/BugsplatMac.framework/BugsplatMac', + executable]) + # NOTE: the -S argument to strip causes it to keep # enough info for annotated backtraces (i.e. function # names in the crash log). 'strip' with no arguments @@ -942,7 +970,7 @@ class DarwinManifest(ViewerManifest): if ("package" in self.args['actions'] or "unpacked" in self.args['actions']): self.run_command( - ['strip', '-S', self.dst_path_of(self.channel())]) + ['strip', '-S', executable]) with self.prefix(dst="Resources"): # defer cross-platform file copies until we're in the -- cgit v1.2.3 From 9b5b44314acdef260ab515855a72c707e8f3f5fc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 26 Oct 2018 14:55:13 -0400 Subject: DRTVWR-447: For some reason the Windows viewer exe wasn't signed. viewer_manifest.py was signing updater.exe within the package, and then signing the installer executable itself, but not the actual viewer executable. Add that. --- indra/newview/viewer_manifest.py | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 508c5cb043..f2b0fe6a32 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -827,6 +827,7 @@ class WindowsManifest(ViewerManifest): # 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(), "updater.exe", ): self.sign(exe) -- cgit v1.2.3 From 0ca69bb2ebf206705045a72b004e302af1f6d5dd Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 27 Oct 2018 15:24:24 -0400 Subject: DRTVWR-447: Stop passing UpdaterServiceURL to leap updater. In fact, mark UpdaterServiceURL as obsolete. (Consumers should consult build_data.json.) --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llappviewer.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8722050569..1242d63e8a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13510,7 +13510,7 @@ UpdaterServiceURL Comment - Default location for the updater service. + Obsolete; no longer used. Persist 0 Type diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e527b70b0e..bda76c14d1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1156,8 +1156,6 @@ bool LLAppViewer::init() updater.args.add(LLVersionInfo::getChannel()); // testok updater.args.add(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); - // UpdaterServiceURL - updater.args.add(gSavedSettings.getString("UpdaterServiceURL")); // ForceAddressSize updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); -- cgit v1.2.3 From 810cebe967b75c6ba6428e0bdf8fc2fabf8379e5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 29 Oct 2018 15:36:43 -0400 Subject: SL-9964: Put Mac cursors back into Resources/cursors_mac subdirectory. --- 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 f2b0fe6a32..3556b82320 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -995,7 +995,7 @@ class DarwinManifest(ViewerManifest): self.path("libndofdev.dylib") self.path("libhunspell-1.3.0.dylib") - with self.prefix("cursors_mac"): + with self.prefix(src_dst="cursors_mac"): self.path("*.tif") self.path("licenses-mac.txt", dst="licenses.txt") -- cgit v1.2.3 From a5f492acf19664593b040a8cdff1e5e251f65dba Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 29 Oct 2018 17:17:26 -0400 Subject: SL-9980: Launch the first-run updater via explorer.exe as we used to run the viewer from the installer. Turns out that the peculiar indirection through explorer.exe was a known trick for an elevated-privileges program to launch a program as the logged-in Windows user. (They could have commented that...) But explorer.exe doesn't pass command-line parameters, so if you want to pass any such to the actual target program, you have to launch a shortcut with those parameters. But this target program (the updater) and its parameters (precheck mumble) are specific to the very first viewer run after installation, so delete it after. Having an additional permanent icon that always runs the updater before the viewer would only confuse matters. --- indra/newview/installers/windows/installer_template.nsi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 76187b49a5..adcf8fd0e4 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -705,10 +705,21 @@ Function .onInstSuccess # updater can detect the problem and adapt accordingly. # Once everything is in order, the updater will run the specified # viewer with the specified params. + # 'Exec updater' causes the viewer to inherit elevated Admin privileges. See + # http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html + # for workaround: running the updater via explorer.exe. + # Thing is, you can't pass parameters with the explorer.exe trick, so + # you have to create a shortcut or a .bat file. Since we don't want a + # permanent shortcut for the user to relaunch the updater like this + # first time, create it in a temp location and delete it once we've + # used it. # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + CreateShortCut "$TEMP\SLFirst.lnk" "$INSTDIR\$INSTEXE" \ + 'precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$WINDIR\explorer.exe" "$TEMP\SLFirst.lnk"' + Delete "$TEMP\SLFirst.lnk" Pop $R0 # FunctionEnd -- cgit v1.2.3 From e2ca890898ecb79ff314b1f748bb6a3a9dbf602b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 30 Oct 2018 10:36:28 -0400 Subject: DRTVWR-447: Copy VIEWER_EXE to local variable (thanks Ansariel) --- indra/newview/installers/windows/installer_template.nsi | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index adcf8fd0e4..f8e9bc4781 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -382,6 +382,7 @@ Section Uninstall # Start with some default values. StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" +StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" # Make sure the user can install/uninstall -- cgit v1.2.3 From a186f9a729e9ae9c834121708177b177f2c26283 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 1 Nov 2018 22:08:44 -0400 Subject: DRTVWR-447: Allow Standard Windows user to install for current user. This should eliminate any confusion due to a Standard user needing to elevate to Admin privileges, since from that point on Windows tells the running program the current user is that Admin. Bypass all that. --- .../installers/windows/installer_template.nsi | 165 ++++++++++----------- indra/newview/installers/windows/lang_da.nsi | Bin 7816 -> 7816 bytes indra/newview/installers/windows/lang_de.nsi | Bin 9850 -> 9854 bytes indra/newview/installers/windows/lang_en-us.nsi | Bin 8734 -> 11342 bytes indra/newview/installers/windows/lang_es.nsi | Bin 9872 -> 9876 bytes indra/newview/installers/windows/lang_fr.nsi | Bin 10258 -> 10262 bytes indra/newview/installers/windows/lang_it.nsi | Bin 9520 -> 9524 bytes indra/newview/installers/windows/lang_ja.nsi | Bin 7204 -> 7208 bytes indra/newview/installers/windows/lang_pl.nsi | Bin 8136 -> 8136 bytes indra/newview/installers/windows/lang_pt-br.nsi | Bin 9864 -> 9864 bytes indra/newview/installers/windows/lang_ru.nsi | Bin 9188 -> 9188 bytes indra/newview/installers/windows/lang_tr.nsi | Bin 9286 -> 9290 bytes indra/newview/installers/windows/lang_zh.nsi | Bin 6846 -> 6850 bytes indra/newview/viewer_manifest.py | 4 +- 14 files changed, 81 insertions(+), 88 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index f8e9bc4781..500b35255e 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -32,7 +32,7 @@ SetCompress auto # Compress if saves space SetCompressor /solid lzma # Compress whole installer as one block SetDatablockOptimize off # Only saves us 0.1%, not worth it XPStyle on # Add an XP manifest to the installer -RequestExecutionLevel admin # For when we write to Program Files +RequestExecutionLevel highest # match MULTIUSER_EXECUTIONLEVEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Project flags @@ -90,20 +90,43 @@ InstProgressFlags smooth colored # New colored smooth look SetOverwrite on # Overwrite files by default AutoCloseWindow true # After all files install, close window -# initial location of install (default when not already installed) -# note: Now we defer looking for existing install until onInit when we -# are able to engage the 32/64 registry function -InstallDir "%%PROGRAMFILES%%\${INSTNAME}" +# Registry key paths, ours and Microsoft's +!define LINDEN_KEY "SOFTWARE\Linden Research, Inc." +!define INSTNAME_KEY "${LINDEN_KEY}\${INSTNAME}" +!define MSCURRVER_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion" +!define MSNTCURRVER_KEY "SOFTWARE\Microsoft\Windows NT\CurrentVersion" +!define MSUNINSTALL_KEY "${MSCURRVER_KEY}\Uninstall\${INSTNAME}" + +# from http://nsis.sourceforge.net/Docs/MultiUser/Readme.html +# Highest level permitted for user: Admin for Admin, Standard for Standard +!define MULTIUSER_EXECUTIONLEVEL Highest +!define MULTIUSER_MUI +# Look for /AllUsers or /CurrentUser switches +!define MULTIUSER_INSTALLMODE_COMMANDLINE +# appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64 +!define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}" +# expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing +%%PROGRAMFILES%% +# should make MultiUser.nsh initialization read existing INSTDIR from registry +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" +# should make MultiUser.nsh initialization write $MultiUser.InstallMode to registry +!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${INSTNAME_KEY}" +!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallMode" +!include MultiUser.nsh +!include MUI2.nsh UninstallText $(UninstallTextMsg) DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) -Page directory dirPre -Page instfiles +!insertmacro MULTIUSER_PAGE_INSTALLMODE +!define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Var INSTPROG +Var INSTNAME Var INSTEXE Var VIEWER_EXE Var INSTSHORTCUT @@ -142,20 +165,13 @@ FunctionEnd ;; entry to the language ID selector below ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInit +!insertmacro MULTIUSER_INIT %%ENGAGEREGISTRY%% -# read the current location of the install for this version -# if $0 is empty, this is the first time for this viewer name -ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\\Linden Research, Inc.\\${INSTNAME}" "" - -# viewer with this name not installed before -${If} $0 == "" - # nothing to do here -${Else} - # use the value we got from registry as install location - StrCpy $INSTDIR $0 -${EndIf} +# Setting MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY and +# MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME should +# read the current location of the install for this version into INSTDIR. Call CheckCPUFlags # Make sure we have SSE2 support Call CheckWindowsVersion # Don't install On unsupported systems @@ -181,7 +197,7 @@ Call CheckWindowsVersion # Don't install On unsupported systems lbl_configure_default_lang: # If we currently have a version of SL installed, default to the language of that install # Otherwise don't change $LANGUAGE and it will default to the OS UI language. - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" + ReadRegStr $0 SHELL_CONTEXT "${INSTNAME_KEY}" "InstallerLanguage" IfErrors +2 0 # If error skip the copy instruction StrCpy $LANGUAGE $0 @@ -204,7 +220,7 @@ lbl_build_menu: StrCpy $LANGUAGE $0 # Save language in registry - WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" $LANGUAGE + WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "InstallerLanguage" $LANGUAGE lbl_return: Pop $0 Return @@ -215,16 +231,20 @@ FunctionEnd ;; Prep Uninstaller Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.onInit +!insertmacro MULTIUSER_UNINIT %%ENGAGEREGISTRY%% # Read language from registry and set for uninstaller. Key will be removed on successful uninstall - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" + ReadRegStr $0 SHELL_CONTEXT "${INSTNAME_KEY}" "InstallerLanguage" IfErrors lbl_end StrCpy $LANGUAGE $0 lbl_end: Return + # Does MultiUser.nsh init read back + # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY into $MultiUser.InstallMode? + FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -272,15 +292,14 @@ FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Section "" -SetShellVarContext all # Install for all users (if you change this, change it in the uninstall as well) +# SetShellVarContext is set by MultiUser.nsh initialization. # Start with some default values. -StrCpy $INSTPROG "${INSTNAME}" +StrCpy $INSTNAME "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" -Call CheckIfAdministrator # Make sure the user can install/uninstall Call CloseSecondLife # Make sure Second Life not currently running Call CheckWillUninstallV2 # Check if Second Life is already installed @@ -324,24 +343,24 @@ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' # Write registry -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$VIEWER_EXE" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "Publisher" "Linden Research, Inc." -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLInfoAbout" "http://secondlife.com/whatis/" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLUpdateInfo" "http://secondlife.com/support/downloads/" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "HelpLink" "https://support.secondlife.com/contact-support/" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe"' -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayVersion" "${VERSION_LONG}" -WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "EstimatedSize" "0x0001D500" # ~117 MB +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "" "$INSTDIR" +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "Version" "${VERSION_LONG}" +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "Shortcut" "$INSTSHORTCUT" +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "Exe" "$VIEWER_EXE" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "Publisher" "Linden Research, Inc." +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "URLInfoAbout" "http://secondlife.com/whatis/" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "URLUpdateInfo" "http://secondlife.com/support/downloads/" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "HelpLink" "https://support.secondlife.com/contact-support/" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayName" "$INSTNAME" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "UninstallString" '"$INSTDIR\uninst.exe"' +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayVersion" "${VERSION_LONG}" +WriteRegDWORD SHELL_CONTEXT "${MSUNINSTALL_KEY}" "EstimatedSize" "0x0001D500" # ~117 MB # from FS:Ansariel -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' # BUG-2707 Disable SEHOP for installed viewer. -WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 +WriteRegDWORD SHELL_CONTEXT "${MSNTCURRVER_KEY}\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 # Write URL registry info WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" @@ -380,25 +399,29 @@ SectionEnd Section Uninstall # Start with some default values. -StrCpy $INSTPROG "${INSTNAME}" +StrCpy $INSTNAME "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" -# Make sure the user can install/uninstall -Call un.CheckIfAdministrator - -# Uninstall for all users (if you change this, change it in the install as well) -SetShellVarContext all +# SetShellVarContext per the mode saved at install time in registry at +# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY +# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME +# Couln't get NSIS to expand $MultiUser.InstallMode into the function name at Call time +${If} $MultiUser.InstallMode == 'AllUsers' + Call un.MultiUser.InstallMode.AllUsers +${Else} + Call un.MultiUser.InstallMode.CurrentUser +${EndIf} # Make sure we're not running Call un.CloseSecondLife # Clean up registry keys and subkeys (these should all be !defines somewhere) -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" +DeleteRegKey SHELL_CONTEXT "${INSTNAME_KEY}" +DeleteRegKey SHELL_CONTEXT "${MSCURRVER_KEY}\Uninstall\$INSTNAME" # BUG-2707 Remove entry that disabled SEHOP -DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" +DeleteRegKey SHELL_CONTEXT "${MSNTCURRVER_KEY}\Image File Execution Options\$VIEWER_EXE" ##DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" DeleteRegKey HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" @@ -418,36 +441,6 @@ Call un.UserSettingsFiles SectionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Make sure the user can install -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CheckIfAdministrator - DetailPrint $(CheckAdministratorInstDP) - UserInfo::GetAccountType - Pop $R0 - StrCmp $R0 "Admin" lbl_is_admin - MessageBox MB_OK $(CheckAdministratorInstMB) - Quit -lbl_is_admin: - Return - -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Make sure the user can uninstall -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.CheckIfAdministrator - DetailPrint $(CheckAdministratorUnInstDP) - UserInfo::GetAccountType - Pop $R0 - StrCmp $R0 "Admin" lbl_is_admin - MessageBox MB_OK $(CheckAdministratorUnInstMB) - Quit -lbl_is_admin: - Return - -FunctionEnd - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function CheckWillUninstallV2 ;; @@ -571,10 +564,10 @@ Push $2 StrCpy $0 0 # Index number used to iterate via EnumRegKey LOOP: - EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 + EnumRegKey $1 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList" $0 StrCmp $1 "" DONE # No more users - ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" + ReadRegStr $2 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList\$1" "ProfileImagePath" StrCmp $2 "" CONTINUE 0 # "ProfileImagePath" value is missing # Required since ProfileImagePath is of type REG_EXPAND_SZ @@ -604,7 +597,7 @@ Pop $0 # Delete files in ProgramData\Secondlife Push $0 - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" + ReadRegStr $0 SHELL_CONTEXT "${MSCURRVER_KEY}\Explorer\Shell Folders" "Common AppData" StrCmp $0 "" +2 RMDir /r "$0\SecondLife" Pop $0 @@ -661,8 +654,8 @@ NOFOLDER: MessageBox MB_YESNO $(DeleteRegistryKeysMB) IDYES DeleteKeys IDNO NoDelete DeleteKeys: - DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\x-grid-location-info" - DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\secondlife" + DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\x-grid-location-info" + DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\secondlife" DeleteRegKey HKEY_CLASSES_ROOT "x-grid-location-info" DeleteRegKey HKEY_CLASSES_ROOT "secondlife" @@ -758,10 +751,10 @@ FunctionEnd ; StrCpy $0 0 # Index number used to iterate via EnumRegKey ; ; LOOP: -; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 +; EnumRegKey $1 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList" $0 ; StrCmp $1 "" DONE # no more users ; -; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" +; ReadRegStr $2 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList\$1" "ProfileImagePath" ; StrCmp $2 "" CONTINUE 0 # "ProfileImagePath" value is missing ; ;# Required since ProfileImagePath is of type REG_EXPAND_SZ @@ -780,7 +773,7 @@ FunctionEnd ; ;# Copy files in Documents and Settings\All Users\SecondLife ;Push $0 -; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" +; ReadRegStr $0 SHELL_CONTEXT "${MSCURRVER_KEY}\Explorer\Shell Folders" "Common AppData" ; StrCmp $0 "" +2 ; RMDir /r "$2\Application Data\SecondLife\" ;Pop $0 diff --git a/indra/newview/installers/windows/lang_da.nsi b/indra/newview/installers/windows/lang_da.nsi index 83e1a3ea94..b3b8cf34d5 100644 Binary files a/indra/newview/installers/windows/lang_da.nsi and b/indra/newview/installers/windows/lang_da.nsi differ diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi index 2a868acc89..7758a3bda6 100644 Binary files a/indra/newview/installers/windows/lang_de.nsi and b/indra/newview/installers/windows/lang_de.nsi differ diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi index 00aa47de69..1e81c5294a 100644 Binary files a/indra/newview/installers/windows/lang_en-us.nsi and b/indra/newview/installers/windows/lang_en-us.nsi differ diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index 1ecf254ffb..6d4a7495a6 100644 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi index bec5835bed..421015fc6b 100644 Binary files a/indra/newview/installers/windows/lang_fr.nsi and b/indra/newview/installers/windows/lang_fr.nsi differ diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi index 1d2e150525..df735ba742 100644 Binary files a/indra/newview/installers/windows/lang_it.nsi and b/indra/newview/installers/windows/lang_it.nsi differ diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi index 1bd6526670..f2cc1f9fde 100644 Binary files a/indra/newview/installers/windows/lang_ja.nsi and b/indra/newview/installers/windows/lang_ja.nsi differ diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi index a172f0cdeb..61dc769126 100644 Binary files a/indra/newview/installers/windows/lang_pl.nsi and b/indra/newview/installers/windows/lang_pl.nsi differ diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi index 87032fec18..d481434ab2 100644 Binary files a/indra/newview/installers/windows/lang_pt-br.nsi and b/indra/newview/installers/windows/lang_pt-br.nsi differ diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index 019c66123c..a42c719169 100644 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi index 1c4e2c2f48..c320764fac 100644 Binary files a/indra/newview/installers/windows/lang_tr.nsi and b/indra/newview/installers/windows/lang_tr.nsi differ diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi index 355e01a333..8da802df68 100644 Binary files a/indra/newview/installers/windows/lang_zh.nsi and b/indra/newview/installers/windows/lang_zh.nsi differ diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3556b82320..1e58cec808 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -806,10 +806,10 @@ class WindowsManifest(ViewerManifest): if(self.address_size == 64): engage_registry="SetRegView 64" - program_files="$PROGRAMFILES64" + program_files="!define MULTIUSER_USE_PROGRAMFILES64" else: engage_registry="SetRegView 32" - program_files="$PROGRAMFILES32" + program_files="" tempfile = "secondlife_setup_tmp.nsi" # the following replaces strings in the nsi template -- cgit v1.2.3 From 75cbe187a6572e904e2f931c6a1902b186eec844 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Nov 2018 07:59:51 -0400 Subject: DRTVWR-447: Back out changeset 69118ad33b45: directly run updater from NSIS installer, instead of via explorer.exe. A recent test run performed the install, then opened an Explorer window on My Documents. --- indra/newview/installers/windows/installer_template.nsi | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index adcf8fd0e4..76187b49a5 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -705,21 +705,10 @@ Function .onInstSuccess # updater can detect the problem and adapt accordingly. # Once everything is in order, the updater will run the specified # viewer with the specified params. - # 'Exec updater' causes the viewer to inherit elevated Admin privileges. See - # http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html - # for workaround: running the updater via explorer.exe. - # Thing is, you can't pass parameters with the explorer.exe trick, so - # you have to create a shortcut or a .bat file. Since we don't want a - # permanent shortcut for the user to relaunch the updater like this - # first time, create it in a temp location and delete it once we've - # used it. # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - CreateShortCut "$TEMP\SLFirst.lnk" "$INSTDIR\$INSTEXE" \ - 'precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' - Exec '"$WINDIR\explorer.exe" "$TEMP\SLFirst.lnk"' - Delete "$TEMP\SLFirst.lnk" + Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From e7ce166469dafe815ab002be76c6f80acaaff35c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Nov 2018 08:24:28 -0400 Subject: DRTVWR-447: Fix NSIS installer icons with "Modern UI" mechanism. --- indra/newview/installers/windows/installer_template.nsi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 219ee2695b..bd290b710b 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -80,9 +80,12 @@ Name ${INSTNAME} SubCaption 0 $(LicenseSubTitleSetup) # Override "license agreement" text +!define MUI_ICON "%%SOURCE%%\installers\windows\install_icon.ico" +!define MUI_UNICON "%%SOURCE%%\installers\windows\uninstall_icon.ico" + BrandingText " " # Bottom of window text -Icon %%SOURCE%%\installers\windows\install_icon.ico -UninstallIcon %%SOURCE%%\installers\windows\uninstall_icon.ico +Icon "${MUI_ICON}" +UninstallIcon "${MUI_UNICON}" WindowIcon on # Show our icon in left corner BGGradient off # No big background window CRCCheck on # Make sure CRC is OK -- cgit v1.2.3 From cb5c5bb6ee2705791717ea319a415728d9c06eee Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 7 Nov 2018 15:57:20 -0800 Subject: SL-9952: updater.exe now renamed to SLVersionChecker.exe thereby avoiding strange Windows requirement for elevated privilege. --- indra/newview/llappviewer.cpp | 8 ++++---- indra/newview/viewer_manifest.py | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bda76c14d1..d3577d50a1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1140,13 +1140,13 @@ bool LLAppViewer::init() // viewer itself. updater.autokill = false; #if LL_WINDOWS - updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe"); + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker.exe"); #elif LL_DARWIN - // explicitly run the system Python interpreter on updater.py + // explicitly run the system Python interpreter on SLVersionChecker.py updater.executable = "python"; - updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py")); + updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "SLVersionChecker.py")); #else - updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater"); + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker"); #endif // add LEAP mode command-line argument to whichever of these we selected updater.args.add("leap"); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1e58cec808..3e8bb388d2 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -497,9 +497,7 @@ class WindowsManifest(ViewerManifest): with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list - self.path('updater.exe') - #IUM is not normally executed directly, just imported. No exe needed. - self.path("InstallerUserMessage.py") + self.path('SLVersionChecker.exe') with self.prefix(dst="vmp_icons"): with self.prefix(src=self.icon_path()): @@ -713,7 +711,7 @@ class WindowsManifest(ViewerManifest): self.path("libvlccore.dll") self.path("plugins/") - # pull in the crash logger and updater from other projects + # pull in the crash logger from other projects # tag:"crash-logger" here as a cue to the exporter self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'], dst="win_crash_logger.exe") @@ -783,7 +781,7 @@ class WindowsManifest(ViewerManifest): substitution_strings['installer_file'] = installer_file version_vars = """ - !define INSTEXE "updater.exe" + !define INSTEXE "SLVersionChecker.exe" !define VERSION "%(version_short)s" !define VERSION_LONG "%(version)s" !define VERSION_DASHES "%(version_dashes)s" @@ -828,7 +826,7 @@ class WindowsManifest(ViewerManifest): # Unlike the viewer binary, the VMP filenames are invariant with respect to version, os, etc. for exe in ( self.final_exe(), - "updater.exe", + "SLVersionChecker.exe", ): self.sign(exe) -- cgit v1.2.3 From f49ee0a0538ae03e9299c95a15f0485dee971dbd Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 14 Nov 2018 16:19:47 -0500 Subject: DRTVWR-447: Animesh + BugSplat = 6.1 --- 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 5fe6072304..dfda3e0b4f 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.0.1 +6.1.0 -- cgit v1.2.3 From dd9f6784ccc5d285ef50f0b8693ee92bb872d992 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Nov 2018 12:06:30 -0500 Subject: SL-10010: Use c:\Program Files rather than c:\Program Files (x86) for 64-bit viewers. It seems there's a longstanding bug in NSIS: it fails to use $PROGRAMFILES64 rather than $PROGRAMFILES when performing an all-users install of a 64-bit program. Try to remedy that. Also pick up a few NSIS suggestions from Ansariel Hiller. --- .../installers/windows/installer_template.nsi | 22 ++++++++++++++++++++- indra/newview/installers/windows/lang_en-us.nsi | Bin 11342 -> 11488 bytes 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index bd290b710b..840203c178 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -46,9 +46,13 @@ RequestExecutionLevel highest # match MULTIUSER_EXECUTIONLEVEL ;; (these files are in the same place as the nsi template but the python script generates a new nsi file in the ;; application directory so we have to add a path to these include files) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Ansariel notes: "Under certain circumstances the installer will fall back +;; to the first defined (aka default) language version. So you want to include +;; en-us as first language file." +!include "%%SOURCE%%\installers\windows\lang_en-us.nsi" + !include "%%SOURCE%%\installers\windows\lang_da.nsi" !include "%%SOURCE%%\installers\windows\lang_de.nsi" -!include "%%SOURCE%%\installers\windows\lang_en-us.nsi" !include "%%SOURCE%%\installers\windows\lang_es.nsi" !include "%%SOURCE%%\installers\windows\lang_fr.nsi" !include "%%SOURCE%%\installers\windows\lang_ja.nsi" @@ -108,8 +112,22 @@ AutoCloseWindow true # After all files install, close window !define MULTIUSER_INSTALLMODE_COMMANDLINE # appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64 !define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}" + # expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing %%PROGRAMFILES%% +# Bug in MultiUser.nsh?! This reference: +# http://nsis.sourceforge.net/Docs/MultiUser/Readme.html +# says: +# MULTIUSER_USE_PROGRAMFILES64 Use $PROGRAMFILES64 instead of $PROGRAMFILES as the default all users directory. +# Yet as far as I can tell from: +# https://sourceforge.net/p/nsis/mailman/message/22246769/ +# (which contains a patch), that functionality has never been released with +# NSIS. Instead of applying a patch to each developer machine and each +# TeamCity build host, try overwriting $PROGRAMFILES with $PROGRAMFILES64?! +!ifdef MULTIUSER_USE_PROGRAMFILES64 + StrCpy $PROGRAMFILES $PROGRAMFILES64 +!endif + # should make MultiUser.nsh initialization read existing INSTDIR from registry !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" @@ -118,6 +136,8 @@ AutoCloseWindow true # After all files install, close window !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallMode" !include MultiUser.nsh !include MUI2.nsh +!define MUI_BGCOLOR FFFFFF +!insertmacro MUI_FUNCTION_GUIINIT UninstallText $(UninstallTextMsg) DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi index 1e81c5294a..fd4d340816 100644 Binary files a/indra/newview/installers/windows/lang_en-us.nsi and b/indra/newview/installers/windows/lang_en-us.nsi differ -- cgit v1.2.3 From db2cddf93fd3f39ca0330a8a8b93641377404dd1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Nov 2018 16:02:47 -0500 Subject: SL-10010: Use trunk NSIS + Unicode attrib, instead of Unicode fork. Back out misguided attempt to overwrite $PROGRAMFILES with $PROGRAMFILES64. --- .../newview/installers/windows/installer_template.nsi | 18 ++---------------- indra/newview/viewer_manifest.py | 4 +--- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 840203c178..f62a14d65f 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -18,8 +18,7 @@ ;; ;; Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA ;; -;; NSIS Unicode 2.46.5 or higher required -;; http://www.scratchpaper.com/ +;; NSIS 3 or higher required for Unicode support ;; ;; Author: James Cook, TankMaster Finesmith, Don Kjer, Callum Prentice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -27,6 +26,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Compiler flags ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Unicode true SetOverwrite on # Overwrite files SetCompress auto # Compress if saves space SetCompressor /solid lzma # Compress whole installer as one block @@ -112,22 +112,8 @@ AutoCloseWindow true # After all files install, close window !define MULTIUSER_INSTALLMODE_COMMANDLINE # appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64 !define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}" - # expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing %%PROGRAMFILES%% -# Bug in MultiUser.nsh?! This reference: -# http://nsis.sourceforge.net/Docs/MultiUser/Readme.html -# says: -# MULTIUSER_USE_PROGRAMFILES64 Use $PROGRAMFILES64 instead of $PROGRAMFILES as the default all users directory. -# Yet as far as I can tell from: -# https://sourceforge.net/p/nsis/mailman/message/22246769/ -# (which contains a patch), that functionality has never been released with -# NSIS. Instead of applying a patch to each developer machine and each -# TeamCity build host, try overwriting $PROGRAMFILES with $PROGRAMFILES64?! -!ifdef MULTIUSER_USE_PROGRAMFILES64 - StrCpy $PROGRAMFILES $PROGRAMFILES64 -!endif - # should make MultiUser.nsh initialization read existing INSTDIR from registry !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3e8bb388d2..32773b2c36 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -830,12 +830,10 @@ class WindowsManifest(ViewerManifest): ): self.sign(exe) - # We use the Unicode version of NSIS, available from - # http://www.scratchpaper.com/ # 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\Unicode\makensis.exe' % ProgramFiles) + NSIS_path = os.path.expandvars(r'${%s}\NSIS\makensis.exe' % ProgramFiles) if os.path.exists(NSIS_path): break installer_created=False -- cgit v1.2.3 From 8420e20102006b780d6959ec3d0fa6d905a32f16 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 21 Nov 2018 09:53:45 -0500 Subject: DRTVWR-447: Fix syntax error in embedded variable reference. --- indra/newview/installers/windows/lang_ru.nsi | Bin 9188 -> 9186 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index a42c719169..d8990fd955 100644 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ -- cgit v1.2.3 From 24872bea74a9275b388a4306091f940ccbf80270 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 21 Nov 2018 09:55:54 -0500 Subject: DRTVWR-447: Fix longstanding NSIS warning about unused label. --- indra/newview/installers/windows/installer_template.nsi | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index f62a14d65f..355272cd08 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -216,7 +216,6 @@ lbl_configure_default_lang: Goto lbl_return StrCmp $SKIP_DIALOGS "true" lbl_return -lbl_build_menu: Push "" # Use separate file so labels can be UTF-16 but we can still merge changes into this ASCII file. JC !include "%%SOURCE%%\installers\windows\language_menu.nsi" -- cgit v1.2.3 From 7ca89229f86aa8c056b45be1b59d221799e56a84 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 21 Nov 2018 12:07:18 -0500 Subject: SL-10077: Save correct uninstall directory and (un)install mode. Curiously, the value of $INSTDIR is correct before MULTIUSER_UNINIT, but is made incorrect by MULTIUSER_UNINIT. Save and restore the correct value. Saving $MultiUser.InstallMode in the registry (by setting relevant macros examined by MultiUser.nsh) is susceptible to overwriting if the user installs multiple viewers with the same channel name. Instead, write an InstallMode.txt in the install directory, and read it back on uninstall. Of course, add it to the files to be deleted on uninstall. --- .../installers/windows/installer_template.nsi | 48 +++++++++++++++++----- 1 file changed, 38 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 355272cd08..b2d376d0c0 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -117,9 +117,12 @@ AutoCloseWindow true # After all files install, close window # should make MultiUser.nsh initialization read existing INSTDIR from registry !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" -# should make MultiUser.nsh initialization write $MultiUser.InstallMode to registry -!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${INSTNAME_KEY}" -!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallMode" +# Don't set MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY and +# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME to cause the installer to +# write $MultiUser.InstallMode to the registry, because when the user installs +# multiple viewers with the same channel (same ${INSTNAME}, hence same +# ${INSTNAME_KEY}), the registry entry is overwritten. Instead we'll write a +# little file into the install directory -- see .onInstSuccess and un.onInit. !include MultiUser.nsh !include MUI2.nsh !define MUI_BGCOLOR FFFFFF @@ -239,7 +242,21 @@ FunctionEnd ;; Prep Uninstaller Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.onInit -!insertmacro MULTIUSER_UNINIT + # Save $INSTDIR -- it appears to have the correct value before + # MULTIUSER_UNINIT, but then gets munged by MULTIUSER_UNINIT?! + Push $INSTDIR + !insertmacro MULTIUSER_UNINIT + Pop $INSTDIR + + # Now read InstallMode.txt from $INSTDIR + Push $0 + ClearErrors + FileOpen $0 "$INSTDIR\InstallMode.txt" r + IfErrors skipread + FileRead $0 $MultiUser.InstallMode + FileClose $0 +skipread: + Pop $0 %%ENGAGEREGISTRY%% @@ -248,10 +265,10 @@ Function un.onInit IfErrors lbl_end StrCpy $LANGUAGE $0 lbl_end: - Return - # Does MultiUser.nsh init read back - # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY into $MultiUser.InstallMode? +## MessageBox MB_OK "After restoring:$\n$$INSTDIR = '$INSTDIR'$\n$$MultiUser.InstallMode = '$MultiUser.InstallMode'$\n$$LANGUAGE = '$LANGUAGE'" + + Return FunctionEnd @@ -417,8 +434,10 @@ StrCpy $INSTSHORTCUT "${SHORTCUT}" # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME # Couln't get NSIS to expand $MultiUser.InstallMode into the function name at Call time ${If} $MultiUser.InstallMode == 'AllUsers' +##MessageBox MB_OK "Uninstalling for all users" Call un.MultiUser.InstallMode.AllUsers ${Else} +##MessageBox MB_OK "Uninstalling for current user" Call un.MultiUser.InstallMode.CurrentUser ${EndIf} @@ -626,6 +645,9 @@ Function un.ProgramFiles # This placeholder is replaced by the complete list of files to uninstall by viewer_manifest.py %%DELETE_FILES%% +# our InstallMode.txt +Delete "$INSTDIR\InstallMode.txt" + # Optional/obsolete files. Delete won't fail if they don't exist. Delete "$INSTDIR\autorun.bat" Delete "$INSTDIR\dronesettings.ini" @@ -675,7 +697,13 @@ FunctionEnd ;; After install completes, launch app ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess - Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. + Push $0 + FileOpen $0 "$INSTDIR\InstallMode.txt" w + # No newline -- this is for our use, not for users to read. + FileWrite $0 "$MultiUser.InstallMode" + FileClose $0 + Pop $0 + Push $R0 Push $0 ;; MAINT-7812: Only write nsis.winstall file with /marker switch @@ -694,7 +722,8 @@ Function .onInstSuccess ClearErrors Pop $0 Pop $R0 - Push $R0 # Option value, unused# + + Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. StrCmp $SKIP_AUTORUN "true" +2; # Assumes SetOutPath $INSTDIR # Run INSTEXE (our updater), passing VIEWER_EXE plus the command-line @@ -711,7 +740,6 @@ Function .onInstSuccess # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' - Pop $R0 # FunctionEnd -- cgit v1.2.3 From 31b6d83606daff4dfcb18ead9db4a0d5a6b82c74 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 28 Nov 2018 16:00:27 -0500 Subject: SL-10030: Include nextviewer.bat in the Windows install directory. --- indra/newview/viewer_manifest.py | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 32773b2c36..4e8df5ce29 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -498,6 +498,7 @@ class WindowsManifest(ViewerManifest): with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list self.path('SLVersionChecker.exe') + self.path('nextviewer.bat') with self.prefix(dst="vmp_icons"): with self.prefix(src=self.icon_path()): -- cgit v1.2.3 From 63117d291936310b2059f07c79c3ccc87baaa064 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 30 Nov 2018 15:06:27 -0500 Subject: SL-10147: Copy placeholder English text to supported NSIS languages. --- indra/newview/installers/windows/lang_da.nsi | Bin 7816 -> 11760 bytes indra/newview/installers/windows/lang_de.nsi | Bin 9854 -> 12582 bytes indra/newview/installers/windows/lang_es.nsi | Bin 9876 -> 12630 bytes indra/newview/installers/windows/lang_fr.nsi | Bin 10262 -> 12990 bytes indra/newview/installers/windows/lang_it.nsi | Bin 9524 -> 12278 bytes indra/newview/installers/windows/lang_ja.nsi | Bin 7208 -> 9988 bytes indra/newview/installers/windows/lang_pl.nsi | Bin 8136 -> 12080 bytes indra/newview/installers/windows/lang_pt-br.nsi | Bin 9864 -> 12748 bytes indra/newview/installers/windows/lang_ru.nsi | Bin 9186 -> 11940 bytes indra/newview/installers/windows/lang_tr.nsi | Bin 9290 -> 12044 bytes indra/newview/installers/windows/lang_zh.nsi | Bin 6850 -> 9708 bytes 11 files changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/lang_da.nsi b/indra/newview/installers/windows/lang_da.nsi index b3b8cf34d5..f462c82078 100644 Binary files a/indra/newview/installers/windows/lang_da.nsi and b/indra/newview/installers/windows/lang_da.nsi differ diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi index 7758a3bda6..6abd496849 100644 Binary files a/indra/newview/installers/windows/lang_de.nsi and b/indra/newview/installers/windows/lang_de.nsi differ diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index 6d4a7495a6..5daac908c9 100644 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi index 421015fc6b..c437a0bdb4 100644 Binary files a/indra/newview/installers/windows/lang_fr.nsi and b/indra/newview/installers/windows/lang_fr.nsi differ diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi index df735ba742..78be4a3464 100644 Binary files a/indra/newview/installers/windows/lang_it.nsi and b/indra/newview/installers/windows/lang_it.nsi differ diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi index f2cc1f9fde..2eb40e280b 100644 Binary files a/indra/newview/installers/windows/lang_ja.nsi and b/indra/newview/installers/windows/lang_ja.nsi differ diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi index 61dc769126..05977847b9 100644 Binary files a/indra/newview/installers/windows/lang_pl.nsi and b/indra/newview/installers/windows/lang_pl.nsi differ diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi index d481434ab2..79c2b7b114 100644 Binary files a/indra/newview/installers/windows/lang_pt-br.nsi and b/indra/newview/installers/windows/lang_pt-br.nsi differ diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index d8990fd955..0ef1023d88 100644 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi index c320764fac..4bb4e14bfa 100644 Binary files a/indra/newview/installers/windows/lang_tr.nsi and b/indra/newview/installers/windows/lang_tr.nsi differ diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi index 8da802df68..fccf119625 100644 Binary files a/indra/newview/installers/windows/lang_zh.nsi and b/indra/newview/installers/windows/lang_zh.nsi differ -- cgit v1.2.3 From d509e315cfedb1785723184d5f2105af0436eb57 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 5 Dec 2018 10:30:53 -0500 Subject: DRTVWR-447: Fix BugSplat init with non-ASCII chars in install path. The whole remaining difference between llifstream and std::ifstream is that the former handles UTF-8 coded pathnames. Microsoft's implementation of the latter does not. --- indra/newview/llappviewerwin32.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 75fa3baa42..fff2653c98 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -600,7 +600,9 @@ bool LLAppViewerWin32::init() std::string build_data_fname( gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); - std::ifstream inf(build_data_fname.c_str()); + // Use llifstream instead of std::ifstream because LL_PATH_EXECUTABLE + // could contain non-ASCII characters, which std::ifstream doesn't handle. + llifstream inf(build_data_fname.c_str()); if (! inf.is_open()) { LL_WARNS() << "Can't initialize BugSplat, can't read '" << build_data_fname -- cgit v1.2.3 From 601cbe1f60b94ae8105329b4e4f745b36721e5aa Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 8 Dec 2018 12:18:46 -0500 Subject: SL-10153: Add ole32 to WINDOWS_LIBRARIES so it's everywhere we need. --- indra/newview/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f10b54d73c..99f99834f3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1585,7 +1585,6 @@ if (WINDOWS) kernel32 odbc32 odbccp32 - ole32 oleaut32 shell32 Vfw32 -- cgit v1.2.3 From 73eadfa12a23ed5e2e47c208f18795061caff6f3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 10 Dec 2018 17:11:40 -0500 Subject: INTL-318: Stop processing Danish and Polish language files. --- indra/newview/installers/windows/installer_template.nsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index b2d376d0c0..9a304559e1 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -51,27 +51,28 @@ RequestExecutionLevel highest # match MULTIUSER_EXECUTIONLEVEL ;; en-us as first language file." !include "%%SOURCE%%\installers\windows\lang_en-us.nsi" -!include "%%SOURCE%%\installers\windows\lang_da.nsi" +# Danish and Polish no longer supported by the viewer itself +##!include "%%SOURCE%%\installers\windows\lang_da.nsi" !include "%%SOURCE%%\installers\windows\lang_de.nsi" !include "%%SOURCE%%\installers\windows\lang_es.nsi" !include "%%SOURCE%%\installers\windows\lang_fr.nsi" !include "%%SOURCE%%\installers\windows\lang_ja.nsi" !include "%%SOURCE%%\installers\windows\lang_it.nsi" -!include "%%SOURCE%%\installers\windows\lang_pl.nsi" +##!include "%%SOURCE%%\installers\windows\lang_pl.nsi" !include "%%SOURCE%%\installers\windows\lang_pt-br.nsi" !include "%%SOURCE%%\installers\windows\lang_ru.nsi" !include "%%SOURCE%%\installers\windows\lang_tr.nsi" !include "%%SOURCE%%\installers\windows\lang_zh.nsi" # *TODO: Move these into the language files themselves -LangString LanguageCode ${LANG_DANISH} "da" +##LangString LanguageCode ${LANG_DANISH} "da" LangString LanguageCode ${LANG_GERMAN} "de" LangString LanguageCode ${LANG_ENGLISH} "en" LangString LanguageCode ${LANG_SPANISH} "es" LangString LanguageCode ${LANG_FRENCH} "fr" LangString LanguageCode ${LANG_JAPANESE} "ja" LangString LanguageCode ${LANG_ITALIAN} "it" -LangString LanguageCode ${LANG_POLISH} "pl" +##LangString LanguageCode ${LANG_POLISH} "pl" LangString LanguageCode ${LANG_PORTUGUESEBR} "pt" LangString LanguageCode ${LANG_RUSSIAN} "ru" LangString LanguageCode ${LANG_TURKISH} "tr" -- cgit v1.2.3 From c4096f670c7b3d43f8a5c1f65ef7e02033b0329d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 14 Dec 2018 15:38:13 -0500 Subject: SL-10153: Review and rationalize fetching paths from environment. Use LLStringUtil::getenv() or getoptenv() whenever we fetch a string that will be used as a pathname. Use LLFile::tmpdir() instead of getenv("TEMP"). As an added extra-special bonus, finally clean up $TMP/llcontrol-test-zzzzzz directories that have been accumulating every time we run a local build! --- indra/newview/llexternaleditor.cpp | 7 ++++--- indra/newview/llwebprofile.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index df9c848cb8..776bbf78c2 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -31,6 +31,7 @@ #include "llui.h" #include "llprocess.h" #include "llsdutil.h" +#include "llstring.h" #include // static @@ -188,12 +189,12 @@ std::string LLExternalEditor::findCommand( cmd = LLUI::sSettingGroups["config"]->getString(sSetting); LL_INFOS() << "Using setting" << LL_ENDL; } - else // otherwise use the path specified by the environment variable + else // otherwise use the path specified by the environment variable { - char* env_var_val = getenv(env_var.c_str()); + auto env_var_val(LLStringUtil::getoptenv(env_var)); if (env_var_val) { - cmd = env_var_val; + cmd = *env_var_val; LL_INFOS() << "Using env var " << env_var << LL_ENDL; } } diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 81d4e30a7a..8dcef2c7cd 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -33,6 +33,7 @@ #include "llimagepng.h" #include "llsdserialize.h" +#include "llstring.h" // newview #include "llpanelprofile.h" // for getProfileURL(). FIXME: move the method to LLAvatarActions @@ -264,6 +265,5 @@ void LLWebProfile::reportImageUploadStatus(bool ok) std::string LLWebProfile::getAuthCookie() { // This is needed to test image uploads on Linux viewer built with OpenSSL 1.0.0 (0.9.8 works fine). - const char* debug_cookie = getenv("LL_SNAPSHOT_COOKIE"); - return debug_cookie ? debug_cookie : sAuthCookie; + return LLStringUtil::getenv("LL_SNAPSHOT_COOKIE", sAuthCookie); } -- cgit v1.2.3 From b44fa5b970fea34fac2cfb429cd93300b4ae6707 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 16 Jan 2019 14:56:37 -0500 Subject: SL-10341: Fix Mojave mic permission problem - thanks Tonya Souther! --- indra/newview/Info-SecondLife.plist | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 9482f07524..cfe9d991c5 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -32,6 +32,8 @@ NSHumanReadableCopyright ${MACOSX_BUNDLE_COPYRIGHT} + NSMicrophoneUsageDescription + For voice chat, you must grant permission for Second Life to use the microphone. CFBundleDocumentTypes -- cgit v1.2.3 From 5b64f1939c5e2374a9157796de1ef6891258bbea Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 18 Jan 2019 20:04:44 +0200 Subject: SL-10153 bat file no longer should be in instal directory --- indra/newview/viewer_manifest.py | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4e8df5ce29..32773b2c36 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -498,7 +498,6 @@ class WindowsManifest(ViewerManifest): with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list self.path('SLVersionChecker.exe') - self.path('nextviewer.bat') with self.prefix(dst="vmp_icons"): with self.prefix(src=self.icon_path()): -- cgit v1.2.3 From aabca008adb91e28c810d7ed50e1ad86f53b7765 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 2 Feb 2019 13:53:57 -0500 Subject: DRTVWR-447: Comment out Danish and Polish in one more file. --- indra/newview/installers/windows/language_menu.nsi | Bin 1448 -> 1464 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/language_menu.nsi b/indra/newview/installers/windows/language_menu.nsi index 08ad42532f..2f426a0f47 100644 Binary files a/indra/newview/installers/windows/language_menu.nsi and b/indra/newview/installers/windows/language_menu.nsi differ -- cgit v1.2.3 From cfbe33d7c72c7677836d362fa4026f88df4c9f76 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 2 Feb 2019 14:01:39 -0500 Subject: SL-10396: Disable per-user installs: require Admin for all-users. --- .../installers/windows/installer_template.nsi | 46 ++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 9a304559e1..4afef4630c 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -32,7 +32,7 @@ SetCompress auto # Compress if saves space SetCompressor /solid lzma # Compress whole installer as one block SetDatablockOptimize off # Only saves us 0.1%, not worth it XPStyle on # Add an XP manifest to the installer -RequestExecutionLevel highest # match MULTIUSER_EXECUTIONLEVEL +RequestExecutionLevel admin # For when we write to Program Files ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Project flags @@ -106,11 +106,12 @@ AutoCloseWindow true # After all files install, close window !define MSUNINSTALL_KEY "${MSCURRVER_KEY}\Uninstall\${INSTNAME}" # from http://nsis.sourceforge.net/Docs/MultiUser/Readme.html -# Highest level permitted for user: Admin for Admin, Standard for Standard -!define MULTIUSER_EXECUTIONLEVEL Highest +### Highest level permitted for user: Admin for Admin, Standard for Standard +##!define MULTIUSER_EXECUTIONLEVEL Highest +!define MULTIUSER_EXECUTIONLEVEL Admin !define MULTIUSER_MUI -# Look for /AllUsers or /CurrentUser switches -!define MULTIUSER_INSTALLMODE_COMMANDLINE +### Look for /AllUsers or /CurrentUser switches +##!define MULTIUSER_INSTALLMODE_COMMANDLINE # appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64 !define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}" # expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing @@ -131,7 +132,7 @@ AutoCloseWindow true # After all files install, close window UninstallText $(UninstallTextMsg) DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) -!insertmacro MULTIUSER_PAGE_INSTALLMODE +##!insertmacro MULTIUSER_PAGE_INSTALLMODE !define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES @@ -326,6 +327,7 @@ StrCpy $INSTEXE "${INSTEXE}" StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" +Call CheckIfAdministrator # Make sure the user can install/uninstall Call CloseSecondLife # Make sure Second Life not currently running Call CheckWillUninstallV2 # Check if Second Life is already installed @@ -433,7 +435,7 @@ StrCpy $INSTSHORTCUT "${SHORTCUT}" # SetShellVarContext per the mode saved at install time in registry at # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME -# Couln't get NSIS to expand $MultiUser.InstallMode into the function name at Call time +# Couldn't get NSIS to expand $MultiUser.InstallMode into the function name at Call time ${If} $MultiUser.InstallMode == 'AllUsers' ##MessageBox MB_OK "Uninstalling for all users" Call un.MultiUser.InstallMode.AllUsers @@ -469,6 +471,36 @@ Call un.UserSettingsFiles SectionEnd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Make sure the user can install +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Function CheckIfAdministrator + DetailPrint $(CheckAdministratorInstDP) + UserInfo::GetAccountType + Pop $R0 + StrCmp $R0 "Admin" lbl_is_admin + MessageBox MB_OK $(CheckAdministratorInstMB) + Quit +lbl_is_admin: + Return + +FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Make sure the user can uninstall +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Function un.CheckIfAdministrator + DetailPrint $(CheckAdministratorUnInstDP) + UserInfo::GetAccountType + Pop $R0 + StrCmp $R0 "Admin" lbl_is_admin + MessageBox MB_OK $(CheckAdministratorUnInstMB) + Quit +lbl_is_admin: + Return + +FunctionEnd + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function CheckWillUninstallV2 ;; -- cgit v1.2.3 From 899cdb8a1b32d7d39b3a4b78ba41a0f4d87cb52f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 2 Feb 2019 16:32:22 -0500 Subject: SL-9980: Update to viewer-manager 524014 to drop Admin for viewer. But since that viewer-manager build depends on being able to read the application name from build_data.json (to locate the shortcut), add an AppName key to build_data.json. --- 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 32773b2c36..c0f642c852 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -431,7 +431,8 @@ class WindowsManifest(ViewerManifest): def finish_build_data_dict(self, build_data_dict): #MAINT-7294: Windows exe names depend on channel name, so write that in also - build_data_dict.update({'Executable':self.final_exe()}) + build_data_dict['Executable'] = self.final_exe() + build_data_dict['AppName'] = self.app_name() return build_data_dict def test_msvcrt_and_copy_action(self, src, dst): -- cgit v1.2.3 From d588660db1a1232731e3fb29eadc1c3951bf5dc3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 5 Feb 2019 14:35:36 -0500 Subject: SL-10469: Remove any similar shortcuts for old per-user install. --- .../newview/installers/windows/installer_template.nsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 4afef4630c..8af0f057ae 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -602,6 +602,24 @@ RMDir /r "$INSTDIR\skins" Delete "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk" Delete "$INSTDIR\releasenotes.txt" +# SL-10469: During the brief period when the BugSplat RC supported "current +# user" installs, we might have put a shortcut with this same $INSTSHORTCUT +# name in the Start menu folder for "current user" programs. Even though we're +# about to write our new shortcut to the Start menu folder for "all users," +# apparently Windows 7 only shows one of them. (Windows 10 reportedly shows +# both.) Try temporarily setting "current user," just long enough to delete +# any such old shortcuts. +SetShellVarContext current + +# This stanza should match the $SMPROGRAMS and $DESKTOP deletions in the +# "clean up shortcuts" passage in Section Uninstall. Don't bother with the +# shortcuts in $INSTDIR because we're just about to (over)write those. +Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*" +RMDir "$SMPROGRAMS\$INSTSHORTCUT" +Delete "$DESKTOP\$INSTSHORTCUT.lnk" + +SetShellVarContext all + FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- cgit v1.2.3 From d779a03f0bee51110a30a52eecc352f5074fa30a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 6 Feb 2019 09:17:06 -0500 Subject: SL-10469: Add diagnostic popup when trying to delete old shortcuts. --- .../installers/windows/installer_template.nsi | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 8af0f057ae..6bf4dba142 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -611,6 +611,32 @@ Delete "$INSTDIR\releasenotes.txt" # any such old shortcuts. SetShellVarContext current +Push $0 # FindFirst context +Push $1 # FindFirst/FindNext filename +Push $2 # cumulative filenames + +StrCpy $2 "Checking $SMPROGRAMS\$INSTSHORTCUT$\nAbout to delete:" + +ClearErrors +FindFirst $0 $1 "$SMPROGRAMS\$INSTSHORTCUT\*.*" +loop: +IfErrors done + StrCpy $2 "$2$\n$SMPROGRAMS\$INSTSHORTCUT\$1" + FindNext $0 $1 + Goto loop +done: +FindClose $0 + +StrCpy $2 "$2$\n$\nChecking $DESKTOP\$INSTSHORTCUT.lnk" +IfFileExists "$DESKTOP\$INSTSHORTCUT.lnk" 0 +2 +StrCpy $2 "$2$\n$DESKTOP\$INSTSHORTCUT.lnk" + +MessageBox MB_OK "$2" + +Pop $2 +Pop $1 +Pop $0 + # This stanza should match the $SMPROGRAMS and $DESKTOP deletions in the # "clean up shortcuts" passage in Section Uninstall. Don't bother with the # shortcuts in $INSTDIR because we're just about to (over)write those. -- cgit v1.2.3 From 5196bab897a2ef5810718409b98919c0642dc97e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 6 Feb 2019 13:14:17 -0500 Subject: SL-10469: Remove old-shortcut cleanup cruft: only works for Admin. The installer is (once again) running with Admin privilege elevation even for a Standard Windows user, so it can't determine the underlying Standard user. Therefore it can't clean up any per-user shortcuts left over for that Standard user. Moved the kludge to SLVersionChecker. --- .../installers/windows/installer_template.nsi | 44 ---------------------- 1 file changed, 44 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 6bf4dba142..4afef4630c 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -602,50 +602,6 @@ RMDir /r "$INSTDIR\skins" Delete "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk" Delete "$INSTDIR\releasenotes.txt" -# SL-10469: During the brief period when the BugSplat RC supported "current -# user" installs, we might have put a shortcut with this same $INSTSHORTCUT -# name in the Start menu folder for "current user" programs. Even though we're -# about to write our new shortcut to the Start menu folder for "all users," -# apparently Windows 7 only shows one of them. (Windows 10 reportedly shows -# both.) Try temporarily setting "current user," just long enough to delete -# any such old shortcuts. -SetShellVarContext current - -Push $0 # FindFirst context -Push $1 # FindFirst/FindNext filename -Push $2 # cumulative filenames - -StrCpy $2 "Checking $SMPROGRAMS\$INSTSHORTCUT$\nAbout to delete:" - -ClearErrors -FindFirst $0 $1 "$SMPROGRAMS\$INSTSHORTCUT\*.*" -loop: -IfErrors done - StrCpy $2 "$2$\n$SMPROGRAMS\$INSTSHORTCUT\$1" - FindNext $0 $1 - Goto loop -done: -FindClose $0 - -StrCpy $2 "$2$\n$\nChecking $DESKTOP\$INSTSHORTCUT.lnk" -IfFileExists "$DESKTOP\$INSTSHORTCUT.lnk" 0 +2 -StrCpy $2 "$2$\n$DESKTOP\$INSTSHORTCUT.lnk" - -MessageBox MB_OK "$2" - -Pop $2 -Pop $1 -Pop $0 - -# This stanza should match the $SMPROGRAMS and $DESKTOP deletions in the -# "clean up shortcuts" passage in Section Uninstall. Don't bother with the -# shortcuts in $INSTDIR because we're just about to (over)write those. -Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*" -RMDir "$SMPROGRAMS\$INSTSHORTCUT" -Delete "$DESKTOP\$INSTSHORTCUT.lnk" - -SetShellVarContext all - FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- cgit v1.2.3 From 1ff58087a9b4fcc7482079ca88523eace37f264c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 9 Feb 2019 10:51:00 -0500 Subject: SL-10506: Disregard any previous installation. Start from scratch. --- indra/newview/installers/windows/installer_template.nsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 4afef4630c..ff064b5f1e 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -117,8 +117,9 @@ AutoCloseWindow true # After all files install, close window # expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing %%PROGRAMFILES%% # should make MultiUser.nsh initialization read existing INSTDIR from registry -!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" -!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" +## SL-10506: don't +##!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" +##!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" # Don't set MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY and # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME to cause the installer to # write $MultiUser.InstallMode to the registry, because when the user installs -- cgit v1.2.3 From 3e17a3c84b6b50f729396d227224129781f9b8d7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Feb 2019 14:20:02 -0500 Subject: SL-10506: Try again to attain desired behavior. --- indra/newview/installers/windows/installer_template.nsi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index ff064b5f1e..4f9a1b7804 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -184,9 +184,20 @@ Function .onInit %%ENGAGEREGISTRY%% -# Setting MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY and +# SL-10506: Setting MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY and # MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME should # read the current location of the install for this version into INSTDIR. +# However, SL-10506 complains about the resulting behavior, so the logic below +# is adapted from before we introduced MultiUser.nsh. + +# if $0 is empty, this is the first time for this viewer name +ReadRegStr $0 SHELL_CONTEXT "${INSTNAME_KEY}" "" + +# viewer with this name was installed before +${If} $0 != "" + # use the value we got from registry as install location + StrCpy $INSTDIR $0 +${EndIf} Call CheckCPUFlags # Make sure we have SSE2 support Call CheckWindowsVersion # Don't install On unsupported systems -- cgit v1.2.3 From df840bde0f83c6ecf3b67c39bedf7f67a71b3dcd Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 21 Feb 2019 19:45:09 -1000 Subject: INTL-318: Add translations for new Windows installer messages. --- indra/newview/installers/windows/lang_de.nsi | Bin 12582 -> 13014 bytes indra/newview/installers/windows/lang_es.nsi | Bin 12630 -> 12744 bytes indra/newview/installers/windows/lang_fr.nsi | Bin 12990 -> 13262 bytes indra/newview/installers/windows/lang_it.nsi | Bin 12278 -> 12480 bytes indra/newview/installers/windows/lang_ja.nsi | Bin 9988 -> 9644 bytes indra/newview/installers/windows/lang_pt-br.nsi | Bin 12748 -> 12892 bytes indra/newview/installers/windows/lang_ru.nsi | Bin 11940 -> 12216 bytes indra/newview/installers/windows/lang_tr.nsi | Bin 12044 -> 12128 bytes indra/newview/installers/windows/lang_zh.nsi | Bin 9708 -> 9082 bytes 9 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/installers/windows/lang_de.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_es.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_fr.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_it.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_ja.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_pt-br.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_ru.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_tr.nsi mode change 100644 => 100755 indra/newview/installers/windows/lang_zh.nsi (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi old mode 100644 new mode 100755 index 6abd496849..8bb20476b3 Binary files a/indra/newview/installers/windows/lang_de.nsi and b/indra/newview/installers/windows/lang_de.nsi differ diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi old mode 100644 new mode 100755 index 5daac908c9..b45f0520c7 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi old mode 100644 new mode 100755 index c437a0bdb4..f038c0e419 Binary files a/indra/newview/installers/windows/lang_fr.nsi and b/indra/newview/installers/windows/lang_fr.nsi differ diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi old mode 100644 new mode 100755 index 78be4a3464..bd16d8318f Binary files a/indra/newview/installers/windows/lang_it.nsi and b/indra/newview/installers/windows/lang_it.nsi differ diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi old mode 100644 new mode 100755 index 2eb40e280b..71edde1992 Binary files a/indra/newview/installers/windows/lang_ja.nsi and b/indra/newview/installers/windows/lang_ja.nsi differ diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi old mode 100644 new mode 100755 index 79c2b7b114..0e7cbeacda Binary files a/indra/newview/installers/windows/lang_pt-br.nsi and b/indra/newview/installers/windows/lang_pt-br.nsi differ diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi old mode 100644 new mode 100755 index 0ef1023d88..8a362ba02a Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi old mode 100644 new mode 100755 index 4bb4e14bfa..8b8a69a024 Binary files a/indra/newview/installers/windows/lang_tr.nsi and b/indra/newview/installers/windows/lang_tr.nsi differ diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi old mode 100644 new mode 100755 index fccf119625..397bd0ac81 Binary files a/indra/newview/installers/windows/lang_zh.nsi and b/indra/newview/installers/windows/lang_zh.nsi differ -- cgit v1.2.3 From f235317cb2c0713530e2459ab6ca9556f2ac9904 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 21 Feb 2019 20:45:18 -1000 Subject: INTL-318: Fix syntax error in lang_es.nsi. --- indra/newview/installers/windows/lang_es.nsi | Bin 12744 -> 12744 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index b45f0520c7..8a81110069 100755 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ -- cgit v1.2.3 From c505cf1914110785b94268afbbfa8ecb0505c462 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 22 Feb 2019 05:20:09 -1000 Subject: INTL-318: Fix similar syntax error in lang_ru.nsi. --- indra/newview/installers/windows/lang_ru.nsi | Bin 12216 -> 12216 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index 8a362ba02a..d55aacc971 100755 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ -- cgit v1.2.3 From 765259b20060b51e236e326ae2ebe0a219c80864 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 22 Feb 2019 06:03:32 -1000 Subject: INTL-318: Fix syntax error in lang_tr.nsi. --- indra/newview/installers/windows/lang_tr.nsi | Bin 12128 -> 12126 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi index 8b8a69a024..4746f84482 100755 Binary files a/indra/newview/installers/windows/lang_tr.nsi and b/indra/newview/installers/windows/lang_tr.nsi differ -- cgit v1.2.3 From 03db2ddc9c27cf842c6185826617b0da0d2b87f5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 28 Feb 2019 18:12:29 -0500 Subject: increment viewer version to 6.1.1 --- 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 dfda3e0b4f..f3b5af39e4 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.1.0 +6.1.1 -- cgit v1.2.3