From a9735964e0fa49369f375781a68a40f86ca9e292 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 17 Jan 2018 08:32:51 -0800 Subject: [PATCH] Bug 1430886 - Disable incremental rust in automation. r=froydnj Work around excessive command-line length issues by disabling incremental rust compilation, which is enabled by default outside `cargo --release` starting with Rust 1.24. Incremental rust builds shouldn't help much in automation, where sccache provides the only continuity between build environments. In the meantime, they add a lot of object files to the link line. See https://github.com/rust-lang/rust/pull/47507 about addressing the underlying issue upstream. MozReview-Commit-ID: LRwUj3fhiaO --HG-- extra : rebase_source : 1739a7570b2e7fe40ead3b301ea20c2fe79f0431 --- config/rules.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/rules.mk b/config/rules.mk index ed56ca7bb695..cb750da4e44a 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -864,6 +864,12 @@ cargo_rustc_flags += -C lto endif endif +# Disable incremental Rust compilation in automation builds, where +# the lack of environmental continuity makes it unhelpful. +ifdef MOZ_AUTOMATION +cargo_incremental := CARGO_INCREMENTAL=0 +endif + rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)' ifdef MOZ_MSVCBITS @@ -905,6 +911,7 @@ $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleane PKG_CONFIG_ALLOW_CROSS=1 \ RUST_BACKTRACE=full \ MOZ_TOPOBJDIR=$(topobjdir) \ + $(cargo_incremental) \ $(2) \ $(CARGO) $(1) $(cargo_build_flags) endef