Skip to content

Commit

Permalink
Bug 1430886 - Disable incremental rust in automation. r=froydnj
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent f849d27 commit e11c75d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e11c75d

Please sign in to comment.