fix(desktop): exclude opposite-arch Darwin node-pty prebuild from mac packages - #53
Conversation
… packages node-pty ships prebuilt pty.node/spawn-helper binaries for both darwin-x64 and darwin-arm64 in the same package. A single-architecture mac build only loads its own arch's prebuild, but electron-builder's static files list had no way to know that, so the opposite-arch prebuild rode along and macOS flagged the arm64 app as containing Intel-only nested binaries. Add resolveMacFileExclusions(arch), thread arch into createBuildConfig, and scope the exclusion to platform === "mac" so universal builds (and any caller that omits arch) keep both prebuilds unchanged. Windows ships the same opposite-arch bloat but is out of scope here. Ported from pingdotgg/t3code#9240.
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe desktop build configuration now accepts an architecture and excludes opposite-architecture macOS ChangesDesktop artifact architecture handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:⚪ Minimal · up to The change narrowly excludes opposite-architecture Darwin binaries from single-architecture macOS packages while preserving universal-build behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description clearly explains what changed, why it changed, the scope limits, and the test results. It omits the template headings and checklist, but it provides the required information and remains focused. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Uh oh!
There was an error while loading. Please reload this page.
node-pty ships prebuilt
pty.node/spawn-helperbinaries for bothdarwin-x64anddarwin-arm64in the same package. A single-architecture mac build only ever loads its own arch's prebuild, but electron-builder's staticfileslist had no way to know that, so the opposite-arch prebuild rode along and macOS flagged the arm64 app as containing Intel-only nested binaries.Adds
resolveMacFileExclusions(arch)and threadsarchintocreateBuildConfig, scoped toplatform === "mac"— universal builds (and any caller that omits arch) keep both prebuilds, unchanged from before.Ported from pingdotgg/t3code#9240.
Windows ships the same opposite-arch bloat (
win32-x64/win32-arm64) but that's out of scope for this PR.Testing
vp test run scripts/build-desktop-artifact.test.ts— 32/32 pass, including two new tests covering the resolver and the wired-throughcreateBuildConfigoutputtsc --noEmiton scripts,vp lint— both cleanSummary by CodeRabbit
node-ptybinaries for the selected architecture.