Skip to content

Windows support — Phase 3: compile the relay sidecar (whole workspace builds on Windows) - #13

Merged
wess merged 1 commit into
mainfrom
windows/relay
Jul 8, 2026
Merged

Windows support — Phase 3: compile the relay sidecar (whole workspace builds on Windows)#13
wess merged 1 commit into
mainfrom
windows/relay

Conversation

@wess

@wess wess commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Phase 3 of Windows support. With relay ported, the entire workspace now compiles on Windows — terminal app + sidecar.

What's here

  • New crate-root proc module — cross-platform pid liveness + termination, shared by cli and spawn. Unix uses signals (SIGTERM/SIGKILL); Windows uses OpenProcess + TerminateProcess. Replaces the scattered libc::kill sites in cli/server, cli/paths, and spawn.
  • cli/server — cfg-split the shutdown signal handler (Unix SIGTERM+ctrl_c / Windows ctrl_c) and the daemonize spawn (setsid via pre_exec on Unix / detached creation_flags on Windows).
  • cli/launch — foreground launch exec()s on Unix; on Windows there's no exec(), so it spawns + waits + exits with the child's status.
  • cli/paths — the state-dir/file chmod is Unix-gated.
  • Cargo.tomllibc is now Unix-only; the windows crate is added for Windows.
  • CI — the Windows job is now a real gate: cargo build --workspace (the gpui/guise probes stay as distinct early steps for a clear signal).

Verification

  • cargo check + cargo clippy --workspace --target x86_64-pc-windows-gnu: clean (whole workspace).
  • macOS build clean; relay tests (17) still green; no Unix regression.
  • MSVC CI on this PR gates the full workspace build.

Known Windows limitations (deferred)

  • relay stop/terminate is a hard kill on Windows (no SIGTERM for a detached console daemon) — workers don't get a graceful shutdown signal.
  • Runtime behavior (daemonization, signal handling) can't be exercised in CI; needs a Windows machine to validate.

What's next

Phase 4 — packaging: WiX/MSI installer + Scoop + Chocolatey, and a Windows artifact in the release workflow. That's where code-signing (SmartScreen) becomes a decision.

Phase 3 of Windows support. With relay ported, the entire workspace now
builds on Windows.

- New crate-root `proc` module: cross-platform pid liveness + termination.
  Unix uses signals (SIGTERM/SIGKILL); Windows uses OpenProcess +
  TerminateProcess (no SIGTERM for a detached console daemon, so terminate
  hard-kills). Replaces the scattered libc::kill call sites in cli/server,
  cli/paths, and spawn.
- cli/server: cfg-split the shutdown signal handler (unix SIGTERM+ctrl_c /
  windows ctrl_c) and the daemonize spawn (setsid via pre_exec / detached
  creation_flags).
- cli/launch: foreground launch execs on Unix, spawn+wait+exit on Windows.
- cli/paths: gate the state-dir/file chmod to Unix.
- Cargo.toml: libc is now a Unix-only dep; windows crate added for Windows.
- CI: the Windows job now gates a full `cargo build --workspace`.

Verified: cargo check/clippy --workspace --target x86_64-pc-windows-gnu
clean; macOS build + relay tests (17) still green.
@wess
wess merged commit 77f2ddb into main Jul 8, 2026
3 checks passed
@wess
wess deleted the windows/relay branch July 8, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant