Skip to content

Commit 5282e0c

Browse files
committed
bug 1515326 - properly map Rust standard library sources in symbol files. 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
1 parent 240a87b commit 5282e0c

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

toolkit/crashreporter/tools/symbolstore.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -459,20 +459,14 @@ def __init__(self, dump_syms, symbol_path,
459459
self.generated_files = generated_files or {}
460460
self.s3_bucket = s3_bucket
461461
self.file_mapping = file_mapping or {}
462-
# Add a static mapping for Rust sources.
463-
target_os = buildconfig.substs['OS_ARCH']
464-
rust_srcdir = None
465-
if target_os == 'WINNT':
466-
rust_srcdir = 'C:/projects/rust/'
467-
elif target_os == 'Darwin':
468-
rust_srcdir = '/Users/travis/build/rust-lang/rust/'
469-
elif target_os == 'Linux':
470-
rust_srcdir = '/checkout/'
471-
if rust_srcdir is not None:
472-
self.srcdirs.append(rust_srcdir)
473-
Dumper.srcdirRepoInfo[rust_srcdir] = GitRepoInfo(rust_srcdir,
474-
buildconfig.substs['RUSTC_COMMIT'],
475-
'https://github.com/rust-lang/rust/')
462+
# Add a static mapping for Rust sources. Since Rust 1.30 official Rust builds map
463+
# source paths to start with "/rust/<sha>/".
464+
rust_sha = buildconfig.substs['RUSTC_COMMIT']
465+
rust_srcdir = '/rustc/' + rust_sha
466+
self.srcdirs.append(rust_srcdir)
467+
Dumper.srcdirRepoInfo[rust_srcdir] = GitRepoInfo(rust_srcdir,
468+
rust_sha,
469+
'https://github.com/rust-lang/rust/')
476470

477471
# subclasses override this
478472
def ShouldProcess(self, file):

0 commit comments

Comments
 (0)