fix(ci): node-pty crash on Intel Macs in universal build#301
Merged
Conversation
GitHub's macos-latest runner is arm64, so `pnpm install` only materialized @lydell/node-pty-darwin-arm64. The --universal build then shipped a node-pty loader that crashed on Intel Macs at startup, looking for the missing @lydell/node-pty-darwin-x64 binary (issue dcouple#300). Add `supportedArchitectures` to pnpm-workspace.yaml so pnpm materializes the optional platform binaries for every OS/CPU we ship, not just the build machine's own. The lockfile already lists all six platform packages, so this only changes what is installed on each build machine; electron-builder still prunes binaries that don't match the target platform. Add scripts/verify-mac-universal-binaries.js as a build-time guard that fails the build if either darwin binary is missing from the packaged app, and wire it into the universal mac build scripts so it runs in CI and locally. Fixes dcouple#300
Contributor
Author
|
Hi! Can I get please a review? @parsakhaz Thanks |
Member
Sorry in the middle of a move to SF, will review sometime today or tomorrow thanks! |
parsakhaz
approved these changes
Jul 6, 2026
parsakhaz
left a comment
Member
There was a problem hiding this comment.
Reviewed the patch and regression surface. The pnpm supportedArchitectures change matches the node-pty optional dependency issue, the lockfile already contains the platform packages, and the verifier syntax/fixture behavior checks out locally. No app runtime regression found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #300
Problem
On Intel Macs, the packaged universal app crashes immediately at launch with:
Root cause
GitHub's
macos-latestrunner is arm64, sopnpm installonly materializes the optional dependency for the build machine's own arch —@lydell/node-pty-darwin-arm64. The--universalbuild then ships a node-pty loader that, when run on an Intel Mac (the x64 slice), looks for@lydell/node-pty-darwin-x64, which was never downloaded → fatal error in the main process on the firstrequire.Fix
Add
supportedArchitecturestopnpm-workspace.yamlso pnpm materializes the optional platform binaries for every OS/CPU we ship, not just the build machine's own.electron-builderstill prunes binaries that don't match the target platform, so the only net effect on the mac artifact is that the missingdarwin-x64binary is now included alongsidedarwin-arm64.Regression guard (the "test")
Added
scripts/verify-mac-universal-binaries.js, a build-time check (same pattern as the existingverify-xterm-request-mode-build.js) that scans the packaged.appand fails the build if either darwinpty.nodeis missing. It's wired into the universal mac build scripts (build:mac,build:mac:universal,build:mac:ci,release:mac,release:mac:universal), so it runs in both CI build paths and locally. The single-archbuild:mac:x64/build:mac:arm64scripts are intentionally excluded since they legitimately ship one binary.Testing notes (run locally on an Intel Mac, x86_64)
pnpm install→ confirmed both@lydell/node-pty-darwin-x64and-arm64materialize; lockfile byte-identical.pnpm run build:mac:ci→ producedPane-2.4.5-macOS-universal.dmg; both darwinpty.nodebinaries present inapp.asar.unpacked; main executable is a true universal binary (lipo -archs→x86_64 arm64).Note on NOTICES
This change adds no dependencies to
package.json/the lockfile (it only affects which already-listed optional packages are materialized per machine), soNOTICESis intentionally not touched here. The release build regeneratesNOTICESat build time, so shipped attributions stay correct.Screenshot