Description: use newer minor version of crate sysinfo Author: Jonas Smedegaard Last-Update: 2026-08-02 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ smol_str = ">= 0.1.24, <= 0.3" syntect = "5.0.0" # sysinfo: no default features to disable the use of threads -sysinfo = { version = "0.29.0", default-features = false, features = [] } +sysinfo = { version = "0.39.3", default-features = false, features = ["system"] } terminal-colorsaurus = "0.4.8" unicode-segmentation = "1.10.1" # 0.2.0 (and 0.1.13) treats \n as width 1. Lines processed by delta have, lose, --- a/src/utils/process.rs +++ b/src/utils/process.rs @@ -4,7 +4,7 @@ use std::sync::{Arc, Condvar, Mutex, MutexGuard}; use lazy_static::lazy_static; -use sysinfo::{Pid, PidExt, Process, ProcessExt, ProcessRefreshKind, SystemExt}; +use sysinfo::{Pid, Process, ProcessRefreshKind, ProcessesToUpdate, UpdateKind}; use crate::utils::DELTA_ATOMIC_ORDERING; @@ -279,27 +279,27 @@ } trait ProcActions { - fn cmd(&self) -> &[String]; + fn cmd(&self) -> Vec; fn parent(&self) -> Option; fn pid(&self) -> DeltaPid; fn start_time(&self) -> u64; } -impl ProcActions for T -where - T: ProcessExt, -{ - fn cmd(&self) -> &[String] { - ProcessExt::cmd(self) +impl ProcActions for Process { + fn cmd(&self) -> Vec { + Process::cmd(self) + .iter() + .map(|arg| arg.to_string_lossy().into_owned()) + .collect() } fn parent(&self) -> Option { - ProcessExt::parent(self).map(|p| p.as_u32()) + Process::parent(self).map(|p| p.as_u32()) } fn pid(&self) -> DeltaPid { - ProcessExt::pid(self).as_u32() + Process::pid(self).as_u32() } fn start_time(&self) -> u64 { - ProcessExt::start_time(self) + Process::start_time(self) } } @@ -369,7 +369,7 @@ .filter(|(_, proc)| { process_start_time_difference_less_than_3s(this_start_time, proc.start_time()) }) - .filter_map(|(&pid, proc)| match extract_args(proc.cmd()) { + .filter_map(|(&pid, proc)| match extract_args(&proc.cmd()) { ProcessArgs::Args(args) => { let mut length_of_process_chain = usize::MAX; @@ -405,8 +405,11 @@ std::process::id() } fn refresh_process(&mut self, pid: DeltaPid) -> bool { - self.info - .refresh_process_specifics(Pid::from_u32(pid), ProcessRefreshKind::new()) + self.info.refresh_processes_specifics( + ProcessesToUpdate::Some(&[Pid::from_u32(pid)]), + true, + ProcessRefreshKind::nothing().with_cmd(UpdateKind::Always), + ) > 0 } fn process(&self, pid: DeltaPid) -> Option<&Self::Out> { self.info.process(Pid::from_u32(pid)) @@ -415,8 +418,11 @@ self.info.processes() } fn refresh_processes(&mut self) { - self.info - .refresh_processes_specifics(ProcessRefreshKind::new()) + self.info.refresh_processes_specifics( + ProcessesToUpdate::All, + true, + ProcessRefreshKind::nothing().with_cmd(UpdateKind::Always), + ); } } @@ -449,7 +455,7 @@ }; let parent_pid = parent.pid(); - match extract_args(parent.cmd()) { + match extract_args(&parent.cmd()) { ProcessArgs::Args(result) => return Some(result), ProcessArgs::ArgError => return None, @@ -459,7 +465,7 @@ ProcessArgs::OtherProcess if depth == 1 => { let sibling = info.naive_sibling_process(current_pid); if let Some(proc) = sibling { - if let ProcessArgs::Args(result) = extract_args(proc.cmd()) { + if let ProcessArgs::Args(result) = extract_args(&proc.cmd()) { return Some(result); } } @@ -700,8 +706,8 @@ } impl ProcActions for FakeProc { - fn cmd(&self) -> &[String] { - &self.cmd + fn cmd(&self) -> Vec { + self.cmd.clone() } fn parent(&self) -> Option { self.ppid