bug 1410148 - try to work around llvm-dsymutil crashes again by lowering rust debuginfo level on cross-mac builds. r?build-peer draft
authorTed Mielczarek <ted@mielczarek.org>
Tue, 14 Nov 2017 13:39:55 -0500
changeset 697802 00f0a2e9321a1ae5d9a01a5ad84680f1b2077336
parent 697757 b0a6b4678b2f7dfb499328946b95366775f71edd
child 740210 930495859faa2f1b54e6f424e76e25d97fd0237b
push id89100
push userbmo:ted@mielczarek.org
push dateTue, 14 Nov 2017 18:40:36 +0000
reviewersbuild-peer
bugs1410148
milestone59.0a1
bug 1410148 - try to work around llvm-dsymutil crashes again by lowering rust debuginfo level on cross-mac builds. r?build-peer MozReview-Commit-ID: 4JI0bjy7HdP
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'))