Bug 1552021 - Add an option to turn off rust incremental compilation. r=froydnj
authorChris Manchester <cmanchester@mozilla.com>
Fri, 17 May 2019 23:00:30 +0000
changeset 533241 197df45a8076f497c59951d3ab818af9ba7eedcc
parent 533240 573f03a88ea975a5b5155c902a8af5d2e50d68c5
child 533242 0649547f4b2947c188067f0502733100b6d7f92d
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1552021
milestone68.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 1552021 - Add an option to turn off rust incremental compilation. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D31341
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1905,21 +1905,28 @@ def rust_compile_flags(opt_level, debug_
         flags.extend(['-C', opt])
 
     return flags
 
 
 # Rust incremental compilation
 # ==============================================================
 
-
-@depends(rustc_opt_level, debug_rust, 'MOZ_AUTOMATION', code_coverage)
-def cargo_incremental(opt_level, debug_rust, automation, code_coverage):
+js_option('--disable-cargo-incremental',
+          help='Disable incremental rust compilation.')
+
+@depends(rustc_opt_level, debug_rust, 'MOZ_AUTOMATION', code_coverage,
+         '--disable-cargo-incremental')
+def cargo_incremental(opt_level, debug_rust, automation, code_coverage,
+                      enabled):
     """Return a value for the CARGO_INCREMENTAL environment variable."""
 
+    if not enabled:
+        return '0'
+
     # We never want to use incremental compilation in automation.  sccache
     # handles our automation use case much better than incremental compilation
     # would.
     if automation:
         return '0'
 
     # Coverage instrumentation doesn't play well with incremental compilation
     # https://github.com/rust-lang/rust/issues/50203.