pnpm/.github/scripts
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
..
netbsd-vm ci: fix the NetBSD VM download and the pnpr release driver check (#18066) 2026-11-13 16:54:35 +01:00
rust-lld fix(release): prevent ppc64le startup crashes (#16384) 2026-09-29 14:18:07 +02:00
assert-stripped.mjs fix: strip the symbol table from release binaries again (#18369) 2026-11-23 00:43:51 +01:00
assert-stripped.test.mjs fix: strip the symbol table from release binaries again (#18369) 2026-11-23 00:43:51 +01:00
assert-windows-crt-static.mjs fix: statically link CRT for windows-msvc pnpm binaries (#15853) 2026-09-27 12:16:54 +02:00
assert-windows-crt-static.test.mjs fix: statically link CRT for windows-msvc pnpm binaries (#15853) 2026-09-27 12:16:54 +02:00
bench-output-path.mjs ci: track test suite durations in bencher (#12404) 2026-06-14 18:44:17 +02:00
bencher-result-from-pnpm-summary.mjs ci: shard Windows TS tests (#12612) 2026-06-24 02:08:56 +02:00
bump.mjs chore: rename the pacquet workspace package to pnpm (#18363) 2026-11-22 21:48:34 +01:00
bump.test.mjs chore: rename the pacquet workspace package to pnpm (#18363) 2026-11-22 21:48:34 +01:00
compare-integrated-benchmarks.mjs test(pnpr): add a cold resolution-cache benchmark scenario (#16246) 2026-11-21 02:52:12 +01:00
compare-integrated-benchmarks.test.mjs test(pnpr): add a cold resolution-cache benchmark scenario (#16246) 2026-11-21 02:52:12 +01:00
copy-docs-artifact.mjs feat: publish release pages to pnpm.io from the composed changelog (#16529) 2026-10-02 22:01:28 +02:00
copy-docs-artifact.test.mjs feat: publish release pages to pnpm.io from the composed changelog (#16529) 2026-10-02 22:01:28 +02:00
cross-build.sh ci(release): retry cross builds on transient failures (#14522) 2026-09-04 03:12:51 +02:00
docker-image-tags.sh feat(docker): publish an Alpine variant of the pnpm image (#17069) 2026-10-18 01:22:12 +02:00
docker-image-tags.test.sh feat(docker): publish an Alpine variant of the pnpm image (#17069) 2026-10-18 01:22:12 +02:00
issue-fix-intent.sh chore(github): ask issue authors without the fix checkbox about a PR (#16271) 2026-09-27 16:24:16 +02:00
issue-fix-intent.test.sh chore(github): ask issue authors without the fix checkbox about a PR (#16271) 2026-09-27 16:24:16 +02:00
lint-prose.mjs docs: lint prose with Vale (#17238) 2026-10-22 21:48:09 +02:00
measure-command.mjs ci: track test suite durations in bencher (#12404) 2026-06-14 18:44:17 +02:00
merge-bencher-results.mjs ci: track test suite durations in bencher (#12404) 2026-06-14 18:44:17 +02:00
npm-package-publication-state.sh ci(release): stage pnpm packages before publishing (#13702) 2026-08-07 14:25:35 +02:00
npm-package-publication-state.test.sh ci(release): stage pnpm packages before publishing (#13702) 2026-08-07 14:25:35 +02:00
npm-staged-publication.sh chore(ci): expose staged publication diagnostics (#16776) 2026-10-09 07:20:44 +02:00
npm-staged-publication.test.sh chore(ci): expose staged publication diagnostics (#16776) 2026-10-09 07:20:44 +02:00
pnpr-check-database-drivers.sh ci: fix the NetBSD VM download and the pnpr release driver check (#18066) 2026-11-13 16:54:35 +01:00
prepare-docs-sync.mjs chore: move pnpm v11 off main to the release/11 branch (#18358) 2026-11-22 19:13:38 +01:00
prepare-docs-sync.test.mjs chore: move pnpm v11 off main to the release/11 branch (#18358) 2026-11-22 19:13:38 +01:00
reset-error-mode.rs ci(rust): clear the inherited error mode so Windows test aborts leave dumps (#17569) 2026-11-02 14:31:15 +01:00
run-integrated-benchmark.mjs perf: reuse the store verifier's mode reading for hardlinks and gate benchmark syscall counts (#17544) 2026-11-01 22:00:49 +01:00
run-integrated-benchmark.test.mjs perf: reuse the store verifier's mode reading for hardlinks and gate benchmark syscall counts (#17544) 2026-11-01 22:00:49 +01:00
update-node-release-keys.mjs chore: move pnpm v11 off main to the release/11 branch (#18358) 2026-11-22 19:13:38 +01:00
update-npm-signing-keys.mjs chore: move get-pnpm into the workspace and pin npm's signing keys once (#17341) 2026-10-25 17:38:04 +01:00
update-npm-signing-keys.test.mjs chore: move get-pnpm into the workspace and pin npm's signing keys once (#17341) 2026-10-25 17:38:04 +01:00