Repository navigation
Reduce release build time and binary size - #1449
Conversation
Use one codegen unit for release builds based on repeated hosted build measurements. Preserve the existing effective setting for inherited profiles. Assisted-by: Codex: GPT-6
|
Final reviewer: I turned auto-merge off on Generated by Claude Code |
|
Ready for review (burn-down agent)
Generated by Claude Code |
Final review briefWhat it does: Sets Risk: low. One file, four added lines, build config only. The only thing that changes is how the shipped binary is compiled ( Look here:
Verified: read the full diff. Checked that no other profile inherits Changes I made: none. Open questions: none blocking. The PR description's "CI" section still says Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
* ci(release): publish npm from release.yml, not publish-npm.yml Every socket-patch npm package's trusted publisher is registered against release.yml, and npm allows only one publisher per package. The 5.0.0 release dispatched publish-npm.yml, whose OIDC token named that file, so npm rejected it with E401 before staging anything. Move the npm leg back inline as release.yml's npm-publish job (same steps as publish-npm.yml) and delete publish-npm.yml, so the existing registration keeps working. Add an `npm-retry-version` input that skips the version gate, build, tag, GitHub release and crates.io jobs and re-stages npm from an existing release's assets; this retries 5.0.0 now and replaces the manual Publish npm dispatch. crates.io stays dispatched through publish-cargo.yml, since crates.io allows several publishers per crate. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): fold 22 more PRs into the 5.0.0 notes Cover the PRs merged to main after #1432's base (1779317..4cb3643): Cargo source replacement and registry = "crates-io" (#338/#455, #386), pnpm lockfile=false (#1074), berry removed descriptors (#1435), yarnrc ${VAR} reads (#1100), CRLF .npmrc append (#1196), Composer vendor-dir cascade and global home (#439/#686, #586), Go +incompatible vex (#484), gem moved BUNDLE_GEMFILE and commented Gemfile revert (#952, #988), Poetry source = "pypi" (#1282) and Hatch path characters (#547). No entries for #1411 (macOS fix to code #1393 added in this release; the #1393 entry already describes the intended behavior), #1426 (perf regression introduced and fixed within 5.0.0) or the CI/test/bench PRs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): cover #1419, #1434, #1440, #1442, #1444 in the 5.0.0 notes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): 5.0.1 Cut [Unreleased] into [5.0.1] — 2026-10-13 and stamp 5.0.1 with scripts/version-sync.sh. The 5.0.1 notes cover main through 501c6d9 (#1449), i.e. every PR after the v5.0.0 tag (6ad6add): the npm publish fix (5.0.0 never reached npm or crates.io, 5.0.1 is the first v5 there), #1465, #759, #1460, #1462, #1445, #869, #1447, #1450, #1467, and #1449 under Maintenance. CI/test-only PRs (#1448, #1452, #1454, #1457, #1459) have no entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): 5.0.1 notes for PRs merged since the cut Covers #1469, #1470, #1474, #1475, #1478, #1479, #1480 and #1482; #1484 is CI-only. The notes now cover main through 285a5e8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
LLM Description written by Codex: GPT-6
User impact
Release builds can complete faster and produce a smaller CLI binary. The repeated hosted measurement on Rust 1.93.1 reported median build times of 350.780s with the default settings and 333.036s with one codegen unit, a 5.06% ratio-of-medians reduction. The measured binary was 16.27% smaller.
Change
Set
[profile.release]to one codegen unit. Setci-release,perf, andaddonexplicitly to 16 to preserve their current inherited configuration.Evidence and limits
The repeated hosted run is here. It used Ubuntu 24.04 x86_64 and Rust 1.93.1. Its source revision predates the current main source tree; current main has changed Rust code since the measurement, so exact build-time and size results may differ. This measurement does not claim runtime improvement or results for other release platforms.
Exact-head validation
On macOS 27 arm64 with Rust 1.93.1 and clean, separate targets, the candidate release build completed in 210.836s versus 220.474s for the same commit with a codegen-units=16 override. Compiler invocations confirmed codegen-units 1 and 16 respectively. This is one pair (4.37% faster in that pair), not repeated performance evidence. Binary sizes were 18,978,624 versus 22,864,448 bytes (17.0% smaller).
--versionand--helpoutput matched. The release-mode golden tests passed: 1 redirect fixture test and 2 SBT golden tests.CI
The CI run 38307581268 has
ci-okfailing because one Cargo fixture test could not connect tostatic.crates.ioto downloadcfg-if; 38 tests in that job passed and one failed on the download. The failure log is here. The change does not modify Cargo.lock or dependency configuration.Note
Low Risk
Build-profile-only change with no runtime logic; main risk is longer release compile times or different optimization on non-overridden profiles if inheritance is misconfigured.
Overview
Tunes Rust release builds by setting
codegen-units = 1on[profile.release], aiming for a smaller shipped CLI and modestly faster release links (per hosted benchmarks in the PR description).Because
ci-release,perf, andaddoninheritrelease, the PR pinscodegen-units = 16on those profiles so CI test shards, perf/bench builds, and the Node addon keep faster parallel codegen and do not pick up the single-unit release setting.Reviewed by Cursor Bugbot for commit a51923e. Configure here.
Generated by Claude Code