Files
alkane-toolkit/docs/windows.md
T

84 lines
3.7 KiB
Markdown

# Windows
The toolkit ships a Windows build alongside the Linux one in every release:
`alkane-toolkit-vX.Y.Z-windows-x86_64.zip`, holding one self-contained
`alkane-toolkit.exe` for Windows 10 and 11 (x86_64). There is no installer
and no runtime to install. Design decisions are in
[ADR 0004](adr/0004-windows-port.md).
## Using it
- Settings live in `%APPDATA%\alkane-toolkit` (Linux: `~/.config/alkane-toolkit`),
same file names and formats.
- SSH actions use the OpenSSH client built into Windows (`ssh.exe`); HTTP
actions use the built-in `curl.exe`. Both start without a console window.
- The window follows the Windows light/dark app setting. Set
`ALKANE_APPEARANCE=light` or `dark` to force one (any platform).
- Headless modes (`ALKANE_SELFTEST`, `ALKANE_ACCESS_PROBE`, `ALKANE_LOG_SCAN`)
print to the console they are started from.
- Offline demo: `set ALKANE_FAKE_SCAN=1 && alkane-toolkit.exe`.
## Building
The Windows build is cross-compiled on Linux with mingw-w64 (posix-threads
variant), exactly as CI does it:
```sh
sudo apt install g++-mingw-w64-x86-64-posix wine xvfb # once
scripts/build-wx-windows.sh # once: static wxMSW 3.3.3 in ~/.cache/wx-3.3.3-mingw
scripts/build-gui-windows.sh # release alkane-toolkit.exe
```
`scripts/windows-cross-env.sh` holds the toolchain environment (compilers,
linker, `WX_RS_WXCONFIG`, the Wine test runner). Source it to run cargo by hand:
```sh
. scripts/windows-cross-env.sh
cargo test --offline --target "$ALKANE_WIN_TARGET" --workspace --exclude wx-rs # runs under Wine
scripts/ui-selftest-windows.sh # headless UI self-test of the .exe under Wine
```
`alkane-toolkit.exe` must import only Windows system DLLs; `ci/windows-ci.sh
build` fails the build if a mingw runtime DLL slips in.
## CI
`ci/windows-ci.sh` is the one definition of every Windows step; the workflows
only call it.
| Workflow | Windows job | Gate |
|----------|-------------|------|
| `verify.yml` (PRs to main) | `verify-windows`: clippy, release build, unit tests and UI self-test under Wine | required |
| `release.yml` (main) | `windows`: the same, then packages the zip; `release` waits for it and attaches it | required |
| `next.yml` (next) | `windows`: build and package the `-rc` zip | required |
| `windows-native.yml` | runs main's cross-built unit tests and UI self-test on real Windows 11 | advisory |
The CI image (`ci/images/alkane-ci.Dockerfile`, digest pinned in
`ci/runner-image.txt`) adds mingw-w64, Wine with a ready prefix, the rustup
target and a prebuilt wxMSW prefix to the Linux image. Rebuild it with
`ci/images/build-image.sh TAG` from the workstation that holds the registry
credential; the script pins the new digest everywhere.
## Native Windows runner
`windows-native.yml` runs on the self-hosted runner `win11-test-vm`
(label `alkane-windows`, host mode) inside the Windows 11 test VM
(a local test VM). It downloads the
`alkane-toolkit-windows-tests` artifact of the triggering main run, runs every
test executable and the UI self-test natively, and never blocks a release:
while the VM is off, the job waits for the runner.
In the VM, `gitea-runner` v3.5.0 lives in `C:\gitea-runner` and starts at boot
as the scheduled task `gitea-runner`, running as `LOCAL SERVICE` (log:
`C:\gitea-runner\runner.log`).
## Differences from Linux worth knowing
- wxMSW's `wxDataViewCtrl` is wx's generic implementation (GTK uses the native
`GtkTreeView`), so drag-select and per-cell tooltips are implemented in the
bridge for it.
- Selected rows use the Windows 10/11 list-view highlight: a light tint under
normal text, not a solid colour with white text.
- The app is per-monitor DPI aware: the bridge converts every size it gets
from Rust from DIPs to physical pixels for the window it applies to.