Skip to content

fix(windows): prune the unpatched conpty prebuild by header, not host arch - #20048

Merged
nwparker merged 2 commits into
mainfrom
nwparker/win-conpty-prebuild-prune
Sep 21, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/win-conpty-prebuild-prune

Conversation

@nwparker

@nwparker nwparker commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​33
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​38 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22

ELI5

On Windows, Orca ships a small native piece called conpty that lets terminal
panes kill everything a command started. We patch it, because the stock build
lets background processes escape and keep running after you close the tab.

The installer we build contains that piece more than once — one copy per CPU
type, plus some spares node-pty keeps around as fallbacks. Only the patched copy
should survive packaging; the rest get pruned out.

The prune decides "is this copy for the machine we're building for?" by asking
which CPU this build machine is, not which CPU the installer is for. On a
normal build those are the same and nothing goes wrong. On a cross-build — an
arm64 installer made on an x64 machine — they differ, the check says no, and an
unpatched copy is left inside the shipped app.

Normally nothing loads it: the patched copy sits earlier in the search order and
wins. It only matters if the patched one fails to load at runtime — antivirus
quarantines it, or a system DLL it needs is missing. Then node-pty walks on to
the next candidate, finds the unpatched one we meant to delete, and loads it
silently. No error, no log line. The terminal works, and closing a tab quietly
stops killing background processes that detached from the console.

This PR makes the prune ask about the target CPU instead of the build
machine's, using the PE-header reader already on main. One fewer wrong binary
in the package, and no fallback to an unpatched one.

Worth knowing before you approve:

  • Orca does not currently build a Windows arm64 installer at all.
    electron-builder --win runs with no arch flag and packages x64 only; the
    v1.4.206 release carries a single orca-windows-setup.exe whose NSIS payload
    is app-64.7z alone. So no shipped package has ever hit this defect. The fix
    is for the day a Windows arm64 slice is added, which the x64 runner would
    cross-build (the relay addon already does exactly that).
  • Even for that future slice, this is defence in depth. The verifier on main
    already refuses to ship a package whose loadable addon is unpatched; what is
    left is the silent fall-through above, which needs a second failure first.
  • docs/reference/windows-msys-job-breakaway.md lists this as a known
    residual — this PR closes that row and updates the table.

Closing this PR instead is a defensible call; nothing ships broken either
way.


Note

Rebased onto main 2026-09-18, and cut from three commits to one. Severity
dropped with it — read this before reviewing the old body's claims.

This was stacked on #20047, which has since squash-merged. That squash landed
considerably more than the branch it was cut from
, including a rewritten
verifyPackagedConptyBreakawayMarker that resolves the addon the way node-pty's
loader does. Two of this PR's three fixes are inside it:

original fix status on main
1. prune skipped the cross-built arm64 slice still open — this PR
2. verifier warned on the package that ships the bug superseded — now fatal, via packagedConptyCandidates
3. patched addon the target cannot load superseded — the verifier picks the first candidate whose PE machine matches the target

conptyTargetsArch is not re-added to node-pty-job-ownership.cjs: main
now has config/scripts/windows-pe-machine.cjs with readPeMachine, so the
prune reuses that and prune and verifier read the header through one function.

What is left, and how bad it is

prunePackagedNodePty deletes the published
prebuilds/win32-<arch>/conpty.node — which has never carried the MSYS
breakaway denial — only when electronArch === process.arch.

That proxy stands in for "build/Release holds an addon this slice can load", and
it is false for an arm64 slice cross-built on an x64 Windows host — a rebuild
that does emit a correct arm64 addon (measured: node-gyp rebuild --arch=arm64
on an x64 Windows 11 host with the VS 2022 ARM64 cross toolset emits a
conpty.node with PE machine 0xaa64). That slice would ship the unpatched
prebuild.

Nothing loads it, and the release gate is right to pass it. The verifier walks
the loader's candidate order, the patched build/Release wins, and the prebuild
is never reached. It is the residual: an unpatched binary left in the package,
sitting exactly where node-pty's loader falls through to when build/Release
fails to load for an unrelated reason. The loader swallows every require failure
silently — measured on Windows: zero bytes written to stdout, stderr, or console
during a fall-through from a corrupted or wrong-arch build/Release to the
prebuild.

