From 41b771377ce725d811cc6c3a631b2dc5449cd97d Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 14 Jan 2026 12:51:09 +0800 Subject: [PATCH 1/4] chore: bump rust version --- .../src/interceptions/spawn/exec/with_argv.rs | 24 +++++++++---------- rust-toolchain.toml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs b/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs index 8239b583..ff29de52 100644 --- a/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs +++ b/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs @@ -1,5 +1,5 @@ use std::{ - ffi::VaListImpl, + ffi::VaList, mem::{self, MaybeUninit, transmute}, slice, }; @@ -9,19 +9,19 @@ use nix::Error; // https://github.com/redox-os/relibc/blob/710911febb07a43716a6236cc9e5b864e227e36e/src/header/unistd/mod.rs#L1094 pub unsafe fn with_argv( - mut va: VaListImpl, + mut va: VaList, arg0: *const c_char, - f: impl FnOnce(&[*const c_char], VaListImpl) -> c_int, + f: impl FnOnce(&[*const c_char], VaList) -> c_int, ) -> c_int { - let argc = 1 + unsafe { - va.with_copy(|mut copy| { - core::iter::from_fn(|| Some(copy.arg::<*const c_char>())) - .position(|s| { - // Find the NULL terminator - s.is_null() - }) - .unwrap() - }) + let argc = 1 + { + let mut va = va.clone(); + // Safety: argv is guaranteed to be NULL-terminated + core::iter::from_fn(|| Some(unsafe { va.arg::<*const c_char>() })) + .position(|s| { + // Find the NULL terminator + s.is_null() + }) + .unwrap() }; let mut stack: [MaybeUninit<*const c_char>; 32] = [MaybeUninit::uninit(); 32]; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f6a3df17..d60d3811 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,5 +2,5 @@ # Needed nightly features: # - cargo `Z-bindeps` to build and embed preload shared libraries as dependencies of fspy # - `windows_process_extensions_main_thread_handle` to get the main thread handle for Detours injection -channel = "nightly-2025-10-31" +channel = "nightly-2025-12-11" profile = "default" From 3ea6c45c4439046669c4e3f5d07d2f7549080b64 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 14 Jan 2026 13:21:24 +0800 Subject: [PATCH 2/4] fix --- Cargo.toml | 1 + crates/fspy/src/unix/syscall_handler/mod.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 82ead12e..b928c23b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage)', 'cfg(coverage_ tail_expr_drop_order = "warn" unsafe_op_in_unsafe_fn = "warn" unused_unsafe = "warn" +long_running_const_eval = "allow" [workspace.lints.clippy] all = { level = "warn", priority = -1 } diff --git a/crates/fspy/src/unix/syscall_handler/mod.rs b/crates/fspy/src/unix/syscall_handler/mod.rs index 265e9855..298e1e74 100644 --- a/crates/fspy/src/unix/syscall_handler/mod.rs +++ b/crates/fspy/src/unix/syscall_handler/mod.rs @@ -53,7 +53,7 @@ impl SyscallHandler { let mut path = Cow::Borrowed(Path::new(OsStr::from_bytes(&self.path_read_buf[..path_len]))); if !path.is_absolute() { let mut resolved_path = PathBuf::from(dir_fd.get_path(caller)?); - if !path.is_empty() { + if !nix::NixPath::is_empty(path.as_ref()) { resolved_path.push(&path); } path = Cow::Owned(resolved_path); From d0ebdf678060b916d08941ca5dccefa7a619f104 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 14 Jan 2026 13:44:10 +0800 Subject: [PATCH 3/4] fix: remove unused NixPath import Co-Authored-By: Claude Opus 4.5 --- crates/fspy/src/unix/syscall_handler/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/fspy/src/unix/syscall_handler/mod.rs b/crates/fspy/src/unix/syscall_handler/mod.rs index 298e1e74..6326c9cc 100644 --- a/crates/fspy/src/unix/syscall_handler/mod.rs +++ b/crates/fspy/src/unix/syscall_handler/mod.rs @@ -16,7 +16,6 @@ use fspy_seccomp_unotify::{ supervisor::handler::arg::{CStrPtr, Caller, Fd}, }; use fspy_shared::ipc::{AccessMode, NativeStr, PathAccess}; -use nix::NixPath; use crate::arena::PathAccessArena; From a7f2771d2969fad3e9f5cd9294c681a1c9fde374 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 14 Jan 2026 13:55:26 +0800 Subject: [PATCH 4/4] fix: add lints.workspace = true to all crates This ensures all crates inherit the workspace lints configuration, including the `long_running_const_eval = "allow"` setting needed for the newer Rust nightly. Co-Authored-By: Claude Opus 4.5 --- crates/fspy/Cargo.toml | 3 +++ crates/fspy_e2e/Cargo.toml | 3 +++ crates/fspy_preload_unix/Cargo.toml | 3 +++ crates/fspy_preload_windows/Cargo.toml | 3 +++ crates/fspy_seccomp_unotify/Cargo.toml | 3 +++ crates/fspy_shared/Cargo.toml | 3 +++ crates/fspy_shared_unix/Cargo.toml | 3 +++ crates/vite_glob/Cargo.toml | 3 +++ 8 files changed, 24 insertions(+) diff --git a/crates/fspy/Cargo.toml b/crates/fspy/Cargo.toml index 04e8b131..9428b598 100644 --- a/crates/fspy/Cargo.toml +++ b/crates/fspy/Cargo.toml @@ -60,3 +60,6 @@ anyhow = { workspace = true } flate2 = { workspace = true } tar = { workspace = true } xxhash-rust = { workspace = true, features = ["xxh3"] } + +[lints] +workspace = true diff --git a/crates/fspy_e2e/Cargo.toml b/crates/fspy_e2e/Cargo.toml index e11bd40f..554df534 100644 --- a/crates/fspy_e2e/Cargo.toml +++ b/crates/fspy_e2e/Cargo.toml @@ -9,3 +9,6 @@ fspy = { workspace = true } serde = { workspace = true, features = ["derive"] } tokio = { workspace = true, features = ["full"] } toml = { workspace = true } + +[lints] +workspace = true diff --git a/crates/fspy_preload_unix/Cargo.toml b/crates/fspy_preload_unix/Cargo.toml index a147c4c1..49f934d7 100644 --- a/crates/fspy_preload_unix/Cargo.toml +++ b/crates/fspy_preload_unix/Cargo.toml @@ -15,3 +15,6 @@ fspy_shared = { workspace = true } fspy_shared_unix = { workspace = true } libc = { workspace = true } nix = { workspace = true, features = ["signal", "fs", "socket", "mman", "time"] } + +[lints] +workspace = true diff --git a/crates/fspy_preload_windows/Cargo.toml b/crates/fspy_preload_windows/Cargo.toml index 407379cd..b6f106b6 100644 --- a/crates/fspy_preload_windows/Cargo.toml +++ b/crates/fspy_preload_windows/Cargo.toml @@ -19,3 +19,6 @@ winsafe = { workspace = true } [target.'cfg(target_os = "windows")'.dev-dependencies] tempfile = { workspace = true } + +[lints] +workspace = true diff --git a/crates/fspy_seccomp_unotify/Cargo.toml b/crates/fspy_seccomp_unotify/Cargo.toml index 19855cbf..5dbfbd24 100644 --- a/crates/fspy_seccomp_unotify/Cargo.toml +++ b/crates/fspy_seccomp_unotify/Cargo.toml @@ -26,3 +26,6 @@ tokio = { workspace = true, features = ["macros", "time"] } [features] supervisor = ["dep:passfd", "passfd/async"] target = ["dep:passfd"] + +[lints] +workspace = true diff --git a/crates/fspy_shared/Cargo.toml b/crates/fspy_shared/Cargo.toml index 5d00eef7..f4d30748 100644 --- a/crates/fspy_shared/Cargo.toml +++ b/crates/fspy_shared/Cargo.toml @@ -25,3 +25,6 @@ assert2 = { workspace = true } ctor = { workspace = true } fspy_test_utils = { workspace = true } shared_memory = { workspace = true, features = ["logging"] } + +[lints] +workspace = true diff --git a/crates/fspy_shared_unix/Cargo.toml b/crates/fspy_shared_unix/Cargo.toml index ae0c6589..4593501f 100644 --- a/crates/fspy_shared_unix/Cargo.toml +++ b/crates/fspy_shared_unix/Cargo.toml @@ -22,3 +22,6 @@ memmap2 = { workspace = true } [target.'cfg(target_os = "macos")'.dependencies] phf = { workspace = true } + +[lints] +workspace = true diff --git a/crates/vite_glob/Cargo.toml b/crates/vite_glob/Cargo.toml index 491cfad6..d749d75f 100644 --- a/crates/vite_glob/Cargo.toml +++ b/crates/vite_glob/Cargo.toml @@ -13,3 +13,6 @@ wax = { workspace = true } [dev-dependencies] vite_str = { workspace = true } + +[lints] +workspace = true