authorgravatar for 118054752+extoci@users.noreply.github.comExotic <118054752+extoci@users.noreply.github.com> 2026-09-02 23:44:30+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-02 16:44:30-04:00
log8d5b712de3cbd84118327808c403756e8894014a
tree0dd7b07cbbac89521bf1ad2a1d248b73610b4d9b
parent9159b808d35a88e74fc91e11070f3270cdb321f9
signature Signed by PGP key B5690EEEBB952194

fix(desktop): exclude opposite macOS pty prebuilds (#9240)


1 files changed, 19 insertions(+), 1 deletions(-)

scripts/build-desktop-artifact.ts+19-1
...@@ -941,6 +941,19 @@ export const MAC_FILE_EXCLUSIONS = [...@@ -941,6 +941,19 @@ export const MAC_FILE_EXCLUSIONS = [
941 "!**/node_modules/node-pty/prebuilds/win32-*/**/*",941 "!**/node_modules/node-pty/prebuilds/win32-*/**/*",
942 "!**/node_modules/node-pty/third_party/conpty/**/*",942 "!**/node_modules/node-pty/third_party/conpty/**/*",
943] as const;943] as const;
944
945// node-pty publishes both Darwin prebuilds in one package. Single-architecture
946// apps only need the native target; universal apps need both. An omitted arch
947// preserves the existing common exclusions for callers that only inspect the
948// generic platform config.
949export function resolveMacFileExclusions(arch?: typeof BuildArch.Type) {
950 if (arch === undefined || arch === "universal") {
951 return [...MAC_FILE_EXCLUSIONS];
952 }
953
954 const unusedArch = arch === "arm64" ? "x64" : "arm64";
955 return [...MAC_FILE_EXCLUSIONS, `!**/node_modules/node-pty/prebuilds/darwin-${unusedArch}/**/*`];
956}
944// Windows ships the server tree (bundle + node_modules) as a separate957// Windows ships the server tree (bundle + node_modules) as a separate
945// resources/server.asar sidecar instead of loose files: the NSIS installer958// resources/server.asar sidecar instead of loose files: the NSIS installer
946// then extracts a handful of large archives instead of thousands of small959// then extracts a handful of large archives instead of thousands of small
...@@ -2428,13 +2441,17 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (...@@ -2428,13 +2441,17 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
2428 // sidecar staging skips the archive in that case, and listing a resource2441 // sidecar staging skips the archive in that case, and listing a resource
2429 // whose source file was never written fails the electron-builder step.2442 // whose source file was never written fails the electron-builder step.
2430 wslRuntimeBundled = false,2443 wslRuntimeBundled = false,
2444 arch?: typeof BuildArch.Type,
2431) {2445) {
2432 const buildConfig: Record<string, unknown> = {2446 const buildConfig: Record<string, unknown> = {
2433 appId: DESKTOP_APP_ID,2447 appId: DESKTOP_APP_ID,
2434 productName: resolveDesktopProductName(version),2448 productName: resolveDesktopProductName(version),
2435 artifactName: "T3-Code-${version}-${arch}.${ext}",2449 artifactName: "T3-Code-${version}-${arch}.${ext}",
2436 electronLanguages: [...DESKTOP_ELECTRON_LANGUAGES],2450 electronLanguages: [...DESKTOP_ELECTRON_LANGUAGES],
2437 files: [...DESKTOP_FILE_EXCLUSIONS, ...(platform === "mac" ? MAC_FILE_EXCLUSIONS : [])],2451 files: [
2452 ...DESKTOP_FILE_EXCLUSIONS,
2453 ...(platform === "mac" ? resolveMacFileExclusions(arch) : []),
2454 ],
2438 directories: {2455 directories: {
2439 buildResources: "apps/desktop/resources",2456 buildResources: "apps/desktop/resources",
2440 },2457 },
...@@ -3502,6 +3519,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (...@@ -3502,6 +3519,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
3502 }3519 }
3503 : undefined,3520 : undefined,
3504 bundlesWslRuntime({ arch: options.arch, prebuildPath: options.wslPrebuild }),3521 bundlesWslRuntime({ arch: options.arch, prebuildPath: options.wslPrebuild }),
3522 options.arch,
3505 ),3523 ),
3506 dependencies: stageDependencies,3524 dependencies: stageDependencies,
3507 devDependencies: {3525 devDependencies: {