diff --git a/.github/workflows/fspy-benchmark.yml b/.github/workflows/fspy-benchmark.yml
index c09c7ba08..db3ec05e4 100644
--- a/.github/workflows/fspy-benchmark.yml
+++ b/.github/workflows/fspy-benchmark.yml
@@ -79,9 +79,8 @@ jobs:
if: github.event_name == 'pull_request'
working-directory: ${{ env.BASE_DIR }}
env:
- # Share the head build's target directory: the crates.io graph is
- # fingerprinted by package and profile, not by workspace, so only the
- # fspy path crates build twice.
+ # Share the head build's target directory so registry dependencies
+ # only build once. Workspace artifacts are removed below.
CARGO_TARGET_DIR: ${{ github.workspace }}/target
run: |
# Both fspy revisions must be measured by identical code, and the
@@ -94,6 +93,9 @@ jobs:
exe=""
[[ "$RUNNER_OS" == "Windows" ]] && exe=.exe
cp "$CARGO_TARGET_DIR/release/fspy_benchmark_launcher$exe" "$RUNNER_TEMP/fspy-base-launcher$exe"
+ # A baseline worktree created after the head can leave newer
+ # workspace artifacts that Cargo considers fresh for the head.
+ cargo clean --release --workspace
- name: Run benchmark
run: |
diff --git a/Cargo.lock b/Cargo.lock
index 72842724d..0d9049cd6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1313,6 +1313,7 @@ dependencies = [
"fspy_shared_unix",
"libc",
"nix 0.31.2",
+ "sigsafe",
"sigsafe_alloc",
"wincode",
]
diff --git a/crates/fspy_preload_unix/Cargo.toml b/crates/fspy_preload_unix/Cargo.toml
index be676c1d9..95b3ea016 100644
--- a/crates/fspy_preload_unix/Cargo.toml
+++ b/crates/fspy_preload_unix/Cargo.toml
@@ -17,6 +17,7 @@ fspy_shared = { workspace = true }
fspy_shared_unix = { workspace = true }
libc = { workspace = true }
nix = { workspace = true, features = ["signal", "fs", "socket", "mman", "time"] }
+sigsafe = { workspace = true }
sigsafe_alloc = { workspace = true }
[build-dependencies]
diff --git a/crates/fspy_preload_unix/src/client/convert.rs b/crates/fspy_preload_unix/src/client/convert.rs
index c42854b32..5a9f469cf 100644
--- a/crates/fspy_preload_unix/src/client/convert.rs
+++ b/crates/fspy_preload_unix/src/client/convert.rs
@@ -2,7 +2,7 @@
use std::ffi::CString;
use std::{
ffi::{CStr, OsStr},
- os::{fd::RawFd, unix::ffi::OsStrExt as _},
+ os::unix::ffi::OsStrExt as _,
path::PathBuf,
};
@@ -10,13 +10,16 @@ use bstr::{BStr, ByteSlice};
use fspy_shared::ipc::AccessMode;
use libc::{c_char, c_int};
use nix::unistd::getcwd;
+use sigsafe::{AsRawFd as _, BorrowedFd, CWD};
#[cfg(target_os = "linux")]
-fn get_fd_path(fd: RawFd) -> nix::Result