Skip to content

Commit

Permalink
bug 1515326 - properly map Rust standard library sources in symbol fi…
Browse files Browse the repository at this point in the history
…les. r=gsvelto

Since Rust 1.30 the Rust standard library is built with its source maps
remapped to start with "/rustc/<sha>/":
rust-lang/rust#53829

This patch changes the source file mapping logic in symbolstore.py to match.

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
luser committed Dec 19, 2018
1 parent b244966 commit 52c2dfe
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions toolkit/crashreporter/tools/symbolstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,20 +459,14 @@ def __init__(self, dump_syms, symbol_path,
self.generated_files = generated_files or {}
self.s3_bucket = s3_bucket
self.file_mapping = file_mapping or {}
# Add a static mapping for Rust sources.
target_os = buildconfig.substs['OS_ARCH']
rust_srcdir = None
if target_os == 'WINNT':
rust_srcdir = 'C:/projects/rust/'
elif target_os == 'Darwin':
rust_srcdir = '/Users/travis/build/rust-lang/rust/'
elif target_os == 'Linux':
rust_srcdir = '/checkout/'
if rust_srcdir is not None:
self.srcdirs.append(rust_srcdir)
Dumper.srcdirRepoInfo[rust_srcdir] = GitRepoInfo(rust_srcdir,
buildconfig.substs['RUSTC_COMMIT'],
'https://github.com/rust-lang/rust/')
# Add a static mapping for Rust sources. Since Rust 1.30 official Rust builds map
# source paths to start with "/rust/<sha>/".
rust_sha = buildconfig.substs['RUSTC_COMMIT']
rust_srcdir = '/rustc/' + rust_sha
self.srcdirs.append(rust_srcdir)
Dumper.srcdirRepoInfo[rust_srcdir] = GitRepoInfo(rust_srcdir,
rust_sha,
'https://github.com/rust-lang/rust/')

# subclasses override this
def ShouldProcess(self, file):
Expand Down

0 comments on commit 52c2dfe

Please sign in to comment.