From 9d3fca4954df4d2eddf239d1aa23e1361d3f27f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Tue, 15 Oct 2024 11:00:21 -0700 Subject: [PATCH] Fix Windows build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the Windows build for tests, which broke due to the recently added std::os::fd::AsRawFd import. Also add a CI job building tests for Windows to prevent regressions in the future. Signed-off-by: Daniel Müller --- .github/workflows/test.yml | 4 ++++ src/file_cache.rs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7cd5d7cf6..93e497811 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,6 +49,10 @@ jobs: rust: stable profile: release args: "--lib --no-default-features" + - runs-on: windows-latest + rust: stable + profile: dev + args: "--tests" - runs-on: ubuntu-latest rust: stable profile: dev diff --git a/src/file_cache.rs b/src/file_cache.rs index 4fd079d4a..619bc4fc9 100644 --- a/src/file_cache.rs +++ b/src/file_cache.rs @@ -179,9 +179,6 @@ mod tests { use std::io::Read as _; use std::io::Write as _; - use std::os::fd::AsRawFd as _; - #[cfg(not(windows))] - use std::os::unix::fs::symlink; use std::thread::sleep; use std::time::Duration; @@ -225,6 +222,9 @@ mod tests { #[cfg(not(windows))] #[test] fn file_symlinks() { + use std::os::fd::AsRawFd as _; + use std::os::unix::fs::symlink; + let tmpfile = NamedTempFile::new().unwrap(); let tmpdir = tempdir().unwrap(); let link = tmpdir.path().join("symlink");