Skip to content

fix(desktop): recover missing get-windows binding - #88233

Merged
OutThisLife merged 3 commits into
NousResearch:mainfrom
helix4u:fix/get-windows-recovery-command
Aug 19, 2026
Merged

fix(desktop): recover missing get-windows binding#88233
OutThisLife merged 3 commits into
NousResearch:mainfrom
helix4u:fix/get-windows-recovery-command

Conversation

@helix4u

@helix4u helix4u commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Repairs Desktop packaging when get-windows@9.3.0 is installed without its Windows native binding.

The staging script previously ran npm rebuild get-windows. Because get-windows is optional, npm can report that rebuild as successful even when the package's native lifecycle fails and no napi-9-win32-unknown-x64 payload is produced. The resulting error then recommended the same ineffective command.

The staging path now resolves the package's own @mapbox/node-pre-gyp installer and runs install --fallback-to-build directly inside get-windows. It fails on a process error or non-zero exit, rescans lib/binding, and also fails accurately if the installer exits successfully without producing the requested Windows binding.

Related Issue

Closes #88251.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Replace the npm rebuild recovery hook with direct execution of @mapbox/node-pre-gyp from the installed get-windows package.
  • Surface installer process failures instead of allowing npm's optional-dependency handling to hide them.
  • Verify the requested binding exists and is staged after the installer completes.
  • Remove both invalid manual recovery instructions.
  • Cover successful recovery, installer failure, and a zero exit that produces no binding.

How to Test

From apps/desktop:

npm exec -- vitest run scripts/stage-native-deps.test.mjs --testNamePattern "win32 staging|native install"

The focused Windows staging tests pass: 6 passed | 24 skipped.

A disposable Windows verification also started with no lib/binding, downloaded the official v9.3.0/napi-9-win32-unknown-x64.tar.gz asset through the direct installer, produced node-get-windows.node, and classified it as a Windows binary.

The full test file reaches 28 passed | 1 skipped; its existing Darwin executable-mode assertion fails on Windows with 438 !== 493.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Windows

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Missing-binding Windows verification:

before: false

node-pre-gyp ... napi-9-win32-unknown-x64.tar.gz

after: true, classification: win32

@helix4u
helix4u marked this pull request as ready for review August 17, 2026 07:37
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) platform/windows Native Windows-specific behavior or breakage area/install-update Installer, updater, packaging, wheels, doctor sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Aug 17, 2026
@helix4u helix4u changed the title fix(desktop): remove invalid get-windows recovery command fix(desktop): recover missing get-windows binding Aug 17, 2026

@OutThisLife OutThisLife left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Almost there — one ask before merge:

The new test get-windows native install invokes node-pre-gyp directly from the package root deepEquals the installer path against join(tmp, ...). On macOS require.resolve returns the realpath (/private/var/...) while tmp is /var/..., so the assertion fails even though the spawn is correct.

Compare against fs.realpathSync(installer) (or resolve both sides the same way). Happy to approve as soon as that's in.

require.resolve returns the macOS realpath (/private/var/...) while
os.tmpdir() stays on the /var symlink, so a raw join() deepEqual failed
even though the spawn was correct.

@OutThisLife OutThisLife left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM — the direct installer is the right recovery. I pushed the realpath compare so the macOS test matches require.resolve.

@OutThisLife
OutThisLife enabled auto-merge August 19, 2026 07:40
@OutThisLife
OutThisLife merged commit ca4a0c4 into NousResearch:main Aug 19, 2026
41 checks passed
andrexibiza added a commit to andrexibiza/hermes-agent that referenced this pull request Aug 21, 2026
…ling (NousResearch#91079)

Rebuild the final eleven-file package transaction as one commit on exact
upstream main 67af79d. The final source/test
blobs are byte-identical to the reviewed fork head; the five-commit series
and all of its historical status objects are removed from active ancestry.

Preserves the implementation lineage documented in NousResearch#91079: NousResearch#88233,
NousResearch#44234, NousResearch#69179, NousResearch#91063, NousResearch#76088, NousResearch#38170, and NousResearch#34327.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install-update Installer, updater, packaging, wheels, doctor comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows: get-windows win32 binding is never staged, so the desktop app silently stays on an old build

3 participants