Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
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 <deso@posteo.net>
  • Loading branch information
d-e-s-o committed Oct 15, 2024
1 parent 12ec91c commit 9d3fca4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/file_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 9d3fca4

Please sign in to comment.