Bug 1516367 - Move the minidump-analyzer out of the crash reporter application bundle r=spohl,dmajor

The minidump-analyzer tool was originally conceived to be used from the crash
report client and as such was installed in the crash reporter client
application bundle on macOS. It was later adapted to work from Firefox itself
but this caused linking problems when invoked from the Firefox app bundle.
This patch moves the minidump-analyzer into the Firefox app bundle and adapts
the relevant code to find it there.

The minidump-analyzer was also not signed like the rest of our executables and
this patch addresses that issue too.

Differential Revision: https://phabricator.services.mozilla.com/D52910

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gabriele Svelto 2019-11-14 21:11:59 +00:00
parent a302d8f76b
commit 6ff1e8b815
8 changed files with 23 additions and 20 deletions

View File

@ -10,6 +10,9 @@
#if defined(MOZ_ASAN) || defined(MOZ_TSAN)
/llvm-symbolizer
#endif
#if defined(MOZ_CRASHREPORTER)
/minidump-analyzer
#endif
/pingsender
/pk12util
/ssltunnel

View File

@ -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@

View File

@ -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',

View File

@ -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 \

View File

@ -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];

View File

@ -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;

View File

@ -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<std::string, std::string> StringTable;

View File

@ -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