diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cc16c3..0f07ea4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,9 +56,12 @@ jobs: targets: x86_64-pc-windows-gnu - uses: Swatinem/rust-cache@v2 # `check` type-checks the cfg(windows) backend without needing a MinGW - # linker to actually link a binary. - - name: cargo check --target x86_64-pc-windows-gnu - run: cargo check --target x86_64-pc-windows-gnu + # linker to actually link a binary. `--all-targets` also type-checks the + # integration tests, so a `std::os::unix` (or other non-Windows) call in a + # test is caught here on the cheap Linux runner instead of failing the + # slower windows-msvc job. + - name: cargo check --target x86_64-pc-windows-gnu --all-targets + run: cargo check --target x86_64-pc-windows-gnu --all-targets windows: name: windows (MSVC test) diff --git a/tests/daemon_lifecycle.rs b/tests/daemon_lifecycle.rs index b7219df..f9bac1e 100644 --- a/tests/daemon_lifecycle.rs +++ b/tests/daemon_lifecycle.rs @@ -344,9 +344,14 @@ fn silent_client_does_not_wedge_the_accept_loop() { }) .expect("daemon never answered initial Ping"); - // A silent client: connect and send nothing, keep the handle alive. + // A silent client: connect and send nothing, keep the handle alive. We use + // the crate's own [`oxiwake::platform::connect`] rather than reaching for + // `std::os::unix::net::UnixStream` directly: `std::os::unix` does not exist + // on Windows, so the direct call broke the MSVC build. `platform::connect` + // is the cross-platform client connect (Unix socket on Linux, named pipe on + // Windows), so this invariant is now exercised on both platforms. let paths = Paths::resolve().unwrap(); - let _silent = std::os::unix::net::UnixStream::connect(&paths.socket).unwrap(); + let _silent = oxiwake::platform::connect(&paths).unwrap(); std::thread::sleep(Duration::from_millis(200)); // A real Ping must still succeed — the silent client is dropped after the