The fix

Read the PE Machine field instead of guessing. build/Release that is missing,
truncated, or not a PE at all reads as unloadable and the prebuild stays — which
is what the true cross-host case needs: packaging Windows from macOS leaves no
Windows binary there, and removing the prebuild would leave the package with no
ConPTY at all
, a crash in place of a silent degradation.

Rows two and four of the doc table are unchanged; row three flips to pruned, and
the table and its paragraph are updated to say why, including that no release
currently builds row three.

Verification

  • packaged-node-pty-prebuild-prune + verify-packaged-node-pty-job-ownership +
    windows-pe-machine — 61 passed locally; CI shard 8/8 ✓ on the prune file.
  • pnpm tc, pnpm run check:code-quality:changed — pass.
  • Mutation, scored per test line: restoring the electronArch === process.arch
    guard fails exactly the two new rows; ignoring the PE header fails the
    wrong-arch and non-PE rows; dropping the existsSync guard fails the
    no-source-build row; comparing against a fixed arch fails the host-arch row.
    Sibling-preservation and darwin/linux rows pass under every mutation
    (bare-shape controls).
  • Prune run against the real published node-pty binaries as fixtures: main
    keeps the target prebuild on the cross-arch/correct-build shape; this branch
    removes it and keeps pty.node, winpty.dll, winpty-agent.exe,
    conpty_console_list.node. Cross-host and wrong-arch shapes keep it on both.
  • On a real Windows 11 x64 host: the installed app (1.4.207) and the extracted
    v1.4.206 installer both carry a build/Release/conpty.node with machine
    0x8664 and the MSYS marker, and no prebuilds/win32-x64/conpty.node — the
    native prune works. With the unpatched prebuild forced as the loaded addon, a
    pane child started via Start-Process (new console, parent exited) survives
    teardown; with the patched addon terminateJob kills it.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

One residual hole: the verifier still keys its fallback off build/Release presence, not whether that addon targets the slice arch, so a wrong-arch-but-patched build/Release still masks an unpatched loadable prebuild. Detail inline; a one-line fix closes it.

Reviewed changes

  • conptyTargetsArch PE reader — new helper in config/scripts/node-pty-job-ownership.cjs reads the PE Machine field to decide whether build/Release/conpty.node targets the slice arch, mirroring readElfMachine().
  • Prune arch proxy removed — prunePackagedNodePty now deletes the stale prebuild only when the header read confirms the addon targets the slice, replacing the electronArch === process.arch guess.
  • Verifier prebuild fallback — verifyPackagedConptyBreakawayMarker checks the loader's prebuild fallback when build/Release is absent, and electron-builder.config.cjs passes the target arch through a new nodeArchByArchEnum.
  • Tests — prune and verifier suites extended for the cross-arch (build/Release IS the slice arch) and non-PE cases, plus the prebuild-fallback paths.
  • Docs — records the measured packaging-gate runs and the prebuild gap.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker

Copy link
Copy Markdown
Contributor Author

Reconciliation check: the three-writer hazard does not materialize

Flagged concern was that up to three agents wrote to config/scripts/node-pty-job-ownership.cjs, and that a clean merge could keep the superseded electronArch === process.arch proxy alongside the PE-header read and then silently prefer the wrong one. Checked; it did not happen here.

Exactly three versions exist, and they are strictly linear — no merge commit anywhere in the chain:

blob ref what it adds
5ad578fd74a main exports-only gate (baseline)
2d908b6082f inv18191-msys-job-breakaway the MSYS marker read
dbbfaddfee3 this branch, and inv18191-win-stack-downgrade conptyTargetsArch

This branch's copy is byte-identical to the PE-machine original, so nothing was reconciled by hand.

One implementation, one call site. electronArch === process.arch survives only inside two explanatory comments. The sole prune predicate is conptyTargetsArch(releaseAddon, electronArch).

The remaining host-arch gate is not a duplicate. canExecuteTargetArch in electron-builder.config.cjs answers a different question — can this host execute the target's addon — which genuinely requires arch equality, because verifyPackagedNodePtyJobOwnership has to load it. The marker check, a file read, runs in the else branch precisely because it needs neither.

