diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 07b0113fdd39..611d5d52fe8c 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -1910,11 +1910,18 @@ def rust_compile_flags(opt_level, debug_rust, debug_symbols): # Rust incremental compilation # ============================================================== +js_option('--disable-cargo-incremental', + help='Disable incremental rust compilation.') -@depends(rustc_opt_level, debug_rust, 'MOZ_AUTOMATION', code_coverage) -def cargo_incremental(opt_level, debug_rust, automation, code_coverage): +@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.