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 = [
941941 "!**/node_modules/node-pty/prebuilds/win32-*/**/*",
942942 "!**/node_modules/node-pty/third_party/conpty/**/*",
943943] 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}
944957// Windows ships the server tree (bundle + node_modules) as a separate
945958// resources/server.asar sidecar instead of loose files: the NSIS installer
946959// then extracts a handful of large archives instead of thousands of small
......@@ -2428,13 +2441,17 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
24282441 // sidecar staging skips the archive in that case, and listing a resource
24292442 // whose source file was never written fails the electron-builder step.
24302443 wslRuntimeBundled = false,
2444 arch?: typeof BuildArch.Type,
24312445) {
24322446 const buildConfig: Record<string, unknown> = {
24332447 appId: DESKTOP_APP_ID,
24342448 productName: resolveDesktopProductName(version),
24352449 artifactName: "T3-Code-${version}-${arch}.${ext}",
24362450 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 ],
24382455 directories: {
24392456 buildResources: "apps/desktop/resources",
24402457 },
......@@ -3502,6 +3519,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
35023519 }
35033520 : undefined,
35043521 bundlesWslRuntime({ arch: options.arch, prebuildPath: options.wslPrebuild }),
3522 options.arch,
35053523 ),
35063524 dependencies: stageDependencies,
35073525 devDependencies: {