No uncommitted third version. The shared main checkout's node-pty-job-ownership.cjs is byte-identical to main's committed blob (913 bytes, pre-gate), and neither it nor packaged-runtime-node-modules.cjs there contains conptyTargetsArch or the msys marker.

The last commit adds a 4-line comment (no logic) recording that the proxy is superseded, not complementary, so a later reader does not restore it as insurance and silently reopen the arm64 skip.

Still outstanding: real packaging verification

Everything above is static and unit-level: 24 passed under --config config/vitest.config.ts, both halves mutation-proven (restoring the old proxy fails 2 rows; disabling the verifier's prebuild fallback fails 2 rows).

That is not an electron-builder artifact. Routed to win-package (author of the PE-machine fix, holder of the Windows harness) to confirm on real output: the arm64-cross-built-on-x64 prune firing, a same-arch control, and — the load-bearing pair — the cross-host case where build/Release holds no Windows binary, the prebuild survives the prune, and the verifier then fails the release on it rather than warning. That pairing is the entire argument that there is no hole, and it is the one claim currently held only from reading the code.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta — the residual hole is closed cleanly. The one remaining open item is the stale docs section, already tracked as a review thread and unchanged by these commits.

Reviewed changes

  • Verifier fallback now keys off arch, not presence — verifyPackagedConptyBreakawayMarker treats a wrong-arch build/Release (conptyTargetsArch === false) as absent, so a patched-but-wrong-arch addon no longer masks an unpatched loadable prebuild. Closes the residual hole from the prior review.
  • Strict tri-state arch check — targetsArch === false (rather than !targetsArch or !== true) preserves the "wrong arch" vs "unreadable" distinction, keeping the unreadable case fail-closed through assertCygwinBreakawayDenied.
  • Verifier tests — four new cases pin the wrong-arch fallthrough, the true-arch primary check, and the no-arch guard.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the inv18191-msys-job-breakaway branch from f9850f9 to dfc25f9 Compare September 11, 2026 08:16
@nwparker
nwparker force-pushed the nwparker/win-conpty-prebuild-prune branch from 074f167 to 5821626 Compare September 11, 2026 08:26
@nwparker
nwparker force-pushed the inv18191-msys-job-breakaway branch from dfc25f9 to c28a0a4 Compare September 15, 2026 09:33
@nwparker
nwparker deleted the branch main September 17, 2026 05:23
@nwparker nwparker closed this Sep 17, 2026
@nwparker nwparker reopened this Sep 17, 2026
@nwparker
nwparker changed the base branch from inv18191-msys-job-breakaway to main September 17, 2026 05:25
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change validates node-pty ConPTY binaries for the MSYS breakaway-denial marker and target architecture. Runtime loading, Windows rebuilds, and packaged builds now pass addon paths to these checks. Packaging uses architecture headers when pruning prebuild fallbacks. Tests cover patched, stale, missing, unreadable, and cross-architecture binaries. New documentation records the Windows process behavior and maintainer guidance.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 58216

Some Windows package layouts can either lose their usable ConPTY fallback or ship an unchecked stale Debug addon, so the packaging checks should be corrected before merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 39.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 11 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description gives a detailed explanation of the problem, solution, scope, and verification. However, it omits several required template sections, including Linked Issue, Visual Proof, AI Disclosur… Add all required template sections. Include a linked issue after “Fixes #”, write N/A with a reason under Visual Proof if applicable, complete the Testing checkboxes, address AI Disclosure, Review, Agent skill upstream boundary, Notes, an…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: pruning the unpatched Windows ConPTY prebuild based on its PE header instead of the host architecture.
Full details: Docstring Coverage

Explanation

Docstring coverage is 39.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 11 files. (3 skipped: 3 unsupported.)

Full details: Description check

Explanation

The description gives a detailed explanation of the problem, solution, scope, and verification. However, it omits several required template sections, including Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It also does not provide the required issue reference or Testing checklist.

Resolution

Add all required template sections. Include a linked issue after “Fixes #”, write N/A with a reason under Visual Proof if applicable, complete the Testing checkboxes, address AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist, and retain the existing technical explanation and verification details.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e7059839-e0b6-4898-97c8-d5832389d114

📥 Commits

Reviewing files that changed from the base of the PR and between 0e3b71f and 5821626.

📒 Files selected for processing (14)
  • .gitignore
  • AGENTS.md
  • config/electron-builder.config.cjs
  • config/packaged-runtime-node-modules.cjs
  • config/scripts/ensure-native-runtime-job-ownership.test.mjs
  • config/scripts/ensure-native-runtime.mjs
  • config/scripts/node-pty-job-ownership.cjs
  • config/scripts/packaged-node-pty-prebuild-prune.test.mjs
  • config/scripts/rebuild-native-deps-node-pty.test.mjs
  • config/scripts/rebuild-native-deps-test-fixtures.mjs
  • config/scripts/rebuild-native-deps.mjs
  • config/scripts/verify-packaged-node-pty-job-ownership.cjs
  • config/scripts/verify-packaged-node-pty-job-ownership.test.mjs
  • docs/reference/windows-msys-job-breakaway.md

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

{ dir: '../build/Release/' },
'conpty'
)
).toBe('/app/node_modules/node-pty/build/Release/conpty.node')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use platform-native absolute paths in these assertions.

