[meta] a few changes to prevent duplicate dep builds #4535
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has a few changes that make builds and test runs significantly faster:
xtask
from the list of default-members. This makes it so thatcargo nextest run
andcargo nextest run -p <package>
use more dependency feature sets in common.opt-level
settings fromprofile.test
toprofile.dev
. Again, this results in more cache hits.profile.dev.panic
tounwind
. This is to unify build units across dev and test builds: tests are always built withpanic = "unwind"
so that proper backtraces can be printed out. Release builds stay asabort
.crdb-seed
script use thetest
profile. If there are any divergences betweendev
andtest
in the future, then crdb-seed should share its build cache with the tests it was presumably invoked for.profile.dev.build-override.debug
toline-tables-only
. This, along with 3, means that target (normal/dev) and build (host) dependencies are now unified.All of this comes together for a pretty sweet improvement.
See #4392 for more details and how I investigated this issue.
Impact
With a fresh build on Linux with mold, I ran three commands in sequence:
cargo nextest run --no-run
cargo nextest run -p nexus-db-queries
cargo build -p omicron-nexus
The results were:
cargo nextest run
cargo nextest run -p nexus-db-queries
cargo nextest run -p nexus-db-queries
crdb-seed
buildcargo build -p omicron-nexus
So the cumulative time spent on these three commands went from 354s to 279s. That's a 1.26x speedup. And this should also make other commands better as well (omicron-nexus is a bit of a weird case because it takes a very long time to compile by itself, and that 69s in the "after" column is entirely building omicron-nexus).