<!-- A maintainer will only start reviewing once CodeRabbit has approved
and
CI is green. Please wait for those to pass before expecting human
review. -->
## Summary
Release binaries have shipped with their symbol table since pnpm 12.23.0
and pnpr 0.1.0-alpha.22. This restores `strip = "symbols"` for them and
adds a release gate that rejects an unstripped binary.
### Cause
pnpm/pnpm#16589 added `[profile.release.package.<root crate>]` overrides
so that fat LTO keeps optimizing at level 3. A package override that
does not set `strip` resets it to Cargo's default. With `debug = false`
that default is `debuginfo`, which keeps the symbol table. The root
crate's value is the one the linker gets.
A two-line Cargo project reproduces it: `strip = "symbols"` in
`[profile.release]` plus a `[profile.release.package.<name>]` section
with only `opt-level` gives an unstripped binary, and adding `strip` to
the override strips it again.
### Effect on the published artifacts
Stripping each published ELF and Mach-O binary with `llvm-strip`
removes:
| Artifact | Binaries | Smallest reduction | Largest reduction |
|---|---|---|---|
| `pnpm` 12.23.0 | 14 | 10.5 MB (Linux s390x) | 13.4 MB (Linux arm64) |
| `@pnpm/napi` 12.23.0 | 12 | 9.2 MB (macOS x64) | 11.7 MB (Linux arm64)
|
| `pnpr` 0.1.0-alpha.22 | 6 | 11.5 MB (macOS) | 14.4 MB (Linux arm64) |
On Linux x64, `pnpm` goes from 70.4 MB to 59.3 MB. Windows is not
affected, because its symbols are in a separate PDB.
### Changes
- `Cargo.toml`: each root-crate override repeats `strip = "symbols"`.
`release-debug` inherits those overrides, so it sets `strip = false` for
the same crates to keep its symbols.
- `.github/scripts/assert-stripped.mjs`: rejects an ELF binary with a
`SHT_SYMTAB` section and a Mach-O binary whose `LC_DYSYMTAB` counts
local symbols. It fails on any other format.
- `release.yml`: the gate runs on the pnpm and NAPI artifacts in
`verify-rust-artifacts` and on the pnpr artifacts in
`verify-pnpr-artifacts`, next to the existing Windows runtime check.
- `pacquet-integrated-benchmark.yml`: the gate also runs on the HEAD
`pnpm` and `pnpr` binaries of the build job. That job is the only one on
a pull request that builds with the release profile, so a profile change
that keeps the symbol table fails there. A `head_ref` dispatch builds
another revision, so the step skips it. The NAPI addon has no
release-profile build on a pull request and is covered at release time
only.
### Verification
- Cargo's unit graph resolves `strip` to `symbols` for `pnpm`, `pnpr`,
`pnpm_napi` and `micro-benchmark` under `release` and `napi-release`,
and to none under `release-debug`. Before the change it resolved to
`debuginfo`.
- A Linux x64 release build of `pnpm` is 59.1 MB and passes the gate.
The same build on `main` is 70.3 MB and fails it.
- On the binaries the benchmark build job produced for the first commit
of this PR, the gate passes HEAD's `pnpm` and `pnpr` and rejects both of
`main`'s. The step itself has since run and passed in that job.
- The gate passes the published 12.21.0, 12.22.0 and 0.1.0-alpha.21
binaries and rejects the 12.23.0 and 0.1.0-alpha.22 ones, across Linux
x64 and s390x, macOS, FreeBSD, NetBSD and Android.
- Both release workflow steps were run locally in a directory laid out
like the verify jobs, including the `pnpm-lock.yaml`, archive, checksum
and Windows files they have to skip.
Not verified: the release workflow steps themselves only run on a
release tag, and I built only the Linux x64 `pnpm` binary locally. The
other targets and the NAPI addon rest on the unit graph.
## Checklist
- [x] Added a changeset (`pnpm changeset`) if this PR changes any
published
package. Keep it short and written for pnpm users — it becomes a release
note.
- [x] Added or updated tests.
---
Written by an agent (Claude Code, claude-fable-5-2).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Improvements**
* Release binaries are smaller on Linux and macOS: `pnpm` is 10–13 MB
smaller, the NAPI addon is 9–12 MB smaller, and `pnpr` is 11–14 MB
smaller.
* These binaries no longer include symbol names used only by debuggers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>