Skip to content

Commit

Permalink
build: align opt-level for crate build deps
Browse files Browse the repository at this point in the history
Our OS packages are built as a byproduct of build script execution,
while the final Rust artifacts are largely ignored.

Since Rust 1.47.0, cargo builds host dependencies like build scripts
with opt-level "0" by default, which did not match the "z" level we
picked to minimize the size of the output artifacts.

This caused package build dependencies to be built more than once,
with concurrent Docker builds for the same package. This is wasteful
and creates races that our build tool does not handle gracefully.

By aligning the opt-level we restore the previous behavior.

Signed-off-by: Ben Cressey <[email protected]>
  • Loading branch information
bcressey committed Oct 9, 2020
1 parent 422f8a9 commit 3e75f29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ members = [
[profile.dev]
debug = false
opt-level = 'z'

[profile.dev.build-override]
opt-level = 'z'

0 comments on commit 3e75f29

Please sign in to comment.