From c358400351c3e6474834a979701315cff1ad9d0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 20:53:01 +1300 Subject: [PATCH] Bump procfs from 0.14.1 to 0.15.1 (#8233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [procfs](https://github.com/eminence/procfs) from 0.14.1 to 0.15.1.
Release notes

Sourced from procfs's releases.

v0.15.1

New features

New Contributors

Full Changelog: https://github.com/eminence/procfs/compare/v0.15.0...v0.15.1

v0.15.0

New Features

Bug fixes

Breaking changes

New Contributors

Full Changelog: https://github.com/eminence/procfs/compare/v0.14.2...v0.15.0

MSRV Note

This v0.15 release is only tested against the latest stable rust compiler, but is known to work with older versions (down to rust 1.48). Support for these older compilers may break in procfs patch releases. See also #223

v0.14.2

New Features

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=procfs&package-manager=cargo&previous-version=0.14.1&new-version=0.15.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JT <547158+jntrnr@users.noreply.github.com> --- Cargo.lock | 44 +++++++++++++++++++++++++++++------ crates/nu-system/Cargo.toml | 2 +- crates/nu-system/src/linux.rs | 5 ++-- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42a8e5ee6e..e405df5a9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1268,7 +1268,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e11dcc7e4d79a8c89b9ab4c6f5c30b1fc4a83c420792da3542fd31179ed5f517" dependencies = [ "cfg-if", - "rustix", + "rustix 0.35.11", "windows-sys 0.36.1", ] @@ -1884,6 +1884,16 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" +[[package]] +name = "io-lifetimes" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "ipnet" version = "2.5.0" @@ -2189,6 +2199,12 @@ version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -3943,9 +3959,9 @@ dependencies = [ [[package]] name = "procfs" -version = "0.14.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfb6451c91904606a1abe93e83a8ec851f45827fa84273f256ade45dc095818" +checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f" dependencies = [ "bitflags", "byteorder", @@ -3953,7 +3969,7 @@ dependencies = [ "flate2", "hex", "lazy_static", - "rustix", + "rustix 0.36.8", ] [[package]] @@ -4464,12 +4480,26 @@ checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" dependencies = [ "bitflags", "errno 0.2.8", - "io-lifetimes", + "io-lifetimes 0.7.3", "libc", - "linux-raw-sys", + "linux-raw-sys 0.0.46", "windows-sys 0.36.1", ] +[[package]] +name = "rustix" +version = "0.36.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +dependencies = [ + "bitflags", + "errno 0.2.8", + "io-lifetimes 1.0.5", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + [[package]] name = "rustversion" version = "1.0.9" @@ -5138,7 +5168,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1" dependencies = [ - "rustix", + "rustix 0.35.11", "windows-sys 0.36.1", ] diff --git a/crates/nu-system/Cargo.toml b/crates/nu-system/Cargo.toml index 7c02d4c7aa..8abcd54c4d 100644 --- a/crates/nu-system/Cargo.toml +++ b/crates/nu-system/Cargo.toml @@ -21,7 +21,7 @@ nix = { version = "0.25", default-features = false, features = ["fs", "term", "p atty = "0.2" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] -procfs = "0.14.0" +procfs = "0.15.1" [target.'cfg(target_os = "macos")'.dependencies] libproc = "0.12.0" diff --git a/crates/nu-system/src/linux.rs b/crates/nu-system/src/linux.rs index 70b3df08f4..c52681b9a3 100644 --- a/crates/nu-system/src/linux.rs +++ b/crates/nu-system/src/linux.rs @@ -190,8 +190,7 @@ impl ProcessInfo { let curr_time = cs.utime + cs.stime; let prev_time = ps.utime + ps.stime; - let usage_ms = - (curr_time - prev_time) * 1000 / procfs::ticks_per_second().unwrap_or(100); + let usage_ms = (curr_time - prev_time) * 1000 / procfs::ticks_per_second(); let interval_ms = self.interval.as_secs() * 1000 + u64::from(self.interval.subsec_millis()); usage_ms as f64 * 100.0 / interval_ms as f64 @@ -206,7 +205,7 @@ impl ProcessInfo { /// Memory size in number of bytes pub fn mem_size(&self) -> u64 { match self.curr_proc.stat() { - Ok(p) => p.rss_bytes().unwrap_or(0), + Ok(p) => p.rss_bytes(), Err(_) => 0, } }