Bug 1594344 - Part 3: Use new dump_syms in automation. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Fri, 13 Dec 2019 10:28:13 +0000
changeset 506856 4e035d5e8d6cbc13c3332a4aa2253474045d9417
parent 506855 8514ded81b7734b025db53ce98e9ad7df67dc35c
child 506857 09beec6ec35dfe9e8420d2923860094293fd136b
push id36913
push useropoprus@mozilla.com
push dateFri, 13 Dec 2019 16:53:24 +0000
treeherdermozilla-central@1ed684598bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1594344
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1594344 - Part 3: Use new dump_syms in automation. r=froydnj This optionally uses the rust-based `dump_syms` toolchain if it has been installed, otherwise it uses the locally built version. Differential Revision: https://phabricator.services.mozilla.com/D53320
python/mozbuild/mozbuild/action/dumpsymbols.py
--- a/python/mozbuild/mozbuild/action/dumpsymbols.py
+++ b/python/mozbuild/mozbuild/action/dumpsymbols.py
@@ -23,20 +23,35 @@ def dump_symbols(target, tracking_file, 
         for d in dirs:
             shutil.rmtree(os.path.join(buildconfig.topobjdir, 'dist',
                                        'crashreporter-symbols', d),
                           ignore_errors=True)
 
     # Build default args for symbolstore.py based on platform.
     sym_store_args = []
 
-    dump_syms_bin = os.path.join(buildconfig.topobjdir,
-                                 'dist', 'host',
-                                 'bin', 'dump_syms')
-    dump_syms_bin = '%s%s' % (dump_syms_bin, buildconfig.substs['BIN_SUFFIX'])
+    # Find the `dump_syms` binary to use.
+    dump_syms_bin = None
+    dump_syms_binaries = []
+
+    # Prefer the `dump_syms` toolchain.
+    fetches_dir = os.environ.get('MOZ_FETCHES_DIR')
+    if fetches_dir:
+        dump_syms_binaries.append(
+            os.path.join(fetches_dir, 'dump_syms', 'dump_syms'))
+
+    # Fallback to the in-tree breakpad version.
+    dump_syms_binaries.append(os.path.join(buildconfig.topobjdir,
+                                           'dist', 'host',
+                                           'bin', 'dump_syms'))
+
+    for b in dump_syms_binaries:
+        dump_syms_bin = '%s%s' % (b, buildconfig.substs['BIN_SUFFIX'])
+        if os.path.exists(dump_syms_bin):
+            break
 
     os_arch = buildconfig.substs['OS_ARCH']
     if os_arch == 'WINNT':
         sym_store_args.extend(['-c', '--vcs-info'])
         if os.environ.get('PDBSTR_PATH'):
             sym_store_args.append('-i')
         os.environ['PATH'] = os.pathsep.join((buildconfig.substs['WIN_DIA_SDK_BIN_DIR'],
                                               os.environ['PATH']))