Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,20 @@ url = "2.5.4"
[profile.release]
codegen-units = 1
lto = true
debug = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

strip = true
panic = "abort"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to add some comments here about why we chose to abort on panic (to decrease the binary size)

Copy link
Contributor Author

@comphead comphead Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rolled back the panic behavior. the PR is for the strip only which is safe.

Panic compilation behavior is also applied to dependencies which can be shoot in the foot, and this parameter is not overridable on crate level
https://doc.rust-lang.org/cargo/reference/profiles.html#overrides

Overrides cannot specify the panic, lto, or rpath settings.

Although it saves extra 15-20% I dont think we can use it in near future


# the release profile takes a long time to build so we can use this profile during development to save time
# cargo build --profile release-nonlto
[profile.release-nonlto]
codegen-units = 16
debug = false
debug-assertions = false
incremental = false
inherits = "release"
lto = false
opt-level = 3
overflow-checks = false
panic = 'unwind'
rpath = false

[profile.ci]
Expand Down