Add a native Windows build, tested and released by CI #15

Merged
noah merged 5 commits from windows-port into main 2026-11-02 18:00:28 -07:00
Owner

Windows support for the toolkit, end to end: the GUI builds for Windows 10/11 as one self-contained alkane-toolkit.exe, CI tests it, and every release ships it next to the Linux tarball.

What changed

  • Build: cross-compiled on Linux with mingw-w64 against the vendored wxWidgets built as static wxMSW (scripts/build-wx-windows.sh, scripts/build-gui-windows.sh). The wx-rs build script now picks the platform from the target (it used cfg!(), which describes the build host). The exe imports only Windows system DLLs and embeds a manifest (Common Controls v6, per-monitor DPI v2, UTF-8, Win10/11), icon and version info.

  • Bridge on wxMSW (wx-rs patches 0007/0008):

    • The upstream frame's invisible child window swallowed every click and key on MSW. It is no longer created there.
    • Light/dark follows the Windows app mode.
    • Drag-select and per-cell/per-icon tooltips work on the generic data view.
    • Sizes cross the Rust/C++ boundary in DIPs, so the UI scales correctly at 125-200%. This is the identity on GTK.
    • Shapes are anti-aliased, and selected rows use the themed list-view colours.
    • The window fits the monitor work area and shows the executable's icon.
  • App: OS differences live in alkane_core::platform:

    • settings in %APPDATA%\alkane-toolkit
    • owner-only secret files
    • console-less ssh/curl

    SSH password logins use SSH_ASKPASS with the toolkit itself as the helper, on Linux too. This replaces sshpass, which Windows lacks.

  • CI/CD: ci/windows-ci.sh defines the Windows steps. verify / release / next each gain a Windows job (clippy, release build, all unit tests and the UI self-test under Wine). release attaches alkane-toolkit-vX.Y.Z-windows-x86_64.zip. windows-native.yml re-runs the cross-built tests and self-test on real Windows 11 through a self-hosted VM runner. It is advisory and never gates a release. The CI image adds mingw-w64, Wine and a prebuilt wxMSW on top of the previous image (digest re-pinned).

  • Found on the way:

    • The vendored wxWidgets tree was missing 44 tarball files that nested .gitignore files had dropped. They are restored, and the tree is now byte-identical to the tarball.
    • The wx-rs patch queue had drifted from the tree it describes. It is re-baselined, and scripts/wx_rs_patches.py check now runs in CI.

Verification

  • Unit tests pass for both targets (Linux natively, Windows under Wine): alkane-gui 97, alkane-core 3, the rest unchanged.
  • The UI self-test passes under Wine and natively on Windows 11 25H2 (build 26200).
  • I checked the following by hand on Windows 11: drag-select, tooltips, context menu, dialogs, the native Save dialog with CSV export, dark mode, and 150% scaling.
  • The Linux build of this branch renders the same as v0.101.0.
  • Live fleet, read-only, on 10.{1-9}.{0-1}.0/24: miner_probe scan from Linux and from the Windows VM returns identical fields for every miner both found. The full sweep differs by a few intermittent responders, and those come back identically on both platforms when re-scanned directly.
  • SSH askpass login works against a VNish test miner (uname -a, read-only) from both Linux and Windows ssh.exe.

See docs/windows.md and docs/adr/0004-windows-port.md.

Generated with Claude Code

