Skip to content

brew-rs: enable strip for release#21836

Open
samford wants to merge 1 commit intomainfrom
brew-rs-enable-strip-for-release
Open

brew-rs: enable strip for release#21836
samford wants to merge 1 commit intomainfrom
brew-rs-enable-strip-for-release

Conversation

@samford
Copy link
Member

@samford samford commented Mar 25, 2026


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

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.

That said, feel free to pass on this if it's not beneficial at this stage.

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.
Copilot AI review requested due to automatic review settings March 25, 2026 22:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants