Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions crates/fspy/src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ impl SpyImpl {
Ok(Self { ansi_dll_path_with_nul: ansi_dll_path_with_nul.into() })
}

#[expect(clippy::unused_async, reason = "async signature required by SpyImpl trait")]
pub(crate) async fn spawn(
pub(crate) fn spawn(
&self,
command: Command,
cancellation_token: CancellationToken,
) -> std::future::Ready<Result<TrackedChild, SpawnError>> {
std::future::ready(self.spawn_inner(command, cancellation_token))
}

fn spawn_inner(
&self,
mut command: Command,
cancellation_token: CancellationToken,
Expand Down
2 changes: 1 addition & 1 deletion crates/fspy_benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fn sorted(values: impl Iterator<Item = f64>) -> Vec<f64> {
values
}

fn quantile(sorted: &[f64], numerator: usize, denominator: usize) -> f64 {
const fn quantile(sorted: &[f64], numerator: usize, denominator: usize) -> f64 {
sorted[sorted.len() * numerator / denominator]
}

Expand Down
4 changes: 1 addition & 3 deletions crates/fspy_preload_unix/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Compile as an empty crate on non-unix targets and on musl (where seccomp
// alone handles access tracking). Guarding the feature gate keeps rustc from
// warning about unused features on those targets.
#![cfg_attr(all(unix, not(target_env = "musl")), feature(c_variadic))]
// alone handles access tracking).

#[cfg(all(unix, not(target_env = "musl")))]
mod client;
Expand Down
16 changes: 16 additions & 0 deletions crates/fspy_preload_unix/src/macros/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ macro_rules! intercept {
}
}
#[cfg(not(test))] // Don't interpose on the test binary
#[expect(
clippy::allow_attributes,
reason = "runtime symbol lint applies only to compiler-known libc symbols"
)]
const _: () = {
#[allow(
invalid_runtime_symbol_definitions,
reason = "naked assembly trampoline forwards the original ABI without a Rust signature"
)]
#[unsafe(naked)]
#[unsafe(export_name = ::core::concat!(::core::stringify!($name), 64))]
pub unsafe extern "C" fn interpose_fn() {
Expand Down Expand Up @@ -55,7 +63,15 @@ macro_rules! intercept_inner {
const _: $fn_sig = $crate::libc::$name;

#[cfg(not(test))] // Don't interpose on the test binary
#[expect(
clippy::allow_attributes,
reason = "runtime symbol lint applies only to compiler-known libc symbols"
)]
const _: () = {
#[allow(
invalid_runtime_symbol_definitions,
reason = "naked assembly trampoline forwards the original ABI without a Rust signature"
)]
#[unsafe(naked)]
#[unsafe(export_name = ::core::stringify!($name))]
pub unsafe extern "C" fn interpose_fn() {
Expand Down
6 changes: 3 additions & 3 deletions crates/fspy_shared/src/ipc/channel/shm_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl<M: AsRawSlice> ShmWriter<M> {
// Try to atomically claim the space
// Different writers only share the header, not each other's content. so relaxed ordering is sufficient.
let current_end =
atomic_header.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |current_end| {
atomic_header.try_update(Ordering::Relaxed, Ordering::Relaxed, |current_end| {
let new_end = roundup_to_align_frame_header(current_end + frame_with_header_size);

// Check if we have enough space
Expand All @@ -193,14 +193,14 @@ impl<M: AsRawSlice> ShmWriter<M> {

// Successfully claimed the space, now write the data

// SAFETY: The atomic fetch_update above guaranteed that `size_of::<usize>() + current_end`
// SAFETY: The atomic try_update above guaranteed that `size_of::<usize>() + current_end`
// is within the shared memory bounds, so this pointer arithmetic stays within the allocation.
let frame_start = unsafe {
shm_ptr.add(/* shm header */ size_of::<usize>() + current_end)
};

// SAFETY: `frame_start` is properly aligned to `i32` (ensured by `roundup_to_align_frame_header`)
// and points within the shared memory allocation (bounds checked by the atomic fetch_update).
// and points within the shared memory allocation (bounds checked by the atomic try_update).
let frame_header = unsafe { AtomicI32::from_ptr(frame_start.cast()) };

// Mark as partially written with positive size
Expand Down
1 change: 0 additions & 1 deletion crates/preload_test_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//! `dlsym(RTLD_NEXT, …)`, so fspy still sees the real accesses and can
//! track them as cache inputs.
#![cfg(target_os = "linux")]
#![feature(c_variadic)]

use std::{
ffi::{CStr, c_char, c_int},
Expand Down
9 changes: 5 additions & 4 deletions crates/vite_powershell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ use vite_path::{AbsolutePath, AbsolutePathBuf};
pub const POWERSHELL_PREFIX: &[&str] =
&["-NoProfile", "-NoLogo", "-ExecutionPolicy", "Bypass", "-File"];

/// Cached location of the `PowerShell` host. Prefers cross-platform
/// `pwsh.exe` when present, falling back to the Windows built-in
/// `powershell.exe`. Returns `None` on non-Windows or when neither host
/// is on `PATH`.
/// Cached location of the `PowerShell` host.
///
/// Prefers cross-platform `pwsh.exe` when present, falling back to the
/// Windows built-in `powershell.exe`. Returns `None` on non-Windows or when
/// neither host is on `PATH`.
///
/// Cached as `Arc<AbsolutePath>` so callers that want shared ownership
/// (e.g. `vite_task_plan`'s plan-time rewrite) can do `Arc::clone(host)`
Expand Down
2 changes: 1 addition & 1 deletion crates/vite_task/src/session/execute/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ fn determine_folder_change_kind<'a>(
}

/// Check if a directory entry should be ignored in fingerprinting
fn should_ignore_entry(name: &[u8]) -> bool {
const fn should_ignore_entry(name: &[u8]) -> bool {
matches!(name, b"." | b".." | b".DS_Store") || name.eq_ignore_ascii_case(b"dist")
}

Expand Down
4 changes: 2 additions & 2 deletions crates/vite_task_graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub enum TaskGraphLoadError {
specifier: Str,
task_display: TaskDisplay,
#[source]
error: SpecifierLookupError,
error: Box<SpecifierLookupError>,
},

#[error("`cache` can only be set in the workspace root config, but found in {package_path}")]
Expand Down Expand Up @@ -434,7 +434,7 @@ impl IndexedTaskGraph {
)
.map_err(|error| {
TaskGraphLoadError::DependencySpecifierLookupError {
error,
error: Box::new(error),
specifier: specifier.clone(),
task_display: me.display_task(from_node_index),
}
Expand Down
1 change: 0 additions & 1 deletion crates/vite_task_plan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ const fn resolve_cache_with_override(
/// # Errors
/// Returns an error if the program is not found or path fingerprinting fails.
#[tracing::instrument(level = "debug", skip_all)]
#[expect(clippy::result_large_err, reason = "Error is large for diagnostics")]
pub fn plan_synthetic(
workspace_path: &Arc<AbsolutePath>,
cwd: &Arc<AbsolutePath>,
Expand Down
4 changes: 0 additions & 4 deletions crates/vite_task_plan/src/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ pub enum ParentCacheConfig {
/// env config and merges in any additional envs the synthetic command needs.
/// - If there is no parent (top-level invocation), the synthetic task's own
/// [`UserCacheConfig`] is resolved with defaults.
#[expect(clippy::result_large_err, reason = "Error is large for diagnostics")]
fn resolve_synthetic_cache_config(
parent: ParentCacheConfig,
synthetic_cache_config: UserCacheConfig,
Expand Down Expand Up @@ -542,7 +541,6 @@ fn resolve_synthetic_cache_config(
}
}

#[expect(clippy::result_large_err, reason = "Error is large for diagnostics")]
pub fn plan_synthetic_request(
workspace_path: &Arc<AbsolutePath>,
prefix_envs: &BTreeMap<Str, Str>,
Expand Down Expand Up @@ -594,7 +592,6 @@ fn strip_prefix_for_cache(
}
}

#[expect(clippy::result_large_err, reason = "Error is large for diagnostics")]
#[expect(
clippy::needless_pass_by_value,
reason = "program_path ownership is needed for Arc construction"
Expand Down Expand Up @@ -901,7 +898,6 @@ pub async fn plan_query_request(
///
/// Returns `Ok(None)` if the variable is not set.
/// Returns `Err` if the variable is set but cannot be parsed as a positive integer.
#[expect(clippy::result_large_err, reason = "Error type is shared across all plan functions")]
fn concurrency_limit_from_env(
envs: &FxHashMap<Arc<OsStr>, Arc<OsStr>>,
) -> Result<Option<usize>, Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/vite_tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl App {
}
match action {
Action::Tick => {
self.last_tick_key_events.drain(..);
self.last_tick_key_events.clear();
}
Action::Quit => self.should_quit = true,
Action::Suspend => self.should_suspend = true,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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-2026-06-07"
channel = "nightly-2026-08-02"
profile = "default"
Loading