Skip to content

Commit

Permalink
build: Make backtraces useable in release builds
Browse files Browse the repository at this point in the history
Having `panic = "abort"` and `strip = "symbols"` makes backtraces generated with `RUST_BACKTRACE=1` completely useless in release builds.

By changing these options to `panic = "unwind"` and `strip = "debuginfo"` makes backtraces usable in release builds. This will help us debug issues we are unable to reproduce, since we can ask users to set `RUST_BACKTRACE=1` and provide the logs with this option.
  • Loading branch information
szokeasaurusrex committed Dec 19, 2024
1 parent 5bd1089 commit e51acd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ winapi = "0.3.9"
# We optimize the release build for size.
[profile.release]
opt-level = "z"
panic = "abort"
strip = true # Strip symbols from the binary.
codegen-units = 1 # Parallel compilation prevents some optimizations.
panic = "unwind" # Abort makes backtraces useless.
strip = "debuginfo" # Only strip debuginfo (not symbols) to keep backtraces useful.
codegen-units = 1 # Parallel compilation prevents some optimizations.
# We do not enable link-time optimizations (lto) because they cause the
# CLI to timeout when run in Xcode Cloud.

0 comments on commit e51acd9

Please sign in to comment.