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/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/src/unix/syscall_handler/mod.rs b/crates/fspy/src/unix/syscall_handler/mod.rs index 265e9855..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; @@ -53,7 +52,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); 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_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/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 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"