Skip to content

Refresh build process - #105

Open
NorthernMan54 wants to merge 320 commits into
mainfrom
beta-0.15.0
Open

NorthernMan54 wants to merge 320 commits into
mainfrom
beta-0.15.0

Conversation

@NorthernMan54

Copy link
Copy Markdown

This release refreshes the project against the latest Microsoft node-pty upstream while retaining Homebridge’s multi-architecture prebuilt package support.

Highlights include:

  • Latest upstream stability, security, and platform fixes
  • Removal of the legacy WinPTY implementation in favour of ConPTY
  • Updated Windows, macOS, Linux, ARM, and ia32 build support
  • Modernized prebuild, validation, and publishing workflows
  • Updated Node.js compatibility and development dependencies

This is a substantial upstream alignment release; users should test compatibility before adopting it in production.

rzhao271 and others added 30 commits February 19, 2025 02:34
* chore: add BinSkim flags to winpty

* Apply PR feedback
Change conpty named pipe buffer size to 128KiB
Missed this when migrating from yarn
unsafe perm doesn't seem to be needed
* fix: add missing lines

* Fix job names

* Use Ubuntu for linux_arm64

* Add combining archive stage for prebuilds

* Ref artifact from publish script

* Add check for npm_config_build_from_source

* simplify
* Load native addons directly from prebuilds directory

* feat: remove prebuilds when npm_config_build_from_source is set

* feat: change the load order to local builds and unbundled first

* chore: skip copying prebuilds to build dir
dependabot Bot and others added 18 commits August 7, 2026 10:31
Bumps  and [brace-expansion](https://github.com/juliangruber/brace-expansion). These dependencies needed to be updated together.

Updates `brace-expansion` from 5.0.6 to 5.0.9
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.6...v5.0.9)

