bug 1275424 - hardcode Rust source paths in symbolstore.py. r=gps
authorTed Mielczarek <ted@mielczarek.org>
Fri, 23 Jun 2017 16:19:49 -0400
changeset 366447 3b06dbb28dd4b764a650ebc9e87583e6cbb43696
parent 366446 3532c51a0635691e59b4d2eb60c7812d78b14e6e
child 366448 540e811a9a1118ca87569d08a47780c3c07ae402
push id32104
push usercbook@mozilla.com
push dateThu, 29 Jun 2017 13:46:04 +0000
treeherdermozilla-central@d2aff6fc075d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 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
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -229,11 +229,14 @@ set_config('RUST_HOST_TARGET', rust_host
 def rust_target_env_name(triple):
     return triple.upper().replace('-','_')
 # We need this to form various Cargo environment variables, as there is no
 # uppercase function in make, and we don't want to shell out just for
 # 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)
--- a/toolkit/crashreporter/tools/symbolstore.py
+++ b/toolkit/crashreporter/tools/symbolstore.py
@@ -389,16 +389,30 @@ class Dumper:
             self.archs = ['-a %s' % a for a in archs.split()]
         self.srcdirs = [os.path.normpath(self.FixFilenameCase(a)) for a in srcdirs]
         self.copy_debug = copy_debug
         self.vcsinfo = vcsinfo
         self.srcsrv = srcsrv
         if 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):
         Parse an XML manifest of repository info as produced
         by the `repo manifest -r` command.
         doc = parse(repo_manifest)
         if doc.firstChild.tagName != "manifest":