diff --git a/.github/workflows/rust-spike.yml b/.github/workflows/rust-spike.yml index 82f7fcef..2856633b 100644 --- a/.github/workflows/rust-spike.yml +++ b/.github/workflows/rust-spike.yml @@ -17,6 +17,24 @@ on: - ".github/workflows/rust-spike.yml" jobs: + windows-compile: + name: Windows native compile + runs-on: windows-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + + - name: Install rust toolchain (pinned by rust/rust-toolchain.toml) + run: rustup show + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + + - name: Check native workspace + working-directory: rust + run: cargo check --workspace --locked + rust-contract: name: Rust contract + live-corpus invariants runs-on: ubuntu-latest diff --git a/rust/rac-engine/src/derived_cache.rs b/rust/rac-engine/src/derived_cache.rs index ee0a1645..c4889226 100644 --- a/rust/rac-engine/src/derived_cache.rs +++ b/rust/rac-engine/src/derived_cache.rs @@ -50,10 +50,14 @@ pub fn default_cache_dir() -> PathBuf { // --------------------------------------------------------------------------- fn stat_pair(path: &Path) -> Option<(u64, u64)> { - use std::os::unix::fs::MetadataExt; let meta = std::fs::metadata(path).ok()?; - let mtime_ns = (meta.mtime() as i128) * 1_000_000_000 + i128::from(meta.mtime_nsec()); - Some((meta.len(), mtime_ns as u64)) + let mtime_ns = meta + .modified() + .ok()? + .duration_since(std::time::UNIX_EPOCH) + .ok()? + .as_nanos() as u64; + Some((meta.len(), mtime_ns)) } /// Diff the corpus against `prev_manifest` by stat, content-confirming diff --git a/rust/rac-engine/src/hook.rs b/rust/rac-engine/src/hook.rs index 3334d360..6cd5ff67 100644 --- a/rust/rac-engine/src/hook.rs +++ b/rust/rac-engine/src/hook.rs @@ -98,11 +98,12 @@ pub fn install_hook(target_dir: &str, style: &str) -> Result { - let link = cstr_field(&header[157..257]); if let Some(parent) = dest.parent() { let _ = std::fs::create_dir_all(parent); } #[cfg(unix)] - let _ = std::os::unix::fs::symlink(&link, &dest); + { + let link = cstr_field(&header[157..257]); + let _ = std::os::unix::fs::symlink(&link, &dest); + } } _ => {} // hardlinks/devices: never in git archives }