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:
Emilio Cobos Álvarez 2020-12-04 01:35:51 +00:00
Родитель fe363fa80f
Коммит 04229a0075
3 изменённых файлов: 10 добавлений и 5 удалений

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

@ -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