Bug 1380381 - Set rust debuginfo=1 for cross-OSX builds; r=glandium a=kwierso to reopen this CLOSED TREE
authorMike Shal <mshal@mozilla.com>
Thu, 13 Jul 2017 18:49:10 -0400
changeset 417497 67cd1ee26f2661fa5efe3d952485ab3c89af4271
parent 417496 1afceff864d54d89d49b99bc7d7a369af63a6eca
child 417498 f1f96310ee1f29b8aaa151bb291dc470b99571e9
child 417534 1a2bc58d4298f8e0bae68a79a4a18dd04b3665ef
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, kwierso
bugs1380381, 1301751
milestone56.0a1
first release with
nightly linux32
67cd1ee26f26 / 56.0a1 / 20170714100217 / files
nightly linux64
67cd1ee26f26 / 56.0a1 / 20170714100217 / files
nightly mac
67cd1ee26f26 / 56.0a1 / 20170714100307 / files
nightly win32
67cd1ee26f26 / 56.0a1 / 20170714030205 / files
nightly win64
67cd1ee26f26 / 56.0a1 / 20170714030205 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1380381 - Set rust debuginfo=1 for cross-OSX builds; r=glandium a=kwierso to reopen this CLOSED TREE This is similar to bug 1301751, where something in rust seems to trigger errors running dsymutil to generate debug symbols in OSX. We can set debuginfo=1 for these builds as a temporary workaround for now, while we work on a more permanent solution in rust and/or dsymutil. debuginfo=1 still gives us enough info for stack traces, although without line info. debuginfo=2 would be useful for debugging, but is irrelevant to crash reports. MozReview-Commit-ID: DdA00GzVfWg
config/rules.mk
python/mozbuild/mozbuild/frontend/emitter.py
toolkit/library/gtest/rust/Cargo.toml
toolkit/library/rust/Cargo.toml
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -901,20 +901,28 @@ rust_unlock_unstable =
 ifdef MOZ_RUST_SIMD
 rust_unlock_unstable += RUSTC_BOOTSTRAP=1
 endif
 
 ifdef MOZ_USING_SCCACHE
 sccache_wrap := RUSTC_WRAPPER='$(CCACHE)'
 endif
 
+# XXX hack to work around dsymutil failing on cross-OSX builds (bug 1380381)
+ifeq ($(HOST_OS_ARCH)-$(OS_ARCH),Linux-Darwin)
+rust_debug_info=1
+else
+rust_debug_info=2
+endif
+
 define RUN_CARGO
 env $(environment_cleaner) $(rust_unlock_unstable) $(rustflags_override) $(sccache_wrap) \
 	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
 	RUSTC=$(RUSTC) \
+	RUSTFLAGS='-C debuginfo=$(rust_debug_info)' \
 	MOZ_SRC=$(topsrcdir) \
 	MOZ_DIST=$(ABS_DIST) \
 	LIBCLANG_PATH="$(MOZ_LIBCLANG_PATH)" \
 	CLANG_PATH="$(MOZ_CLANG_PATH)" \
 	PKG_CONFIG_ALLOW_CROSS=1 \
 	RUST_BACKTRACE=1 \
 	MOZ_TOPOBJDIR=$(topobjdir) \
 	$(2) \
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -465,27 +465,25 @@ class TreeMetadataEmitter(LoggingMixin):
                     context)
 
             # gkrust and gkrust-gtest must have the exact same profile settings
             # for our almost-workspaces configuration to work properly.
             if libname in ('gkrust', 'gkrust-gtest'):
                 if profile_name == 'dev':
                     expected_profile = {
                         'opt-level': 1,
-                        'debug': True,
                         'rpath': False,
                         'lto': False,
                         'debug-assertions': True,
                         'codegen-units': 4,
                         'panic': 'abort',
                     }
                 else:
                     expected_profile = {
                         'opt-level': 2,
-                        'debug': True,
                         'rpath': False,
                         'lto': True,
                         'debug-assertions': False,
                         'panic': 'abort',
                     }
 
                 if profile != expected_profile:
                     raise SandboxValidationError(
--- a/toolkit/library/gtest/rust/Cargo.toml
+++ b/toolkit/library/gtest/rust/Cargo.toml
@@ -28,22 +28,20 @@ doctest = false
 bench = false
 doc = false
 plugin = false
 harness = false
 
 # Explicitly specify what our profiles use.
 [profile.dev]
 opt-level = 1
-debug = true
 rpath = false
 lto = false
 debug-assertions = true
 codegen-units = 4
 panic = "abort"
 
 [profile.release]
 opt-level = 2
-debug = true
 rpath = false
 lto = true
 debug-assertions = false
 panic = "abort"
--- a/toolkit/library/rust/Cargo.toml
+++ b/toolkit/library/rust/Cargo.toml
@@ -26,22 +26,20 @@ doctest = false
 bench = false
 doc = false
 plugin = false
 harness = false
 
 # Explicitly specify what our profiles use.
 [profile.dev]
 opt-level = 1
-debug = true
 rpath = false
 lto = false
 debug-assertions = true
 codegen-units = 4
 panic = "abort"
 
 [profile.release]
 opt-level = 2
-debug = true
 rpath = false
 lto = true
 debug-assertions = false
 panic = "abort"