Add Windows support for IPC with TCP and port file discovery#45
Open
abnegate wants to merge 14 commits into
Open
Add Windows support for IPC with TCP and port file discovery#45abnegate wants to merge 14 commits into
abnegate wants to merge 14 commits into
Conversation
- IPC: On Windows, use TCP localhost with a port file for daemon discovery instead of Unix domain sockets. On Unix, behavior is unchanged. - Process detection: Use Windows OpenProcess API via windows-sys crate to check if a daemon PID is still running. - Cross-platform fixes: Use `where` instead of `which` on Windows for binary detection, add Windows DLL path for vectorlite, use platform-appropriate temp dirs and test paths. - All existing Unix/macOS behavior is preserved behind #[cfg] guards. https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
- ci.yml: Add Windows test job and Windows build to matrix - release.yml: Add x86_64-pc-windows-msvc target producing .zip archive https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
Introduce two new modules that centralise all OS-specific logic: - `platform.rs` — file permissions, process detection, command existence - `ipc/transport.rs` — IpcStream/IpcListener type aliases, connect/bind/ check_connection helpers This eliminates duplicated #[cfg] blocks across env_writer, encryption, routes, detector, and collapses the two platform-specific handle_connection and send_internal implementations in the IPC server/client into single platform-agnostic functions. Net effect: -335 lines, +46 lines across 8 existing files. https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
- Add file_url() helper for git tests to produce valid file:// URLs on Windows (forward slashes, triple-slash prefix for drive letters) - Normalise backslashes in find_by_vendor_path() so Windows paths match the /vendor/ pattern - Add .gitattributes with eol=lf to prevent autocrlf line-ending issues in CI - CI: add git autocrlf=false config and embedding model warmup step to the Windows test job; use runner.temp for cache paths https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
abnegate
force-pushed
the
claude/add-windows-support-Aowy4
branch
from
February 27, 2026 23:10
75209a8 to
163c3a2
Compare
The `runner` context is not available in job-level `env` blocks, which caused the entire workflow to fail with "Unrecognized named-value: runner". Move the env var to the individual steps that need it. https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
aws-lc-sys (pulled in by rustls-acme with aws-lc-rs) requires NASM to compile assembly on Windows. The CI runners don't have NASM installed, so use the prebuilt NASM objects instead. https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
Fix HANDLE type comparison in platform.rs - use is_null() instead of comparing with 0, since HANDLE is *mut c_void in windows-sys 0.59+. Fix test_validate_model_path_directory to use std::env::temp_dir() instead of hardcoded /tmp which doesn't exist on Windows. Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
aws-lc-sys has known MSVC compilation issues on Windows (pthread_rwlock_t, C11 detection failures). Switch to ring as the crypto provider for rustls which has reliable cross-platform support. Changes: - rustls-acme: use ring instead of aws-lc-rs feature - reqwest: disable default TLS (which hardcodes aws-lc-rs) and use rustls-no-provider so ring from rustls-acme is used - Add 10s SMTP transport timeout to prevent test hangs on Windows - Add timeout-minutes: 30 to Windows CI jobs - Remove AWS_LC_SYS_PREBUILT_NASM env (no longer needed) https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
Add timeout-minutes to warmup (10min) and test run (20min) steps to prevent indefinite hangs in the Windows CI. https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
abnegate
force-pushed
the
claude/add-windows-support-Aowy4
branch
from
March 2, 2026 22:43
22ce9d8 to
3fdf430
Compare
…vider The reqwest crate with rustls-no-provider requires a crypto provider to be installed before any TLS connections. Add rustls with ring feature as a direct dependency so that rustls auto-detects ring via get_default_or_install_from_crate_features(). Also explicitly install ring as the default provider in main() and e2e binary for safety. This ensures all rustls consumers (reqwest, axum-server, rustls-acme) use ring instead of aws-lc-rs, fixing Windows build failures caused by aws-lc-sys compilation issues with MSVC. https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
Resolve conflicts from the monolith-to-workspace restructuring on main. Key changes: - Add platform.rs to claudear-core crate for cross-crate platform abstractions - Fix crate imports (claudear_core::platform:: instead of crate::platform::) - Keep init_tls() for ring crypto provider in root crate - Keep Windows build/test CI jobs with workspace-compatible config - Keep windows-sys dependency for Windows process detection - Add rustls as direct dependency for root crate (needed by init_tls) https://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the IPC (Inter-Process Communication) system to support Windows by replacing Unix domain sockets with TCP connections on localhost, while maintaining Unix socket support on Unix-like systems.
Key Changes
IPC Module (
src/ipc/mod.rs)ipc_runtime_dir()to use platform-specific directories:%LOCALAPPDATA%\claudearwith fallback to%TEMP%\claudearXDG_RUNTIME_DIR(Linux) orclaudear-{uid}in temp directory with 0700 permissionsdefault_socket_path()to return.portfiles on Windows and.sockfiles on Unixis_daemon_running()to check TCP connectivity on Windows (reading port from file) and Unix socket connectivity on Unixread_port_from_file()andwrite_port_file()helper functions for Windows port file managementcleanup_stale_files()to handle both socket and port file cleanup across platformsOpenProcessAPI withPROCESS_QUERY_LIMITED_INFORMATIONIPC Client (
src/ipc/client.rs)send_internal()to support both Unix sockets and TCP connections:127.0.0.1:{port}is_daemon_running()with platform-specific logicstd::env::temp_dir()instead of hardcoded/tmppathsIPC Server (
src/ipc/server.rs)run()to bind to appropriate listener:UnixListeneron socket pathTcpListeneron127.0.0.1:0(OS-assigned port), writes port to port filehandle_connection()implementations for Unix (UnixStream) and Windows (TcpStream)Tool Detection (
src/evaluation/detector.rs)which_exists()to usewherecommand on Windows instead ofwhichcmdon Windows andlson UnixDependencies (
Cargo.toml)windows-sysdependency withWin32_FoundationandWin32_System_Threadingfeatures for Windows process checkingtokioincludesnetfeature for TCP supportStorage (
src/storage/vectorlite.rs)./vectorlite.dll) to vectorlite library search pathsImplementation Details
%LOCALAPPDATA%which is user-private by default; Unix maintains strict 0700 permissions on runtime directoriesOpenProcesswith read-only flags; Unix uses/procorkill -0as beforehttps://claude.ai/code/session_01Mmu98Tc4ZbqpRzMCsVCkXd