nodePtyAddonPath uses node:path.resolve. On Windows, it does not return /app/.... These assertions therefore fail on Windows.

Build the input and expected paths from fixtureDir with join.

Proposed fix
-        '/app/node_modules/node-pty/lib/utils.js',
+        join(fixtureDir, 'app', 'node_modules', 'node-pty', 'lib', 'utils.js'),
         { dir: '../build/Release/' },
         'conpty'
       )
-    ).toBe('/app/node_modules/node-pty/build/Release/conpty.node')
+    ).toBe(join(fixtureDir, 'app', 'node_modules', 'node-pty', 'build', 'Release', 'conpty.node'))

-        '/app/resources/node-pty/lib/utils.js',
+        join(fixtureDir, 'app', 'resources', 'node-pty', 'lib', 'utils.js'),
         { dir: './build/Release/' },
         'conpty'
       )
-    ).toBe('/app/resources/node-pty/lib/build/Release/conpty.node')
+    ).toBe(
+      join(fixtureDir, 'app', 'resources', 'node-pty', 'lib', 'build', 'Release', 'conpty.node')
+    )

Also applies to: 135-135

Comment on lines +51 to +58
if (binary.length < 0x40) {
return null
}
const peHeaderOffset = binary.readUInt32LE(0x3c)
if (peHeaderOffset + 6 > binary.length) {
return null
}
return binary.readUInt16LE(peHeaderOffset + 4) === expected

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Validate the PE signatures before accepting Machine.

The current parser treats any sufficiently long file as a PE image. A malformed or non-PE file can set offset 0x3c and the target Machine value. prunePackagedNodePty will then delete the loadable prebuild and can produce a package without a usable ConPTY addon.

Check both the MZ signature and the PE\0\0 signature before returning true.

