Bug 1437627 - part 2 - move incremental compilation logic to moz.configure; r=chmanchester

Doing checks in Python is much simpler than doing them in Makefile
logic, and we're going to be adding some more complex logic in the next patch.
This commit is contained in:
Nathan Froyd 2018-03-12 12:25:39 -05:00
Родитель bf3af464e4
Коммит dfc23d3001
2 изменённых файлов: 22 добавлений и 4 удалений

Просмотреть файл

@ -1463,6 +1463,26 @@ def rust_compiler_flags(opt_level, debug_rust, debug_symbols):
set_config('MOZ_RUST_DEFAULT_FLAGS', rust_compiler_flags) set_config('MOZ_RUST_DEFAULT_FLAGS', rust_compiler_flags)
# Rust incremental compilation
# ==============================================================
@depends('MOZ_AUTOMATION')
def cargo_incremental(automation):
"""Return a value for the CARGO_INCREMENTAL environment variable."""
# 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'
# Don't do anything special in other situations.
return
set_config('CARGO_INCREMENTAL', cargo_incremental)
# Linker detection # Linker detection
# ============================================================== # ==============================================================

Просмотреть файл

@ -864,10 +864,8 @@ cargo_rustc_flags += -C lto
endif endif
endif endif
# Disable incremental Rust compilation in automation builds, where ifdef CARGO_INCREMENTAL
# the lack of environmental continuity makes it unhelpful. cargo_incremental := CARGO_INCREMENTAL=$(CARGO_INCREMENTAL)
ifdef MOZ_AUTOMATION
cargo_incremental := CARGO_INCREMENTAL=0
endif endif
rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)' rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)'