Skip to content

[build] Shrink size of release binaries#288

Merged
joshlf merged 1 commit intomainfrom
G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7
Feb 9, 2026
Merged

[build] Shrink size of release binaries#288
joshlf merged 1 commit intomainfrom
G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7

Conversation

@joshlf
Copy link
Owner

@joshlf joshlf commented Feb 9, 2026


Latest Update: v3 — Compare vs v2

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v2 v1 Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 && git checkout -b pr-G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 FETCH_HEAD

Checkout

git fetch origin refs/heads/G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link

Summary of Changes

Hello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the build configuration for release binaries by adjusting the [profile.release] settings in Cargo.toml. The primary goal is to reduce the final binary size by stripping most debug information, while carefully preserving line tables to ensure that backtraces in production environments remain useful. Additionally, debug assertions are now enabled in release builds to catch logical errors earlier.

Highlights

  • Release Profile Configuration: The Cargo.toml release profile has been updated to optimize binary size while retaining essential debugging information.
  • Debug Information Stripping: The debug setting for release builds was changed from true to "line-tables-only". This significantly reduces binary size by including only line number information, which is crucial for useful backtraces without the overhead of full debug symbols.
  • Debug Assertions Enabled: Debug assertions have been explicitly enabled in release builds (debug-assertions = true). This helps catch logical errors at runtime even in optimized binaries, balancing performance with robustness.
Changelog
  • Cargo.toml
    • Modified the [profile.release] section to fine-tune build optimizations.
    • Updated the debug flag from true to "line-tables-only" to reduce binary size by only including line number information for backtraces.
    • Added strip = "none" to prevent the linker from stripping symbols, ensuring that the line-tables-only debug information is retained.
    • Introduced debug-assertions = true to enable runtime assertions in release builds, aiding in the detection of subtle bugs.
    • Added explanatory comments to clarify the purpose of these new release profile settings.
Activity
  • The pull request was opened by joshlf.
  • No further human activity (comments, reviews) has been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to shrink the size of release binaries by adjusting the release profile settings in Cargo.toml. While changing debug from true to "line-tables-only" is a good step in this direction, I've identified a couple of settings that seem to contradict this goal or could be improved. Specifically, enabling debug-assertions will increase binary size and impact performance, and not stripping symbols is a missed opportunity for size reduction. My review includes suggestions to address these points.

@joshlf joshlf force-pushed the G9cbf0a128de86e6698dc89a907801938e3aa19f8 branch from be1b0c6 to 1b53d85 Compare February 9, 2026 17:10
@joshlf joshlf force-pushed the G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 branch 2 times, most recently from 5612f0b to cd952bc Compare February 9, 2026 17:11
Base automatically changed from G9cbf0a128de86e6698dc89a907801938e3aa19f8 to main February 9, 2026 17:44
gherrit-pr-id: G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7
@joshlf joshlf force-pushed the G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 branch from cd952bc to 48df613 Compare February 9, 2026 17:44
@joshlf joshlf enabled auto-merge (squash) February 9, 2026 17:45
@joshlf joshlf merged commit 86b81a9 into main Feb 9, 2026
1 check passed
@joshlf joshlf deleted the G42a0cd29d11d5fb2b8499044cfc4ea80099f91f7 branch February 9, 2026 17:46
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.

1 participant