Skip to content

Commit 47b100e

Browse files
committed
fix(exe): drop darwin-x64 artifact (upstream Node SEA bug) (#11455)
## Summary Closes #11423. `pnpm-darwin-x64.tar.gz` and `@pnpm/macos-x64` are removed because the binaries they contain segfault at startup on Intel Macs and the underlying bug is upstream and unfixed. ## Why this isn't a fix in code The crash happens in `__cxx_global_var_init` with `EXC_BAD_ACCESS (code=1, address=0x3)` — the unprocessed-chain-entry tag — in dyld's chained-fixup processing. PR #11415's hypothesis was that `ldid`'s page hashes were the cause, but switching to native `codesign` in #11415 didn't fix it: the upstream minimal repro in [nodejs/node#62893](nodejs/node#62893) is `node --build-sea` + `codesign --sign -` + run, with no pnpm and no `ldid`, and it still crashes. The corruption is in LIEF's Mach-O surgery during `--build-sea` for x64 — chained-fixup chain entries get rewritten incorrectly when the SEA segment is inserted, and re-signing produces a valid signature over the broken bytes. The Node.js team is not going to fix this: - [nodejs/node#60250](nodejs/node#60250) (merged) — *"It's unlikely that anyone would invest in fixing them on x64 macOS in the near future, now that x64 macOS is being phased out."* They skipped the SEA tests on x64 macOS rather than chase the bug. - [nodejs/node#59553](nodejs/node#59553) (open) — long-running test failures on macOS x64 with the same root cause (sometimes surfacing as `unsupported thread-local, larger than 4GB`). `@yao-pkg/pkg` works around it by appending the JS payload to the file tail and using a custom-patched Node binary that reads from the tail at startup; this avoids Mach-O surgery entirely. We can't reuse pack-app for that because vanilla Node from nodejs.org doesn't read tail-appended payloads — only pkg-fetch's patched binaries do — so adopting that path would mean re-implementing pkg-fetch for one target. For now we're dropping the broken artifact rather than introducing a second build mechanism. ## Changes - **`pnpm/artifacts/exe/package.json`** — remove `@pnpm/macos-x64` from `optionalDependencies`; remove `darwin-x64` from `pnpm.app.targets`. - **`.meta-updater/src/index.ts`** — remove `@pnpm/macos-x64` from the enforced `optionalDependencies` list (otherwise `meta-updater` would put it back). - **`pnpm/artifacts/exe/scripts/build-artifacts.ts`** — drop `darwin-x64` from `narrowTargets` so dev-local builds match the published matrix; comment explains why. - **`__utils__/scripts/src/copy-artifacts.ts`** — stop creating `pnpm-darwin-x64.tar.gz` so the GitHub release page no longer ships it. - **`pnpm/artifacts/darwin-x64/`** — deleted (was the workspace source for `@pnpm/macos-x64`). - **`pnpm/artifacts/exe/setup.js`** — wraps the `import.meta.resolve('${pkgName}/package.json')` lookup in `try`/`catch`. On Intel Mac specifically, prints a clear message pointing at this issue, the upstream Node.js issue, and the two workarounds (`npm install -g pnpm` to use the system Node.js, or stay on pnpm 10.x). Other unsupported hosts get a generic message in the same shape. Exits non-zero so the install fails loudly instead of silently leaving a broken `pnpm`. - **`pnpm-lock.yaml`** — regenerated. - **`.changeset/drop-darwin-x64-broken-sea.md`** — patch bumps for `@pnpm/exe` and `pnpm` with user-facing explanation and pointers. Docs side already lists this limitation under `pack-app` Known limitations: pnpm/pnpm.io@36d962f6 / pnpm/pnpm.io@91f45632. ## Compat - Intel Mac users on existing `@pnpm/exe` (≤ 11.0.4) keep working with the (broken) old binary they already have. - `pnpm self-update` from an Intel Mac on an older `@pnpm/exe` will hit the new `setup.js` error path with a clear pointer to the workarounds. - New Intel Mac installs via `npm install -g @pnpm/exe` will fail loudly with the same pointer. - Install via `npm install -g pnpm` (the JS-only package, uses system Node) is unaffected and remains the recommended path. - The `install.sh` from `get.pnpm.io` will fail with a 404 on the missing `pnpm-darwin-x64.tar.gz`. That's a separate repo and a follow-up — happy to do that as a second PR.
1 parent f6bc1db commit 47b100e

13 files changed

Lines changed: 117 additions & 64 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@pnpm/exe": patch
3+
"pnpm": patch
4+
---
5+
6+
Drop the `darwin-x64` artifact from `@pnpm/exe` and from the GitHub release page. The Node.js SEA mechanism `pnpm pack-app` uses produces a binary that segfaults at startup on Intel Macs because of an upstream Node.js bug ([nodejs/node#62893](https://github.com/nodejs/node/issues/62893), tracked alongside [#59553](https://github.com/nodejs/node/issues/59553); the Node.js team has [opted not to fix it](https://github.com/nodejs/node/pull/60250) on the grounds that x64 macOS is being phased out). Re-signing with `codesign` or `ldid` doesn't help — the corruption is in LIEF's Mach-O surgery, before signing.
7+
8+
Intel Mac users should install pnpm via `npm install -g pnpm` (uses the system Node.js, no SEA), or stay on pnpm 10.x. `@pnpm/exe`'s preinstall on Intel Mac now exits with a clear error pointing at these alternatives.
9+
10+
Closes [#11423](https://github.com/pnpm/pnpm/issues/11423).

.meta-updater/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default async (workspaceDir: string) => { // eslint-disable-line
132132
'@pnpm/linuxstatic-arm64',
133133
'@pnpm/linuxstatic-x64',
134134
'@pnpm/macos-arm64',
135-
'@pnpm/macos-x64',
136135
'@pnpm/win-arm64',
137136
'@pnpm/win-x64',
138137
]) {

__utils__/scripts/src/copy-artifacts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const pnpmDistDir = path.join(repoRoot, 'pnpm/dist')
2424
await createArtifactTarball('linux-x64-musl', 'pnpm')
2525
await createArtifactTarball('linux-arm64', 'pnpm')
2626
await createArtifactTarball('linux-arm64-musl', 'pnpm')
27-
await createArtifactTarball('darwin-x64', 'pnpm')
27+
// darwin-x64 is intentionally absent: Node.js SEA injection produces a
28+
// binary that segfaults on Intel Mac (pnpm/pnpm#11423, nodejs/node#62893).
2829
await createArtifactTarball('darwin-arm64', 'pnpm')
2930
await createArtifactTarball('win32-x64', 'pnpm.exe')
3031
await createArtifactTarball('win32-arm64', 'pnpm.exe')

pnpm-lock.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm/artifacts/darwin-x64/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

pnpm/artifacts/darwin-x64/.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

pnpm/artifacts/darwin-x64/CHANGELOG.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

pnpm/artifacts/darwin-x64/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

pnpm/artifacts/darwin-x64/package.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

pnpm/artifacts/exe/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"@pnpm/linuxstatic-arm64": "workspace:*",
4343
"@pnpm/linuxstatic-x64": "workspace:*",
4444
"@pnpm/macos-arm64": "workspace:*",
45-
"@pnpm/macos-x64": "workspace:*",
4645
"@pnpm/win-arm64": "workspace:*",
4746
"@pnpm/win-x64": "workspace:*"
4847
},
@@ -60,7 +59,6 @@
6059
"targets": [
6160
"win32-x64",
6261
"linux-x64",
63-
"darwin-x64",
6462
"darwin-arm64",
6563
"linux-arm64",
6664
"win32-arm64",

0 commit comments

Comments
 (0)