зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1680080 - Optimize proc macros / build dependencies. r=glandium,firefox-build-system-reviewers,mhentges
On a very parallel debug build, I see a long time just waiting for bindgen / style compilation / geckoservo. Turns out that a bunch of this is just proc macros / build scripts. Optimizing it saves between 10 and 17 seconds of my debug build. We might want to consider running bindgen much like cbindgen rather than rebuilding it all the time, which should help a lot more, but my guess is that this should still help with the pretty hot custom derives that the style crate runs. This needs rust 1.41, so the requirement for tools/crashreporter needs to be bumped as a consequence. To make things simpler, it was bumped to 1.47 while we're at it. Differential Revision: https://phabricator.services.mozilla.com/D98366
This commit is contained in:
Родитель
fe363fa80f
Коммит
04229a0075
|
@ -63,6 +63,14 @@ rpath = false
|
|||
debug-assertions = false
|
||||
panic = "abort"
|
||||
|
||||
# Optimize build dependencies, because bindgen and proc macros / style
|
||||
# compilation take more to run than to build otherwise.
|
||||
[profile.dev.build-override]
|
||||
opt-level = 1
|
||||
|
||||
[profile.release.build-override]
|
||||
opt-level = 1
|
||||
|
||||
[patch.crates-io]
|
||||
chardetng = { git = "https://github.com/hsivonen/chardetng", rev="7d5e0608d3e012bdfea3bd199111e3546607dd31" }
|
||||
libudev-sys = { path = "dom/webauthn/libudev-sys" }
|
||||
|
|
|
@ -165,7 +165,7 @@ def rust_compiler(rustc_info, cargo_info, build_project):
|
|||
)
|
||||
)
|
||||
if build_project == "tools/crashreporter":
|
||||
rustc_min_version = Version("1.38.0")
|
||||
rustc_min_version = Version("1.47.0")
|
||||
else:
|
||||
rustc_min_version = Version(MINIMUM_RUST_VERSION)
|
||||
cargo_min_version = rustc_min_version
|
||||
|
|
|
@ -72,14 +72,11 @@ ifndef MOZ_LTO_RUST_CROSS
|
|||
ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
|
||||
cargo_rustc_flags += -Clto
|
||||
endif
|
||||
# Versions of rust >= 1.45 need -Cembed-bitcode=yes for all crates when
|
||||
# using -Clto.
|
||||
ifeq (,$(filter 1.38.% 1.39.% 1.40.% 1.41.% 1.42.% 1.43.% 1.44.%,$(RUSTC_VERSION)))
|
||||
# We need -Cembed-bitcode=yes for all crates when using -Clto.
|
||||
RUSTFLAGS += -Cembed-bitcode=yes
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CARGO_INCREMENTAL
|
||||
export CARGO_INCREMENTAL
|
||||
|
|
Загрузка…
Ссылка в новой задаче