Skip to content

fix(ci): build daemon_lifecycle on Windows (MSVC) - #3

Merged
hmziqagent merged 2 commits into
mainfrom
fix/msvc-windows-test-build
Jul 29, 2026
Merged

fix(ci): build daemon_lifecycle on Windows (MSVC)#3
hmziqagent merged 2 commits into
mainfrom
fix/msvc-windows-test-build

Conversation

@hmziqagent

Copy link
Copy Markdown
Collaborator

Problem

The windows (MSVC test) job has been failing on cargo test with a compile error:

error[E0433]: cannot find `unix` in `os`
  --> tests\daemon_lifecycle.rs:349:28
349 | std::os::unix::net::UnixStream::connect(&paths.socket)

std::os::unix does not exist on Windows, so the test crate failed to compile under MSVC.

Root cause

silent_client_does_not_wedge_the_accept_loop reached past the crate's cross-platform IPC abstraction and called std::os::unix::net::UnixStream directly. The windows-gnu cross-check never caught it because it ran cargo check without --all-targets, so the integration tests were never type-checked for Windows — the breakage only surfaced on the slower MSVC job.

Fix

  1. tests/daemon_lifecycle.rs — use the crate's own oxiwake::platform::connect (Unix socket on Linux, named pipe on Windows). Fixes the build and now exercises the silent-client drop-timeout invariant on Windows too.
  2. .github/workflows/ci.yml — add --all-targets to the windows-gnu cross-check so non-Windows calls in tests are caught on the cheap Linux runner before reaching MSVC.

Verification

  • cargo check --target x86_64-pc-windows-gnu --all-targets → green (this command reproduced the E0433 before the fix)
  • cargo test --test daemon_lifecycle (Linux) → 4/4 pass, incl. the rewritten silent-client test
  • cargo fmt --check / cargo clippy --all-targets -- -D warnings → clean

The silent-client test called `std::os::unix::net::UnixStream::connect`
directly. `std::os::unix` does not exist on Windows, so `cargo test`
failed to compile the test crate under MSVC:

  error[E0433]: cannot find `unix` in `os`
    --> tests\daemon_lifecycle.rs:349:28
  349 | std::os::unix::net::UnixStream::connect(&paths.socket)

Use the crate's own cross-platform `oxiwake::platform::connect` instead
(Unix socket on Linux, named pipe on Windows). This both fixes the build
and exercises the silent-client drop-timeout invariant on Windows too.

Why this slipped through: the windows-gnu cross-check ran `cargo check`
without `--all-targets`, so it never compiled the integration tests and
let the unix-only call reach only the slower MSVC job.
Add `--all-targets` so the integration tests are type-checked for
Windows on the cheap Linux runner. A non-Windows call in a test (like
the `std::os::unix` usage that just broke the MSVC job) is then caught
here instead of only failing the slower windows-msvc job. `cargo check`
still does not link, so no MinGW linker is required.
@hmziqagent
hmziqagent merged commit f7c92c1 into main Jul 29, 2026
4 checks passed
@hmziqagent
hmziqagent deleted the fix/msvc-windows-test-build branch July 29, 2026 17:08
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.

2 participants