Windows build needs a Windows runner (native modules can't cross-compile on Linux) #12

Closed
opened 2026-07-14 23:56:47 +00:00 by mohlec · 3 comments
Owner

Problem

The Windows installer is cross-built on the Linux native runner via Wine. Wine wraps the Windows installer tooling, but cannot compile/rebuild native Node addons (registry-js, windows-focus-assist). npm on Linux leaves Linux .node binaries, which get packaged into the Windows app -> not a valid Win32 application crash.

Confirmed there is no shortcut: registry-js@1.16.1 / windows-focus-assist@1.4.0 publish no Electron-41 (ABI 145) prebuilds to fetch, and MSVC compilation can't run on Linux.

PR #11 (defensive loading) stops the crash — the app launches — but GPO/MDM policy reading and Focus-Assist DND stay inactive until the native modules are built correctly.

Fix: a Windows build runner

Stand up an act_runner on Windows so electron-builder --win compiles native modules with MSVC (this is what upstream mattermost/desktop does on windows-latest). Options:

  1. Windows VM on Proxmox as a dedicated act_runner (label e.g. windows). Cleanest/persistent.
  2. win11-laptop as an act_runner (once its Malwarebytes is sorted). Cheapest, but it's a laptop.

Then point the build-windows job at the windows runner label instead of cross-building on Linux. No signing needed (stays unsigned per issue #10).

Alternative (if no Windows runner)

Build the win32 .node binaries once on any Windows box and vendor them into the repo per electron/module bump. Hacky; a runner is better.

## Problem The Windows installer is cross-built on the Linux `native` runner via Wine. Wine wraps the Windows installer tooling, but **cannot compile/rebuild native Node addons** (`registry-js`, `windows-focus-assist`). npm on Linux leaves Linux `.node` binaries, which get packaged into the Windows app -> `not a valid Win32 application` crash. Confirmed there is **no shortcut**: `registry-js@1.16.1` / `windows-focus-assist@1.4.0` publish no Electron-41 (ABI 145) prebuilds to fetch, and MSVC compilation can't run on Linux. PR #11 (defensive loading) stops the crash — the app launches — but GPO/MDM policy reading and Focus-Assist DND stay inactive until the native modules are built correctly. ## Fix: a Windows build runner Stand up an act_runner on Windows so `electron-builder --win` compiles native modules with MSVC (this is what upstream mattermost/desktop does on windows-latest). Options: 1. **Windows VM on Proxmox** as a dedicated act_runner (label e.g. `windows`). Cleanest/persistent. 2. **win11-laptop as an act_runner** (once its Malwarebytes is sorted). Cheapest, but it's a laptop. Then point the `build-windows` job at the `windows` runner label instead of cross-building on Linux. No signing needed (stays unsigned per issue #10). ## Alternative (if no Windows runner) Build the win32 `.node` binaries once on any Windows box and vendor them into the repo per electron/module bump. Hacky; a runner is better.
Author
Owner

Closing as won't-do. registry-js (the important native module: GPO/MDM policy + Windows light/dark detection) is handled without a Windows runner via its ABI-independent N-API prebuild (registry-js-v1.16.1-napi-v3-win32-x64), fetched in CI — see PR #11. The only feature that needed a Windows compiler was windows-focus-assist (Focus-Assist / Do-Not-Disturb detection), which is intentionally dropped — not needed. If Focus-Assist DND is ever wanted on desktop, reopen and stand up a Windows act_runner.

Closing as won't-do. registry-js (the important native module: GPO/MDM policy + Windows light/dark detection) is handled without a Windows runner via its ABI-independent N-API prebuild (registry-js-v1.16.1-napi-v3-win32-x64), fetched in CI — see PR #11. The only feature that needed a Windows compiler was windows-focus-assist (Focus-Assist / Do-Not-Disturb detection), which is intentionally dropped — not needed. If Focus-Assist DND is ever wanted on desktop, reopen and stand up a Windows act_runner.
Author
Owner

Closing as won't-do. registry-js (the important native module: GPO/MDM policy + Windows light/dark detection) is handled without a Windows runner via its ABI-independent N-API prebuild (registry-js-v1.16.1-napi-v3-win32-x64), fetched in CI — see PR #11. The only feature that needed a Windows compiler was windows-focus-assist (Focus-Assist / Do-Not-Disturb detection), which is intentionally dropped — not needed. If Focus-Assist DND is ever wanted on desktop, reopen and stand up a Windows act_runner.

Closing as won't-do. registry-js (the important native module: GPO/MDM policy + Windows light/dark detection) is handled without a Windows runner via its ABI-independent N-API prebuild (registry-js-v1.16.1-napi-v3-win32-x64), fetched in CI — see PR #11. The only feature that needed a Windows compiler was windows-focus-assist (Focus-Assist / Do-Not-Disturb detection), which is intentionally dropped — not needed. If Focus-Assist DND is ever wanted on desktop, reopen and stand up a Windows act_runner.
Author
Owner

Update 2026-07-15: this is now actually DONE, superseding the "won't-do" above.

A dedicated always-on Windows 11 Pro runner (bobsminibuilder) was stood up as a Forgejo act_runner (labels windows, windows-amd64), and build-windows now compiles natively with real MSVC — PR #15, merged to slash/main. So:

  • windows-focus-assist (Focus-Assist / DND) now compiles for real and works — it's no longer dropped.
  • registry-js also compiles natively (the N-API prebuild-fetch workaround from PR #11 was removed as no longer needed).
  • The Wine cross-build is retired entirely.

Toolchain notes for the runner (ATL workload required for atlbase.h, python3.exe alias, Git bash on PATH, cross-compiled forgejo-runner since Forgejo ships no Windows binary) are captured in internal notes. The crash-guards from PR #14 remain as belt-and-suspenders.

Leaving closed (state is correct), just correcting the resolution reason: done via native runner, not won't-do.

Update 2026-07-15: this is now actually **DONE**, superseding the "won't-do" above. A dedicated always-on Windows 11 Pro runner (**bobsminibuilder**) was stood up as a Forgejo act_runner (labels `windows`, `windows-amd64`), and `build-windows` now compiles natively with real MSVC — **PR #15**, merged to `slash/main`. So: - `windows-focus-assist` (Focus-Assist / DND) now compiles for real and works — it's no longer dropped. - `registry-js` also compiles natively (the N-API prebuild-fetch workaround from PR #11 was removed as no longer needed). - The Wine cross-build is retired entirely. Toolchain notes for the runner (ATL workload required for `atlbase.h`, `python3.exe` alias, Git bash on PATH, cross-compiled `forgejo-runner` since Forgejo ships no Windows binary) are captured in internal notes. The crash-guards from PR #14 remain as belt-and-suspenders. Leaving closed (state is correct), just correcting the resolution reason: **done via native runner**, not won't-do.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slash/slash-desktop#12
No description provided.