From cb21b61e010dfbef370c701c731323a4ba316537 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Tue, 10 Dec 2019 13:37:45 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- .../mozbuild/mozbuild/action/dumpsymbols.py | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/python/mozbuild/mozbuild/action/dumpsymbols.py b/python/mozbuild/mozbuild/action/dumpsymbols.py index 0b6e8bd2f4de..0e8510b29368 100644 --- a/python/mozbuild/mozbuild/action/dumpsymbols.py +++ b/python/mozbuild/mozbuild/action/dumpsymbols.py @@ -28,10 +28,25 @@ def dump_symbols(target, tracking_file, count_ctors=False): # 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':