Proposed fix
-  if (binary.length < 0x40) {
+  if (binary.length < 0x40 || binary.readUInt16LE(0) !== 0x5a4d) {
     return null
   }
   const peHeaderOffset = binary.readUInt32LE(0x3c)
   if (peHeaderOffset + 6 > binary.length) {
     return null
   }
+  if (binary.readUInt32LE(peHeaderOffset) !== 0x00004550) {
+    return null
+  }
   return binary.readUInt16LE(peHeaderOffset + 4) === expected
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (binary.length < 0x40) {
return null
}
const peHeaderOffset = binary.readUInt32LE(0x3c)
if (peHeaderOffset + 6 > binary.length) {
return null
}
return binary.readUInt16LE(peHeaderOffset + 4) === expected
if (binary.length < 0x40 || binary.readUInt16LE(0) !== 0x5a4d) {
return null
}
const peHeaderOffset = binary.readUInt32LE(0x3c)
if (peHeaderOffset + 6 > binary.length) {
return null
}
if (binary.readUInt32LE(peHeaderOffset) !== 0x00004550) {
return null
}
return binary.readUInt16LE(peHeaderOffset + 4) === expected

Comment on lines +79 to +84
const fallbackPath = (options.prebuiltConptyPath ?? prebuiltConptyPath)(
resourcesDir,
options.arch
)
if (fallbackPath && exists(fallbackPath)) {
assertCygwinBreakawayDenied(fallbackPath, { dir: fallbackPath })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Check build/Debug before the prebuild.

The documented loader order checks build/Debug before prebuilds. This branch skips that candidate.

If a target-loadable stale Debug addon exists, node-pty loads it instead of the checked prebuild. Packaging can then pass while the effective addon lacks the breakaway-denial marker.

Select and validate the first target-loadable candidate in the full loader order: Release, Debug, then prebuild.

Comment on lines +22 to +24
Measured on Windows 11 `10.0.26200.9168`, Git `2.55.0.windows.3`,
bash `5.3.15(1)-release`, node `v24.18.0`, `useConptyDll: true`, for
`node-pty.spawn('C:\Program Files\Git\bin\bash.exe', ['--noprofile','--norc','-i'])`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Escape the Windows path in the JavaScript example.

node-pty.spawn(...) is JavaScript, so \b in C:\Program Files\Git\bin\bash.exe becomes a backspace escape when copied. Use C:\\Program Files\\Git\\bin\\bash.exe or String.raw so the example addresses the intended executable.

@nwparker
nwparker force-pushed the nwparker/win-conpty-prebuild-prune branch from 5821626 to dd11411 Compare September 19, 2026 06:50
@nwparker nwparker changed the title fix(windows): stop shipping an unpatched conpty prebuild a cross-arch package can load fix(windows): prune the unpatched conpty prebuild by header, not host arch Sep 19, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Rebased the PR onto main and cut it from three commits to one; the verifier fix and the electron-builder.config.cjs arch wiring are now on main through the #20047 squash, leaving only the prune change here.
  • Prune reads the PE header instead of guessing the host arch — prunePackagedNodePty now calls a local conptyTargetsArch, which compares build/Release/conpty.node's IMAGE_FILE_HEADER.Machine (via readPeMachine from windows-pe-machine.cjs) against the slice's PE_MACHINE entry, replacing the electronArch === process.arch proxy. The prebuild is deleted exactly when the source build targets the slice arch; absent, wrong-arch, or non-PE builds keep it.
  • Tests — the prune suite now seeds real minimal PE headers and adds cases for the cross-arch slice whose build/Release IS the target arch (now pruned), the cross-host wrong-arch build (kept), and a non-PE build/Release (kept). All three can fail against the old guard.
  • Docs — the loader-fallthrough table flips row three to "prebuild pruned" and the paragraph describes the PE-machine check and the residual fall-through it closes, retiring the last stale section.

Verified locally: packaged-node-pty-prebuild-prune + verify-packaged-node-pty-job-ownership + windows-pe-machine = 61 passed; check:code-quality:changed = 0 findings.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

… arch

`prunePackagedNodePty` deleted the published `prebuilds/win32-<arch>/conpty.node`
only when `electronArch === process.arch`. That proxy stood in for "build/Release
holds an addon this slice can load", and it is false for the arm64 slice
cross-built on an x64 Windows host — a rebuild that DOES emit a correct arm64
addon. That slice shipped the unpatched prebuild.

Nothing loads it today: `verifyPackagedConptyBreakawayMarker` resolves the addon
the way node-pty's loader does, so the patched `build/Release` wins and the
release passes correctly. But the loader swallows every require failure and falls
through, so an AV quarantine or a missing dependency on `build/Release` hands the
pane to that unpatched prebuild — the silent downgrade the gate exists to close,
with the binary still sitting in the package.

Read the PE `Machine` field instead of guessing, reusing `readPeMachine` from the
verifier's `windows-pe-machine.cjs` so prune and verifier ask one question. A
missing, truncated or non-PE `build/Release` reads as unloadable and keeps the
prebuild, which is what the true cross-host case needs: packaging Windows from
macOS leaves no Windows binary in `build/Release`, and removing the prebuild there
would leave the package with no ConPTY at all.

Mutation-proven: restoring the `electronArch === process.arch` guard fails exactly
the two new rows in packaged-node-pty-prebuild-prune.
@nwparker
nwparker force-pushed the nwparker/win-conpty-prebuild-prune branch from 3fd138a to d509026 Compare September 21, 2026 06:46
@nwparker
nwparker merged commit 37dbb6c into main Sep 21, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant