pnpm/.github
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zoltan Kochan 963e5e1e28
fix: strip the symbol table from release binaries again (#18369)
<!-- 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>
2026-11-23 00:43:51 +01:00
..
actions chore: rename the pacquet workspace package to pnpm (#18363) 2026-11-22 21:48:34 +01:00
DISCUSSION_TEMPLATE chore: file feature requests as discussions (#15752) 2026-09-26 02:32:44 +02:00
ISSUE_TEMPLATE chore(github): ask issue authors without the fix checkbox about a PR (#16271) 2026-09-27 16:24:16 +02:00
release-keys ci: create release tags by hand, signed (#13607) 2026-08-03 15:43:58 +02:00
scripts fix: strip the symbol table from release binaries again (#18369) 2026-11-23 00:43:51 +01:00
workflows fix: strip the symbol table from release binaries again (#18369) 2026-11-23 00:43:51 +01:00
CODEOWNERS chore: move pnpm v11 off main to the release/11 branch (#18358) 2026-11-22 19:13:38 +01:00
config.yml chore(github): add welcome bot app (#4373) 2022-02-22 11:52:51 +02:00
dependabot.yml chore(pacquet): wire pacquet workflows into monorepo (#11635) 2026-05-14 18:17:45 +02:00
FUNDING.yml docs: update FUNDING.yml to remove custom links (#16736) 2026-10-08 15:10:42 +02:00
pull_request_template.md chore: drop the v11/v12 checklist item from the PR template (#18366) 2026-11-22 22:20:21 +01:00
release-sponsors.md docs: use dark-mode sponsor logo variants for Notion, Latitude, and devowl.io (#17931) 2026-11-10 16:55:46 +01:00