bug 1410148 - try to work around llvm-dsymutil crashes again by lowering rust debuginfo level on cross-mac builds. r=nalexander
authorTed Mielczarek <ted@mielczarek.org>
Tue, 14 Nov 2017 19:48:55 +0100
changeset 391840 e963baf002da6cc591edaa0ad6917b95188c337c
parent 391839 b567889382a5cc42c0e878d860937b7d6061cc2b
child 391841 c59835e48e57c6a9b433df0aa02f7db5db25b239
push id32905
push usernerli@mozilla.com
push dateWed, 15 Nov 2017 09:57:50 +0000
treeherdermozilla-central@45715ece25fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1410148
milestone59.0a1
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 1410148 - try to work around llvm-dsymutil crashes again by lowering rust debuginfo level on cross-mac builds. r=nalexander
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1325,19 +1325,19 @@ js_option(env='RUSTC_OPT_LEVEL',
           nargs=1,
           help='Rust compiler optimization level (-C opt-level=%s)')
 
 # --enable-release kicks in full optimizations.
 imply_option('RUSTC_OPT_LEVEL', '2', when='--enable-release')
 
 
 @depends('RUSTC_OPT_LEVEL', debug_rust, '--enable-debug-symbols',
-         moz_optimize)
+         moz_optimize, host, target)
 def rust_compiler_flags(opt_level_option, debug_rust, debug_symbols,
-                        moz_optimize):
+                        moz_optimize, host, target):
     optimize = moz_optimize.optimize
 
     # Cargo currently supports only two interesting profiles for building:
     # development and release. Those map (roughly) to --enable-debug and
     # --disable-debug in Gecko, respectively.
     #
     # But we'd also like to support an additional axis of control for
     # optimization level. Since Cargo only supports 2 profiles, we're in
@@ -1357,17 +1357,21 @@ def rust_compiler_flags(opt_level_option
         opt_level = '1' if optimize else '0'
 
     # opt-level=0 implies -C debug-assertions, which may not be desired
     # unless Rust debugging is enabled.
     if opt_level == '0' and not debug_rust:
         debug_assertions = False
 
     if debug_symbols:
-        debug_info = '2'
+        if host.kernel == 'Linux' and target.kernel == 'Darwin':
+            # hack to work around dsymutil failing on cross-OSX builds (bug 1410148)
+            debug_info = '1'
+        else:
+            debug_info = '2'
 
     opts = []
 
     if opt_level is not None:
         opts.append('opt-level=%s' % opt_level)
     if debug_assertions is not None:
         opts.append('debug-assertions=%s' %
                     ('yes' if debug_assertions else 'no'))