Open
Conversation
Unless we need (or would benefit from) symbols, stripping them reduces binary size from 6.3 MB to 5 MB without any notable change to build time. Binary size could be further reduced to 3.9 MB by adding `codegen-units = 1` and `lto = true` to `profile.release` but it doubles compile time on my machine. It's worth doing if/when we get to a point where we compile `brew-rs` in CI and ship binaries to users but I've left those off for now to keep compile time down.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces the size of the experimental brew-rs Rust frontend binary by enabling symbol stripping for release builds via Cargo’s release profile settings.
Changes:
- Configure Cargo release builds to strip symbols for
brew-rs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
carlocab
reviewed
Mar 25, 2026
Member
carlocab
left a comment
There was a problem hiding this comment.
We probably don't want to do this yet; the symbols are useful if you want to attach this to a debugger.
In the longer-term it might be nice to keep a build with debug symbols for users with HOMEBREW_DEVELOPER set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew lgtm(style, typechecking and tests) with your changes locally?Unless we need (or would benefit from) symbols, stripping them reduces binary size from 6.3 MB to 5 MB without any notable change to build time.
Binary size could be further reduced to 3.9 MB by adding
codegen-units = 1andlto = truetoprofile.releasebut it doubles compile time on my machine. It's worth doing if/when we get to a point where we compilebrew-rsin CI and ship binaries to users but I've left those off for now to keep compile time down.That said, feel free to pass on this if it's not beneficial at this stage.