Updates `brace-expansion` from 2.1.0 to 2.1.4
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.6...v5.0.9)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.9
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 4.3.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.1/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.2.0...4.3.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ip-address](https://github.com/beaugunderson/ip-address) from 10.2.0 to 10.4.0.
- [Release notes](https://github.com/beaugunderson/ip-address/releases)
- [Commits](beaugunderson/ip-address@v10.2.0...v10.4.0)

---
updated-dependencies:
- dependency-name: ip-address
  dependency-version: 10.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…icrosoft#946)

Bumps [undici](https://github.com/nodejs/undici) from 7.28.0 to 7.29.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v7.28.0...v7.29.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.29.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/checkout` from 4.4.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@11d5960...3d3c42e)

Updates `actions/setup-node` from 4.4.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@49933ea...8207627)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
microsoft#948)

Bumps [electron](https://github.com/electron/electron) from 42.2.0 to 42.5.1.
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](electron/electron@v42.2.0...v42.5.1)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 42.5.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Update prebuilds.yml

Update install-sysroot.js

Update checksums.txt

Update prebuilds.yml

Update prebuilds.yml

Update prebuilds.yml

Update prebuilds.yml
@NorthernMan54
NorthernMan54 deployed to npm-publish-test September 1, 2026 00:28 — with GitHub Actions Active
@NorthernMan54
NorthernMan54 deployed to npm-publish-test September 1, 2026 00:42 — with GitHub Actions Active
@NorthernMan54
NorthernMan54 requested a review from bwp91 September 10, 2026 13:02
NorthernMan54 and others added 2 commits September 10, 2026 09:08
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…trix (#111)

* chore(deps-dev): bump @humanfs/node from 0.16.7 to 0.16.8 (microsoft#964)

Bumps [@humanfs/node](https://github.com/humanwhocodes/humanfs/tree/HEAD/packages/node) from 0.16.7 to 0.16.8.
- [Release notes](https://github.com/humanwhocodes/humanfs/releases)
- [Changelog](https://github.com/humanwhocodes/humanfs/blob/main/packages/node/CHANGELOG.md)
- [Commits](https://github.com/humanwhocodes/humanfs/commits/node-v0.16.8/packages/node)

---
updated-dependencies:
- dependency-name: "@humanfs/node"
  dependency-version: 0.16.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump js-yaml from 4.3.1 to 4.3.2 (microsoft#968)

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.1 to 4.3.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.3.1...4.3.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump ip-address from 10.4.0 to 10.7.2 (microsoft#979)

Bumps [ip-address](https://github.com/beaugunderson/ip-address) from 10.4.0 to 10.7.2.
- [Release notes](https://github.com/beaugunderson/ip-address/releases)
- [Commits](beaugunderson/ip-address@v10.4.0...v10.7.2)

---
updated-dependencies:
- dependency-name: ip-address
  dependency-version: 10.7.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump electron from 42.5.1 to 42.10.0 in /examples/electron (microsoft#980)

Bumps [electron](https://github.com/electron/electron) from 42.5.1 to 42.10.0.
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](electron/electron@v42.5.1...v42.10.0)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 42.10.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Upgrade Mocha dependencies to v12 (microsoft#981)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>

* chore(deps): bump brace-expansion (microsoft#984)

Bumps  and [brace-expansion](https://github.com/juliangruber/brace-expansion). These dependencies needed to be updated together.

Updates `brace-expansion` from 5.0.9 to 5.0.12
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.9...v5.0.12)

Updates `brace-expansion` from 2.1.4 to 2.1.7
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.9...v5.0.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.12
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 2.1.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump serialize-javascript from 7.1.1 to 7.1.2 (microsoft#985)

Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/yahoo/serialize-javascript/releases)
- [Commits](yahoo/serialize-javascript@v7.1.1...v7.1.2)

---
updated-dependencies:
- dependency-name: serialize-javascript
  dependency-version: 7.1.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump undici from 7.29.0 to 7.30.0 in /examples/electron (microsoft#978)

Bumps [undici](https://github.com/nodejs/undici) from 7.29.0 to 7.30.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v7.29.0...v7.30.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.30.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/setup-node (microsoft#992)

Bumps the github-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/setup-node` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@8207627...949feb2)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add ConptyReparentPseudoConsole support

Add a conptyParentWindow fork option and IPty.setParentWindow(), backed by
ConptyReparentPseudoConsole from conpty.dll. The host window becomes the
owner of the console window returned by GetConsoleWindow(), so windows that
console apps parent to it (for example the WAM sign-in picker) open above the
host instead of behind it.

* Address review: native kill guard, return value, parent re-enable

- Null the HPCON in PtyKill and skip resize/clear/reparent once it is
  closed, instead of relying on JS-side bookkeeping.
- Return whether ConptyReparentPseudoConsole succeeded, and reject BigInt
  handles that don't fit in 64 bits.
- Apply conptyParentWindow inside WindowsPtyAgent, right after the
  pseudoconsole is created, and clean up if that throws.
- Re-enable the parent window when the shell exits if a modal dialog that
  died with it left the window disabled.
- Make IPty.setParentWindow optional in the public typings and show how to
  convert Electron's native window handle.

* Don't mark conptyParentWindow and setParentWindow as experimental

conpty.dll is no longer experimental, so the APIs added on top of it are
documented as regular APIs.

* Address review: make re-enabling the parent window opt-in

- Add conptyReenableParentWindowOnExit (defaults to false). Re-enabling the
  window on exit is a heuristic, so hosts have to opt in.
- Look for visible owned windows through the whole owner chain, and compare
  window handles by their low 32 bits.
- Run the recovery off the exit thread, since EnableWindow waits for the
  window's thread.
- Validate handles before creating the pseudoconsole: numbers must be safe
  integers, and bigints must fit in 64 bits.
- Only close the pseudoconsole once in kill().
- setParentWindow returns whether the request was sent; ConPTY applies it
  asynchronously.
- The parent window tests wait for every pty to exit, since exiting while a
  conout worker still flushes its pipe can hang mocha.

* Don't call the parent window re-enable a heuristic

It's an exact check: the window is still disabled and no visible window is
owned by it. What it can't tell is why the window is disabled, which is why
hosts opt in.

* Keep setParentWindow as the only new API

Remove conptyParentWindow. setParentWindow() isn't deferred, and the
shell is only launched once the conout worker is ready, so calling it
right after spawn() sends the request before the shell starts.

Remove conptyReenableParentWindowOnExit and re-enabling the parent
window on exit. That moves to a follow-up issue, so this PR stays
focused on the parenting change.

* Upgrade node-gyp for Visual Studio 2026

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Delay newly published npm dependencies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* build: use Node 24's bundled node-gyp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* build: pin Node 24.18.0 in CI

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(win): collect console processes before closing ConPTY

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert "fix(win): collect console processes before closing ConPTY"

This reverts commit 271faf3.

* Address review: accept only unsigned, pointer-sized window handles

HWNDs are pointers, so negative handles are now rejected and the handle
is converted to an HWND through uintptr_t in C++, which also covers
32-bit builds. Numbers must be non-negative safe integers, since
Node-API's integer getters silently truncate fractions, map NaN and
Infinity to 0 and lose precision above 2^53.

Remove the JS check, so the native binding is the only place that
validates the handle.

* Reword the window handle comment and test name

Only Int64Value() loses precision past Number.MAX_SAFE_INTEGER; the 32-bit
getters wrap instead. The invalid handle test also rejects unsafe integers,
so say safe integers in its name.

* Address review: take the window handle as a Buffer

setParentWindow() now takes the HWND as a Buffer the size of an HWND, in
native byte order, which is how Electron's
BrowserWindow.getNativeWindowHandle() returns it, so hosts can pass that
Buffer directly. The native side copies it into an HWND, which replaces
the number and bigint parsing.

* Use Node 24 in the publish pipeline

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update Node.js to 24.22.1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use npm 11.6.3 for Azure Artifacts publishing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Document beta version selection

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Keep beta version documentation with its lookup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reapply Homebridge prebuilt-multiarch changes on upstream 3d2987d

Rebuilt on microsoft/node-pty main (2026-10-22, 36 commits past the
previous fork point 8da72bb), with the net Homebridge changes from
beta-0.15.0 applied on top:

- package name @homebridge/node-pty-prebuilt-multiarch, typings module
- prebuild loader (scripts/prebuild.js) and node-gyp rebuild fallback
- glibc 2.28 sysroot pin for Linux prebuilds
- clearer native module load errors in src/utils.ts
- Stage 1 (prebuild + publish) and Stage 2 (validate) workflows
- README, CODEOWNERS, dependabot config

Conflicts: ci.yml takes upstream's Node 24.22.1; package.json takes
upstream's mocha 12.0.2 and keeps node-gyp as a devDependency (the
Stage 1 workflow calls it), bumped to 13.1.0 for VS 2026.
package-lock.json regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: drop the Node <27 engines cap

Prebuilds are N-API, so a new Node major needs no new binaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: warn instead of failing on devEngines

Upstream requires Node >=24 / npm >=11.6.3 for development. Our prebuild
matrix deliberately builds on older hosts (Node 22 runners, node:22-alpine,
and Node 18.4.0 for linux-ia32, the last x86 runtime available), so the
hard check stopped every prebuild job before it started. The output is
Node-API, so the build host's Node version does not affect consumers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(ia32): build from archive.debian.org with node-gyp 11

Bullseye's security pool has left deb.debian.org (apt got 404s), so the
i386 container now installs from archive.debian.org; staying on
bullseye keeps the ia32 prebuild on glibc 2.31. That container's Node
18.4.0 (the last x86 runtime) can't run node-gyp 13, so it uses
node-gyp 11.5.0 explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: build and test prebuilds on Node 24.22.1, as upstream CI does

win32-arm64 died in the "Regression for microsoft#921" race test on Node 22.x,
while upstream's windows-11-arm job passes it on 24.22.1. The addon is
Node-API: a build from a newer Node loads and runs on Node 20, 22 and 24
(checked locally), and Stage 2 validates Node 19-26 after publishing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(ia32): run node-gyp 11 from its own prefix

npm 8's npx reused the project's node-gyp 13 instead of fetching
node-gyp@11.5.0, which then failed on Node 18.4. Install 11.5.0 into
/tmp/node-gyp-11 and call it by path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(ia32): drop an apostrophe that broke the container's quoted script

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Co-authored-by: anthonykim1 <anthonykim@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Anthony Kim <62267334+anthonykim1@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
npm-publish-test — 7ba4b47c Deployed Oct 25, 2026 by NorthernMan54 via Publish to npm #8
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.