Bug 1416490 - Check for a value passed to RUSTC_OPT_LEVEL rather than whether its value was a default. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Mon, 13 Nov 2017 22:07:46 -0800
changeset 436399 89af2bd84c001d94d22cf070b7acee7f13e4453d
parent 436398 26b0f3f9fca10fc215d2c597050e20ed21cad510
child 436400 0545f114fb5be72f45e8678f0cd258824761bda5
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersglandium
bugs1416490
milestone59.0a1
Bug 1416490 - Check for a value passed to RUSTC_OPT_LEVEL rather than whether its value was a default. r=glandium The current code will fail if "RUSTC_OPT_LEVEL=" is passed. This can happen if the value isn't present and that fact is injected into js' configure. We only want to respect RUSTC_OPT_LEVEL if a value is passed, so we simply check for the presence of a value rather than its origin. MozReview-Commit-ID: 6GhLfprJEEn
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1346,17 +1346,17 @@ def rust_compiler_flags(opt_level_option
     # Code here derives various compiler options given other configure options.
     # The options defined here effectively override defaults specified in
     # Cargo.toml files.
 
     opt_level = None
     debug_assertions = None
     debug_info = None
 
-    if opt_level_option.origin != 'default':
+    if opt_level_option:
         opt_level = opt_level_option[0]
     else:
         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