Skip to content

Commit

Permalink
Cargo.toml: Add profile.checked-release (#1289)
Browse files Browse the repository at this point in the history
Add a `--profile checked-release`, which is mostly `release`, but with
all checks enabled (e.x. `debug-assertions` and `overflow-checks`). This
doesn't need to absolute highest performance, so `opt-level = 2` is done
instead of `opt-level = 3`, and `codegen-units = 16` is used as well
(the normal `release` default, overridden by us to `codegen-units = 1`).

This is especially helpful when running tests locally under qemu, which
can be very slow if running the `opt-dev` profile. This could also be
used in CI instead of `opt-dev`, as `opt-level = 2` should help those
run quite a bit faster while still having all checks enabled.
  • Loading branch information
kkysen authored Jul 8, 2024
2 parents 4dda579 + 93cd247 commit 9c76e36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ panic = "abort"
[profile.release-with-debug]
inherits = "release"
debug = "line-tables-only"

[profile.checked-release]
# Close to a release build, but with all checks enabled.
inherits = "dev"
opt-level = 2
codegen-units = 16

0 comments on commit 9c76e36

Please sign in to comment.