Uh oh!
There was an error while loading. Please reload this page.
fix(desktop): exclude opposite macOS pty prebuilds - #9240
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused macOS packaging fix that removes unused opposite-architecture node-pty binaries from single-architecture artifacts while preserving universal builds and application runtime logic. The change is small, localized, and has no product-default, security, schema, or infrastructure implications. You can add or adjust custom eligibility rules. Learn more. |
Dismissing prior approval to re-evaluate 1ccaa2e
extoci
commented
Sep 2, 2026
Release Smoke is the only failing required check. It fails before any desktop packaging step while regenerating the temporary lockfile in scripts/release-smoke.ts: ERR_PNPM_UNUSED_PATCH for expo-sharing@57.0.16. The same command reproduces locally from this clean branch, and the PR diff contains no mobile, patch, or lockfile changes; the current registry also resolves expo-sharing 57.0.17, which does not match the existing 57.0.16 patch. I left this PR scoped to the macOS packaging fix. Coded on behalf of me — GPT-5.6 / Codex harness. |
extoci
commented
Sep 2, 2026
Update: I verified the required Release Smoke failure was caused by the existing expo-sharing patch being version-specific while its dependency range allowed 57.0.17. The final PR now includes only a two-line specifier/lockfile alignment to keep the already-patched 57.0.16 behavior; the full smoke script passes locally. Coded on behalf of me — GPT-5.6 / Codex harness. |
Dismissing prior approval to re-evaluate 817f596
817f596 to
2d9596eCompareDismissing prior approval to re-evaluate 2d9596e
Correction after rebasing onto current main: the Expo Sharing patch/version fix is already present upstream and is no longer part of this PR. The rebased branch now contains only the macOS desktop packaging change (+19/-1); the earlier CI note referred to the pre-rebase state. Coded on behalf of me — GPT-5.6 / Codex harness. |
Uh oh!
There was an error while loading. Please reload this page.
mackinleysmith
commented
Sep 2, 2026
hey @maria-rcks, do you think we could rebase or cherry pick this into the |
## What's Changed * fix(web): hide deleted providers with prototype keys by @Lucenx9 in pingdotgg/t3code#8337 * feat(mobile): long-press file references for path and open actions by @juliusmarminge in pingdotgg/t3code#9258 * fix(desktop): exclude opposite macOS pty prebuilds by @extoci in pingdotgg/t3code#9240 * feat(web): add copy path button to diff headers by @ipanasenko in pingdotgg/t3code#2403 * fix(server): subscribe before provider settings watcher by @t3-code[bot] in pingdotgg/t3code#9271 * fix(mobile): show filled filter icon on Android when filters are active by @none23 in pingdotgg/t3code#9217 * fix(chat): show single tool calls without summaries by @maria-rcks in pingdotgg/t3code#9267 * fix(web): warn when shared settings have no target environment by @imabdulazeez in pingdotgg/t3code#9207 * fix(web): confirm closing agent-controlled browsers by @maria-rcks in pingdotgg/t3code#9272 **Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260902.1260...v0.0.39-nightly.20260902.1261 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260902.1261
… packages (#53) 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. Co-authored-by: Michael Buluma <1452922+buluma@users.noreply.github.com>
Problem:
The arm64 macOS artifact includes node-pty darwin-x64 pty.node and spawn-helper files, causing macOS to detect Intel-only nested components.
Fix:
Pass the target architecture into the desktop packaging config and exclude only the opposite Darwin node-pty prebuilds for single-architecture packages. Universal builds retain both architectures, and Intel macOS support remains unchanged.
Tests:
Bundle impact:
The audited arm64 app loses 101,072 uncompressed bytes (~98.7 KiB). The two entries occupied 31,045 compressed bytes (~30.3 KiB) in the ZIP, plus archive metadata.
Model/harness: GPT-5.6 / Codex harness.
Note
Low Risk
Packaging-only change scoped to macOS file exclusions in the desktop artifact script; runtime app logic is unchanged, though misconfigured callers that omit arch would still bundle both prebuilds.
Overview
Single-architecture macOS desktop packages were still shipping both Darwin node-pty prebuilds, which led macOS to treat Intel-only nested binaries as present in arm64 builds.
This PR adds
resolveMacFileExclusions, which keeps the existing Windows-related exclusions and, for arm64 or x64 targets, adds an electron-builder exclusion for the non-targetdarwin-*prebuild tree. Universal builds (or callers that omit arch) keep both Darwin prebuilds, matching prior behavior.The target arch is passed into
createBuildConfigfrombuildDesktopArtifactso stagedpackage.jsonbuild.filesuses the resolved list instead of the staticMAC_FILE_EXCLUSIONSalone.Reviewed by Cursor Bugbot for commit 2d9596e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Exclude unused Darwin
node-ptyprebuilds from single-architecture macOS desktop buildsresolveMacFileExclusionsin build-desktop-artifact.ts which drops the opposite-architecture Darwinnode-ptyprebuild for single-arch macOS packages and keeps both prebuilds for universal or unspecified buildsarchitectureparameter throughcreateBuildConfigand passesoptions.archfrombuildDesktopArtifactso the exclusion resolver receives the requested targetnode-ptyprebuild instead of both; universal and arch-unspecified builds are unchangedMacroscope summarized 2d9596e.