From 7814dd0301c39987d36c8dbee4cd1b5802e315cc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:50:37 +0200 Subject: [PATCH] Update Rust crate sysinfo to 0.31.0 (#17733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [sysinfo](https://redirect.github.com/GuillaumeGomez/sysinfo) | workspace.dependencies | minor | `0.30.7` -> `0.31.0` | --- ### Release Notes
GuillaumeGomez/sysinfo (sysinfo) ### [`v0.31.4`](https://redirect.github.com/GuillaumeGomez/sysinfo/blob/HEAD/CHANGELOG.md#0314) [Compare Source](https://redirect.github.com/GuillaumeGomez/sysinfo/compare/v0.31.3...v0.31.4) - macOS: Force memory cleanup in disk list retrieval. ### [`v0.31.3`](https://redirect.github.com/GuillaumeGomez/sysinfo/blob/HEAD/CHANGELOG.md#0313) [Compare Source](https://redirect.github.com/GuillaumeGomez/sysinfo/compare/v0.31.2...v0.31.3) - Raspberry Pi: Fix temperature retrieval. ### [`v0.31.2`](https://redirect.github.com/GuillaumeGomez/sysinfo/blob/HEAD/CHANGELOG.md#0312) [Compare Source](https://redirect.github.com/GuillaumeGomez/sysinfo/compare/v0.31.1...v0.31.2) - Remove `bstr` dependency (needed for rustc development). ### [`v0.31.1`](https://redirect.github.com/GuillaumeGomez/sysinfo/blob/HEAD/CHANGELOG.md#0311) [Compare Source](https://redirect.github.com/GuillaumeGomez/sysinfo/compare/v0.31.0...v0.31.1) - Downgrade version of `memchr` (needed for rustc development). ### [`v0.31.0`](https://redirect.github.com/GuillaumeGomez/sysinfo/blob/HEAD/CHANGELOG.md#0310) [Compare Source](https://redirect.github.com/GuillaumeGomez/sysinfo/compare/v0.30.13...v0.31.0) - Split crate in features to only enable what you need. - Remove `System::refresh_process`, `System::refresh_process_specifics` and `System::refresh_pids` methods. - Add new argument of type `ProcessesToUpdate` to `System::refresh_processes` and `System::refresh_processes_specifics` methods. - Add new `NetworkData::ip_networks` method. - Add new `System::refresh_cpu_list` method. - Global CPU now only contains CPU usage. - Rename `TermalSensorType` to `ThermalSensorType`. - Process names is now an `OsString`. - Remove `System::global_cpu_info`. - Add `System::global_cpu_usage`. - macOS: Fix invalid CPU computation when single processes are refreshed one after the other. - Windows: Fix virtual memory computation. - Windows: Fix WoW64 parent process refresh. - Linux: Retrieve RSS (Resident Set Size) memory for cgroups.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone America/New_York, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- Release Notes: - N/A --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> --- Cargo.lock | 19 ++++--------------- Cargo.toml | 2 +- crates/client/src/telemetry.rs | 10 ++++++++-- crates/terminal/src/pty_info.rs | 15 ++++++++++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9cff895393..930415440b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11085,17 +11085,16 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.13" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" dependencies = [ - "cfg-if", "core-foundation-sys", "libc", + "memchr", "ntapi", - "once_cell", "rayon", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] @@ -13443,16 +13442,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.54.0" diff --git a/Cargo.toml b/Cargo.toml index eea510edf2..0b392e02eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -416,7 +416,7 @@ strsim = "0.11" strum = { version = "0.25.0", features = ["derive"] } subtle = "2.5.0" sys-locale = "0.3.1" -sysinfo = "0.30.7" +sysinfo = "0.31.0" tempfile = "3.9.0" thiserror = "1.0.29" tiktoken-rs = "0.5.9" diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index 860288038b..b415cae14c 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -304,7 +304,10 @@ impl Telemetry { let refresh_kind = ProcessRefreshKind::new().with_cpu().with_memory(); let current_process = Pid::from_u32(std::process::id()); - system.refresh_process_specifics(current_process, refresh_kind); + system.refresh_processes_specifics( + sysinfo::ProcessesToUpdate::Some(&[current_process]), + refresh_kind, + ); // Waiting some amount of time before the first query is important to get a reasonable value // https://docs.rs/sysinfo/0.29.10/sysinfo/trait.ProcessExt.html#tymethod.cpu_usage @@ -314,7 +317,10 @@ impl Telemetry { smol::Timer::after(DURATION_BETWEEN_SYSTEM_EVENTS).await; let current_process = Pid::from_u32(std::process::id()); - system.refresh_process_specifics(current_process, refresh_kind); + system.refresh_processes_specifics( + sysinfo::ProcessesToUpdate::Some(&[current_process]), + refresh_kind, + ); let Some(process) = system.process(current_process) else { log::error!( "Failed to find own process {current_process:?} in system process table" diff --git a/crates/terminal/src/pty_info.rs b/crates/terminal/src/pty_info.rs index 5fc3b05f78..559d022fda 100644 --- a/crates/terminal/src/pty_info.rs +++ b/crates/terminal/src/pty_info.rs @@ -98,9 +98,10 @@ impl PtyProcessInfo { fn refresh(&mut self) -> Option<&Process> { let pid = self.pid_getter.pid()?; - if self - .system - .refresh_process_specifics(pid, self.refresh_kind) + if self.system.refresh_processes_specifics( + sysinfo::ProcessesToUpdate::Some(&[pid]), + self.refresh_kind, + ) == 1 { self.system.process(pid) } else { @@ -116,9 +117,13 @@ impl PtyProcessInfo { .map_or(PathBuf::new(), |p| p.to_owned()); let info = ProcessInfo { - name: process.name().to_owned(), + name: process.name().to_str()?.to_owned(), cwd, - argv: process.cmd().to_vec(), + argv: process + .cmd() + .iter() + .filter_map(|s| s.to_str().map(ToOwned::to_owned)) + .collect(), }; self.current = Some(info.clone()); Some(info)