Skip to content

Commit e11c75d

Browse files
committed
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 rust-lang/rust#47507 about addressing the underlying issue upstream. MozReview-Commit-ID: LRwUj3fhiaO UltraBlame original commit: 261725e65af9b5d98ff593db3db08632bf019454
1 parent f849d27 commit e11c75d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

config/rules.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,12 @@ cargo_rustc_flags += -C lto
864864
endif
865865
endif
866866

867+
# Disable incremental Rust compilation in automation builds, where
868+
# the lack of environmental continuity makes it unhelpful.
869+
ifdef MOZ_AUTOMATION
870+
cargo_incremental := CARGO_INCREMENTAL=0
871+
endif
872+
867873
rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)'
868874

869875
ifdef MOZ_MSVCBITS
@@ -905,6 +911,7 @@ $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleane
905911
PKG_CONFIG_ALLOW_CROSS=1 \
906912
RUST_BACKTRACE=full \
907913
MOZ_TOPOBJDIR=$(topobjdir) \
914+
$(cargo_incremental) \
908915
$(2) \
909916
$(CARGO) $(1) $(cargo_build_flags)
910917
endef

0 commit comments

Comments
 (0)