Reduce release binary size#7
Merged
Merged
Conversation
Why: - The release executable carried avoidable size from anyhow and the previous size optimization setting. - The binary-size CI matrix tracks platform limits, so keeping the artifact smaller gives more headroom. What: - Replace anyhow with a small project-local string-backed error type and context helpers. - Keep existing bail/ensure-style validation through local macros. - Switch release opt-level from z to s after measurement showed a smaller local artifact. Impact: - Local macOS release binary changed from 675552 bytes to 598064 bytes, saving 77488 bytes. - No data format, crypto, KDF, or compression behavior changes. - Verified with cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked, cargo build --release, and cargo bloat --release. Prompt: - Find ways to decrease executable size using cargo bloat at discretion.
Why: - The PR should include the research, plan, and implementation checklist that guided the executable-size reduction. What: - Add the task-scoped codex notes for research, plan, and feature validation. Impact: - No runtime behavior changes. - Notes document the constraints, rejected options, measurements, and completed validation. Prompt: - Include the notes in the executable-size reduction PR.
Why: - The executable-size reduction creates enough headroom to enforce stricter CI limits. What: - Lower Linux, macOS, and Windows release executable size thresholds. Impact: - No runtime behavior changes. - CI now fails earlier on binary-size regressions. - Limits retain headroom over observed PR sizes: Linux 682552, macOS 598048, Windows 458240. Prompt: - If the size decreased that much, you can make the size limits stricter.
Why: - Executable-size comparisons need ambient compiler context, especially rustc version. What: - Print rustc --version --verbose and cargo --version --verbose in each executable-size matrix job before building. Impact: - No runtime behavior changes. - CI logs now capture compiler/tool versions for Linux, macOS, and Windows size measurements. Prompt: - Need to include ambient info. rustc version is necessary.
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.
Summary
Local size result
Cross-platform CI size result
Ambient CI info
Validation