diff --git a/browser/app/macbuild/Contents/MacOS-files.in b/browser/app/macbuild/Contents/MacOS-files.in index 3dac37a298b9..ea9e0ce1109f 100644 --- a/browser/app/macbuild/Contents/MacOS-files.in +++ b/browser/app/macbuild/Contents/MacOS-files.in @@ -10,6 +10,9 @@ #if defined(MOZ_ASAN) || defined(MOZ_TSAN) /llvm-symbolizer #endif +#if defined(MOZ_CRASHREPORTER) +/minidump-analyzer +#endif /pingsender /pk12util /ssltunnel diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 826e6ab60545..92ae9f605273 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -410,7 +410,6 @@ bin/libfreebl_64int_3.so #else @BINPATH@/crashreporter@BIN_SUFFIX@ @RESPATH@/crashreporter.ini -@BINPATH@/minidump-analyzer@BIN_SUFFIX@ #ifdef XP_UNIX @RESPATH@/Throbber-small.gif #endif @@ -421,6 +420,12 @@ bin/libfreebl_64int_3.so #endif #endif +; [ minidump-analyzer ] +; +#ifdef MOZ_CRASHREPORTER +@BINPATH@/minidump-analyzer@BIN_SUFFIX@ +#endif + ; [ Ping Sender ] ; @BINPATH@/pingsender@BIN_SUFFIX@ diff --git a/python/mozbuild/mozbuild/artifacts.py b/python/mozbuild/mozbuild/artifacts.py index ca70ce6ddda6..d0b4488eb169 100644 --- a/python/mozbuild/mozbuild/artifacts.py +++ b/python/mozbuild/mozbuild/artifacts.py @@ -460,6 +460,7 @@ class MacArtifactJob(ArtifactJob): 'libmozavutil.dylib', 'libmozavcodec.dylib', 'libsoftokn3.dylib', + 'minidump-analyzer', 'pingsender', 'plugin-container.app/Contents/MacOS/plugin-container', 'updater.app/Contents/MacOS/org.mozilla.updater', @@ -504,9 +505,6 @@ class MacArtifactJob(ArtifactJob): # These get copied into dist/bin with the path, so "root/a/b/c" -> "dist/bin/a/b/c". paths_keep_path = [ - ('Contents/MacOS', [ - 'crashreporter.app/Contents/MacOS/minidump-analyzer', - ]), ('Contents/Resources', [ 'browser/components/libbrowsercomps.dylib', 'dependentlibs.list', diff --git a/security/mac/hardenedruntime/codesign.bash b/security/mac/hardenedruntime/codesign.bash index e3e80bc83a49..068f4042707d 100755 --- a/security/mac/hardenedruntime/codesign.bash +++ b/security/mac/hardenedruntime/codesign.bash @@ -117,6 +117,7 @@ xattr -cr "${BUNDLE}" codesign --force -o runtime --verbose --sign "$IDENTITY" \ "${BUNDLE}/Contents/MacOS/XUL" \ "${BUNDLE}/Contents/MacOS/pingsender" \ +"${BUNDLE}/Contents/MacOS/minidump-analyzer" \ "${BUNDLE}"/Contents/MacOS/*.dylib codesign --force -o runtime --verbose --sign "$IDENTITY" --deep \ diff --git a/toolkit/components/crashes/CrashService.jsm b/toolkit/components/crashes/CrashService.jsm index c433c026e873..702262706e61 100644 --- a/toolkit/components/crashes/CrashService.jsm +++ b/toolkit/components/crashes/CrashService.jsm @@ -36,13 +36,6 @@ function runMinidumpAnalyzer(minidumpPath, allThreads) { const exeName = "minidump-analyzer" + binSuffix; let exe = Services.dirsvc.get("GreBinD", Ci.nsIFile); - - if (AppConstants.platform === "macosx") { - exe.append("crashreporter.app"); - exe.append("Contents"); - exe.append("MacOS"); - } - exe.append(exeName); let args = [minidumpPath]; diff --git a/toolkit/crashreporter/client/crashreporter.cpp b/toolkit/crashreporter/client/crashreporter.cpp index 80b9162f67a4..ee23ee8609a0 100644 --- a/toolkit/crashreporter/client/crashreporter.cpp +++ b/toolkit/crashreporter/client/crashreporter.cpp @@ -531,6 +531,16 @@ static string GetProgramPath(const string& exename) { string path = gArgv[0]; size_t pos = path.rfind(UI_CRASH_REPORTER_FILENAME BIN_SUFFIX); path.erase(pos); +#ifdef XP_MACOSX + // On macOS the crash reporter client is shipped as an application bundle + // contained within Firefox' main application bundle. So when it's invoked + // its current working directory looks like: + // Firefox.app/Contents/MacOS/crashreporter.app/Contents/MacOS/ + // The other applications we ship with Firefox are stored in the main bundle + // (Firefox.app/Contents/MacOS/) so we we need to go back three directories + // to reach them. + path.append("../../../"); +#endif // XP_MACOSX path.append(exename + BIN_SUFFIX); return path; diff --git a/toolkit/crashreporter/client/crashreporter.h b/toolkit/crashreporter/client/crashreporter.h index 57c9ad925dd6..ff42bf47662e 100644 --- a/toolkit/crashreporter/client/crashreporter.h +++ b/toolkit/crashreporter/client/crashreporter.h @@ -39,11 +39,7 @@ std::string WideToUTF8(const std::wstring& wide, bool* success = 0); #define UI_CRASH_REPORTER_FILENAME "crashreporter" #define UI_MINIDUMP_ANALYZER_FILENAME "minidump-analyzer" -#ifndef XP_MACOSX -# define UI_PING_SENDER_FILENAME "pingsender" -#else -# define UI_PING_SENDER_FILENAME "../../../pingsender" -#endif +#define UI_PING_SENDER_FILENAME "pingsender" typedef std::map StringTable; diff --git a/toolkit/crashreporter/minidump-analyzer/moz.build b/toolkit/crashreporter/minidump-analyzer/moz.build index 59022733ce0d..63d2f6e6ec2e 100644 --- a/toolkit/crashreporter/minidump-analyzer/moz.build +++ b/toolkit/crashreporter/minidump-analyzer/moz.build @@ -5,10 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_TARGET'] != 'Android': - GeckoProgram(name='minidump-analyzer', linkage=None) - - if CONFIG['OS_TARGET'] == 'Darwin': - DIST_SUBDIR = 'crashreporter.app/Contents/MacOS' + GeckoProgram('minidump-analyzer', linkage=None) if CONFIG['OS_TARGET'] == 'WINNT': DEFINES['UNICODE'] = True