Skip to content

Commit d355ce1

Browse files
authored
Merge pull request #1497 from TheBlueMatt/2022-05-no-default-opt
Disable LTO builds in tests (and bump deps to -O2)
2 parents af76fac + 8d35d2c commit d355ce1

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Cargo.toml

+11-5
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ exclude = [
1616
"no-std-check",
1717
]
1818

19-
# Our tests do actual crypto and lots of work, the tradeoff for -O1 is well worth it.
20-
# Ideally we would only do this in profile.test, but profile.test only applies to
21-
# the test binary, not dependencies, which means most of the critical code still
22-
# gets compiled as -O0. See
19+
# Our tests do actual crypto and lots of work, the tradeoff for -O2 is well
20+
# worth it. Note that we only apply optimizations to dependencies, not workspace
21+
# crates themselves.
2322
# https://doc.rust-lang.org/cargo/reference/profiles.html#profile-selection
23+
[profile.dev.package."*"]
24+
opt-level = 2
25+
26+
# It appears some minimal optimizations are required to inline many std methods
27+
# and reduce the otherwise-substantial time spent in std self-checks. We do so
28+
# here but ensure we keep LTO disabled as otherwise we're re-optimizing all our
29+
# dependencies every time we make any local changes.
2430
[profile.dev]
2531
opt-level = 1
26-
panic = "abort"
32+
lto = "off"
2733

2834
[profile.release]
2935
opt-level = 3

0 commit comments

Comments
 (0)