Skip to content

Commit add2e3e

Browse files
committed
Don't spend build time optimizing build-time-only crates
Crates used exclusively at build time, such as proc-macro crates and their dependencies, don't benefit substantially from optimization; they take far longer to optimize than time saved when running them during the build. No machine code from these crates will appear in the final compiled binary. Use the new profile-overrides mechanism in Rust 1.41 (https://doc.rust-lang.org/cargo/reference/profiles.html#overrides) to build such crates with opt-level 0. This substantially speeds up build time.
1 parent 00f66c8 commit add2e3e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ panic = 'abort'
7777
codegen-units = 1
7878
incremental = false
7979

80+
[profile.release.build-override]
81+
opt-level = 0
82+
8083
[workspace]
8184
members = [
8285
"gitoxide-core",

0 commit comments

Comments
 (0)