bug 1275424 - hardcode Rust source paths in symbolstore.py. r=gps

This gives us source file names with repository info in our generated
symbol files, so that crash reports on crash-stats can link to the
correct source files for files from the Rust standard library.

I've hardcoded the source paths that the Rust project uses, which is
not my favorite thing, but there's no simple way to get this information
otherwise.

MozReview-Commit-ID: 6SeaMqH8xfc

--HG--
extra : rebase_source : 227a52db42b3f86378d744e68b4d88d2d8ba9757
This commit is contained in:
Ted Mielczarek 2017-06-23 16:19:49 -04:00
parent d5e2b3c9e6
commit e9db7838e4
2 changed files with 17 additions and 0 deletions

View File

@ -234,6 +234,9 @@ def rust_target_env_name(triple):
# converting a string to uppercase.
set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
# This is used for putting source info into symbol files.
set_config('RUSTC_COMMIT', depends(rustc_info)(lambda i: i.commit))
# Until we remove all the other Rust checks in old-configure.
add_old_configure_assignment('RUSTC', rustc)
add_old_configure_assignment('RUST_TARGET', rust_target_triple)

View File

@ -394,6 +394,20 @@ class Dumper:
if repo_manifest:
self.parse_repo_manifest(repo_manifest)
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/src/'
elif target_os == 'Darwin':
rust_srcdir = '/Users/travis/build/rust-lang/rust/src/'
elif target_os == 'Linux':
rust_srcdir = '/checkout/src/'
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/')
def parse_repo_manifest(self, repo_manifest):
"""