Windows support for the toolkit, end to end: the GUI builds for Windows 10/11 as one self-contained `alkane-toolkit.exe`, CI tests it, and every release ships it next to the Linux tarball. ## What changed - **Build**: cross-compiled on Linux with mingw-w64 against the vendored wxWidgets built as static wxMSW (`scripts/build-wx-windows.sh`, `scripts/build-gui-windows.sh`). The wx-rs build script now picks the platform from the *target* (it used `cfg!()`, which describes the build host). The exe imports only Windows system DLLs and embeds a manifest (Common Controls v6, per-monitor DPI v2, UTF-8, Win10/11), icon and version info. - **Bridge on wxMSW** (wx-rs patches 0007/0008): - The upstream frame's invisible child window swallowed every click and key on MSW. It is no longer created there. - Light/dark follows the Windows app mode. - Drag-select and per-cell/per-icon tooltips work on the generic data view. - Sizes cross the Rust/C++ boundary in DIPs, so the UI scales correctly at 125-200%. This is the identity on GTK. - Shapes are anti-aliased, and selected rows use the themed list-view colours. - The window fits the monitor work area and shows the executable's icon. - **App**: OS differences live in `alkane_core::platform`: - settings in `%APPDATA%\alkane-toolkit` - owner-only secret files - console-less `ssh`/`curl` SSH password logins use `SSH_ASKPASS` with the toolkit itself as the helper, on Linux too. This replaces `sshpass`, which Windows lacks. - **CI/CD**: `ci/windows-ci.sh` defines the Windows steps. `verify` / `release` / `next` each gain a Windows job (clippy, release build, all unit tests and the UI self-test under Wine). `release` attaches `alkane-toolkit-vX.Y.Z-windows-x86_64.zip`. `windows-native.yml` re-runs the cross-built tests and self-test on real Windows 11 through a self-hosted VM runner. It is advisory and never gates a release. The CI image adds mingw-w64, Wine and a prebuilt wxMSW on top of the previous image (digest re-pinned). - **Found on the way**: - The vendored wxWidgets tree was missing 44 tarball files that nested `.gitignore` files had dropped. They are restored, and the tree is now byte-identical to the tarball. - The wx-rs patch queue had drifted from the tree it describes. It is re-baselined, and `scripts/wx_rs_patches.py check` now runs in CI. ## Verification - Unit tests pass for both targets (Linux natively, Windows under Wine): alkane-gui 97, alkane-core 3, the rest unchanged. - The UI self-test passes under Wine and natively on Windows 11 25H2 (build 26200). - I checked the following by hand on Windows 11: drag-select, tooltips, context menu, dialogs, the native Save dialog with CSV export, dark mode, and 150% scaling. - The Linux build of this branch renders the same as v0.101.0. - Live fleet, read-only, on 10.{1-9}.{0-1}.0/24: `miner_probe scan` from Linux and from the Windows VM returns identical fields for every miner both found. The full sweep differs by a few intermittent responders, and those come back identically on both platforms when re-scanned directly. - SSH askpass login works against a VNish test miner (`uname -a`, read-only) from both Linux and Windows `ssh.exe`. See `docs/windows.md` and `docs/adr/0004-windows-port.md`. Generated with [Claude Code](https://claude.com/claude-code)
noah added 5 commits 2026-11-02 17:33:23 -07:00
The vendored wxWidgets 3.3.3 tree was missing 44 files of the pinned release
tarball (pnglibconf.h, PCRE2's configure and libtool files, libtiff build/):
the tarball ships nested .gitignore files, so a plain git add dropped them.
Linux links the system libpng/pcre2 and never noticed; the builtin libraries
the Windows build uses need them. The tree now matches the tarball
(sha256 81b09d6d...) byte for byte; VERSION says how to re-vendor safely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The queue had drifted from the patched tree it describes: 0003 predated
rounds 12-19 of bridge work, 0005 no longer applied on top of it, and the
Cargo.toml note and the case-duplicate readme.md were in no patch at all.
Vendor the pristine crates.io crate (sha256 pinned in VERSION) and add
scripts/wx_rs_patches.py: 'check' rebuilds the tree from upstream + patches
and requires an exact match, 'capture' records an edit as the next patch.
0002/0003 are regenerated to the current bridge files (0005's GTK tooltip
fix is folded into 0003); 0005 now carries the packaging leftovers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build: the wx-rs build script chose the platform with cfg!(), which in a
build script describes the build host, so a Linux-to-Windows build took the
GTK path. It now reads CARGO_CFG_TARGET_*, and Windows/GNU builds through
wx-config exactly like GTK, against a static wxMSW from
scripts/build-wx-windows.sh. The C++ runtime is linked statically, so the
.exe imports only Windows system DLLs. crates/alkane-gui/build.rs embeds an
application manifest (Common Controls v6, per-monitor DPI v2, UTF-8 code
page, Windows 10/11), the icon and version info.

Bridge on wxMSW (patches 0007/0008):
- the upstream frame's invisible "OSX key events" child sat above the UI on
  MSW and swallowed every click and key; it is no longer created there
- light/dark is chosen before the first window (wxMSW ignores it later) and
  follows the Windows app mode, with dark grid rules for the data view
- the generic wxDataViewCtrl gets mouse input in its inner main window, so
  drag-select and the per-cell / per-icon tooltips bind there (GTK keeps
  its native GtkTreeView paths; the icon hit-test is shared)
- sizes cross the Rust/C++ boundary in DIPs (identity on GTK), so columns,
  icons, KPI cards and the status bar scale at 125-200 %
- vector shapes go through GDI+ (anti-aliased like Cairo on GTK); selected
  rows use the themed list-view text colour like the native renderer
- the frame never opens larger than the monitor work area; title-bar icon
  from the executable; upstream menu insert no longer reads UTF-8 as UTF-16

App: OS differences live in alkane_core::platform (settings in
%APPDATA%\alkane-toolkit, owner-only secret files, NUL, console-less helper
processes). SSH password logins use SSH_ASKPASS with the toolkit itself as
the helper on every platform, replacing sshpass, which Windows lacks.
Release builds are GUI-subsystem; headless modes attach to the parent
console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ci/windows-ci.sh is the one definition of every Windows step (toolchain,
  clippy, build, tests and UI self-test under Wine, packaging, test bundle);
  verify, release and next only call it.
- release.yml: a windows job builds, tests and packages
  alkane-toolkit-vX.Y.Z-windows-x86_64.zip; the release job waits for it
  and attaches the zip next to the Linux tarball. next.yml does the same
  for -rc candidates, verify.yml runs the Windows gates on PRs.
- windows-native.yml (advisory, never gates a release) runs main's
  cross-built unit tests and UI self-test on real Windows 11 through the
  self-hosted VM runner (label alkane-windows).
- CI image: ci/images/alkane-ci.Dockerfile layers mingw-w64, Wine with a
  ready prefix, the rustup target and a prebuilt wxMSW prefix on the
  previously verified image; ci/images/build-image.sh pushes it and pins
  the digest. wx prefix/cache scripts take a linux|windows argument.
- CI checks the wx-rs patch queue; versioning treats the GUI build script,
  Windows resources and assets as release-relevant; the workflow contract
  test covers the Windows gates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document the Windows build, its CI and the native test runner
verify / verify (pull_request) Successful in 7m32s
verify / verify-windows (pull_request) Successful in 14m34s
source / check (pull_request) Skipped
79fe3a2880
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
noah merged commit f2782e7d03 into main 2026-11-02 18:00:28 -07:00
Sign in to join this conversation.