Skip to content

fix(electron): unblock Windows release build + surface Linux boot stall - #375

Merged
crs48 merged 2 commits into
mainfrom
claude/electron-desktop-build-fix
Jul 4, 2026
Merged

crs48 merged 2 commits into
mainfrom
claude/electron-desktop-build-fix

Conversation

@crs48

@crs48 crs48 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Follow-up to #373. The desktop auto-release ran a real (non-no-op) build for the first time since March and surfaced latent breakage on two platforms (macOS + Linux arm64 build clean; the release job needs all platforms, so nothing publishes until these are fixed).

Windows — fixed

@electron/rebuild runs with buildFromSource=false: better-sqlite3 uses its downloaded Electron prebuild and finishes instantly, but usearch and sharp have no Electron prebuild, so they compile from source. GitHub's windows-latest now ships Visual Studio 2026 (runner image Windows2025-VS2026), which the node-gyp 9.4.1 bundled by @electron/rebuild is too old to detect → "Could not find any Visual Studio installation to use." That's exactly why the March build passed (windows-latest was VS 2022 then) and now fails.

Fix: pin build-windows to the windows-2022 image, whose VS 2022 node-gyp 9.4.1 detects.

Linux x64 — instrumented for diagnosis

The packaged app never opens a window (60s firstWindow timeout) and prints zero output — deterministic across two runs. Boot awaits spawnDataProcess() (a utilityProcess.fork loading better-sqlite3) before createWindow(), so if that utility process doesn't signal ready on packaged Linux x64, the window is never created. macOS packaged and the unpackaged electron-e2e job both pass, so it's specific to the packaged Linux x64 combination.

The app was silent because its data-process logging is gated behind an IPC toggle that needs a renderer (which never exists here), and the whenReady chain had no .catch. This PR makes the failure observable:

  • data-process-manager.ts: honor XNET_DEBUG=1 at startup to emit the boot trace without a renderer.
  • index.ts: add a .catch on the whenReady chain so a pre-window boot failure logs to stderr instead of dying silently (a genuine robustness fix — users currently get a dead app with no clue).
  • smoke step runs with XNET_DEBUG=1 E2E_DEBUG=1 so CI captures the real cause.

After this lands I'll dispatch electron-release to confirm Windows goes green and read the Linux x64 boot trace, then land the precise Linux fix.

🤖 Generated with Claude Code

Two fixes for the desktop auto-release, which built a real (non-no-op) run for
the first time since March and exposed latent breakage on two platforms:

- Windows: pin build-windows to the windows-2022 image. windows-latest now
  ships Visual Studio 2026, which the node-gyp 9.4.1 bundled by @electron/rebuild
  can't detect, breaking the from-source rebuild of native deps without an
  Electron prebuild (usearch, sharp). better-sqlite3 is unaffected (Electron
  prebuild). This is why the March build passed and now fails.

- Linux x64 packaged-smoke: the app never opens a window and prints nothing.
  Boot awaits spawnDataProcess() before createWindow(), and the data utility
  process isn't signalling ready on the packaged Linux x64 app. Two changes to
  surface the cause: honor XNET_DEBUG=1 to emit the data-process boot trace
  without needing a renderer, and add a .catch on the whenReady chain so a
  pre-window boot failure is logged to stderr instead of dying silently. The
  smoke step now runs with XNET_DEBUG/E2E_DEBUG so CI captures the real error.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: xNet Test <[email protected]>
@crs48
crs48 temporarily deployed to pr-375 July 4, 2026 17:16 — with GitHub Actions Inactive
@crs48 crs48 added the skip-changelog Exclude this PR from the changelog label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

✓ Changelog fragment found — thanks!

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Preview removed for PR #375.

github-actions Bot added a commit that referenced this pull request Jul 4, 2026
Replace the whenReady .catch (which forced a prettier chain reformat) with a
top-level process.on('unhandledRejection') handler — same effect (a boot failure
before window creation is logged to stderr), no method-chain reindent.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: xNet Test <[email protected]>
@crs48
crs48 temporarily deployed to pr-375 July 4, 2026 17:37 — with GitHub Actions Inactive
@crs48
crs48 merged commit 78f0001 into main Jul 4, 2026
16 checks passed
@crs48
crs48 deleted the claude/electron-desktop-build-fix branch July 4, 2026 17:55
github-actions Bot added a commit that referenced this pull request Jul 4, 2026
crs48 added a commit that referenced this pull request Jul 4, 2026
#376)

Diagnostic instrumentation for the packaged Linux x64 boot stall
(follow-up to #375). The dispatched `electron-release` run confirmed the
Windows fix (**build-windows now green**), leaving only `build-linux
(x64)`: the packaged app never opens a window and captures **zero
output**, even with `XNET_DEBUG`/`E2E_DEBUG`.

I extracted the built `.deb` and confirmed packaging is sound —
`better-sqlite3`, `usearch` (linux-x64), `sharp-linux-x64`, and
`onnxruntime-node` are all correctly unpacked to `app.asar.unpacked`. So
this is a **runtime hang**, not a layout problem, and macOS uses the
same structure. The silence suggests `console` is unreliable in the
packaged context.

This PR writes boot-phase markers **straight to fd 2** (bypassing
`console`, gated on `XNET_DEBUG`) around each awaited boot step
(`storage.open` → `spawnDataProcess` → `startLocalAPI` →
`createWindow`), and pipes + forwards the data utility process's stdio,
so the next release run shows exactly which phase stalls and what the
data process fails on. No behavior change when `XNET_DEBUG` is unset (so
`electron-e2e` is unaffected).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

This branch was previously deployed

1 inactive deployment
pr-375 — ff3d7e37 Deployed Jul 4, 2026 by crs48 via deploy-preview #651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Exclude this PR from the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant