Bug 1412044 - Use separate arguments for rustc's -C option; r=ted
authorGregory Szorc <gps@mozilla.com>
Thu, 26 Oct 2017 11:26:14 -0700
changeset 388478 bc103ec9d0b3b40aca71d58c70d59d718a421788
parent 388477 5b8628d4ac4d04dca2ce461caa438c6c28b19e6a
child 388479 6d2368c95edb057ecd1043e6b183347127159a1e
push id54166
push usergszorc@mozilla.com
push dateThu, 26 Oct 2017 18:31:34 +0000
treeherderautoland@bc103ec9d0b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1412044, 1411081
milestone58.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 1412044 - Use separate arguments for rustc's -C option; r=ted We subtly changed from "-C opt=value" to "-Copt=value" in 472232499478 (bug 1411081). This change appears to confuse sccache (which has its own option parser). This commit restores the old behavior of using separate arguments for -C and its value. MozReview-Commit-ID: JCnAjt1Tdsa
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1341,25 +1341,29 @@ def rust_compiler_flags(opt_level_option
     # 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'
 
-    flags = []
+    opts = []
 
     if opt_level is not None:
-        flags.append('-Copt-level=%s' % opt_level)
+        opts.append('opt-level=%s' % opt_level)
     if debug_assertions is not None:
-        flags.append('-Cdebug-assertions=%s' %
+        opts.append('debug-assertions=%s' %
                      ('yes' if debug_assertions else 'no'))
     if debug_info is not None:
-        flags.append('-Cdebuginfo=%s' % debug_info)
+        opts.append('debuginfo=%s' % debug_info)
+
+    flags = []
+    for opt in opts:
+        flags.extend(['-C', opt])
 
     return flags
 
 
 set_config('MOZ_RUST_DEFAULT_FLAGS', rust_compiler_flags)
 
 # Linker detection
 # ==============================================================