created_at stringlengths 20 20 | test_patch stringlengths 226 26.3k | issue_numbers sequencelengths 1 1 | instance_id stringlengths 26 28 | repo stringclasses 1
value | patch stringlengths 441 162k | base_commit stringlengths 40 40 | problem_statement stringlengths 24 3.57k | version stringlengths 3 4 | pull_number int64 51 1.41k | hints_text stringlengths 0 9.55k | environment_setup_commit stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2021-01-05T21:40:46Z | diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -57,7 +57,7 @@ jobs:
- { os: 'ubuntu-latest', target: 'arm-unknown-linux-gnueabihf', cross: true }
- { os: 'ubuntu-latest', target: 'arm-unknown-linux-musleabihf', cro... | [
"187"
] | GuillaumeGomez__sysinfo-385 | GuillaumeGomez/sysinfo | diff --git a/src/linux/system.rs b/src/linux/system.rs
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -503,6 +503,14 @@ impl SystemExt for System {
fn get_users(&self) -> &[User] {
&self.users
}
+
+ fn get_name(&self) -> Option<String> {
+ get_system_info("NAME=")
+ }
+
+ fn g... | 5341d2e5229a5d81a6acf1bb1f0d43bb15d8e48c | Add system version and/or OS name
| 0.15 | 385 | The [`whoami` crate](https://crates.io/crates/whoami) has been really useful for this. It offers:
* `whoami::platform()` - a serialisable enum for platform, such as `Linux`, `MacOS`, `Windows `, etc
* `whoami::os()` - a string representation of the OS version, such as `Mac OS X 10.15.3 19D76`
I tend to prefer imple... | 8c2b5a0583404120f1a910d9af32f40fd1dd9d08 |
2020-12-27T22:17:38Z | diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -101,7 +101,13 @@ jobs:
toolchain: ${{ matrix.toolchain }}
override: true
- - name: Execute tests
+ - name: Execute tests (not mac)
run: cargo test... | [
"375"
] | GuillaumeGomez__sysinfo-377 | GuillaumeGomez/sysinfo | diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,7 @@ build = "build.rs"
[dependencies]
cfg-if = "0.1"
-rayon = "^1.0"
+rayon = "^1.5"
doc-comment = "0.3"
once_cell = "1.0"
diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,6 +25,12 @@ ntapi = "0.3"
... | 2a2e91cf8cd9319b1dbaa8fb3af889743a06519c | get_disks() doesn't return all mounted disks on Mac OS
I've just started learning Rust. I'm on a 2013 MacBook Air running macOS Sierra and rustc 1.48.0
I modified the sysinfo example to just print out the disks in the system. My boot disk is an external USB 3.0 SSD. (The internal SSD has been missing since I got the... | 0.15 | 377 | That's intriguing. I'll need to check what's going there.
> That's intriguing. I'll need to check what's going there.
Thanks Guillaume. I updated the report by fixing a problem in the code that was mixing 0.3 and 0.15 versions of the example code and tested under Windows 10, which has a different problem.
In utils.r... | 8c2b5a0583404120f1a910d9af32f40fd1dd9d08 |
2020-10-02T14:52:22Z | diff --git a/tests/process.rs b/tests/process.rs
--- a/tests/process.rs
+++ b/tests/process.rs
@@ -104,3 +104,25 @@ fn test_process_disk_usage() {
p.disk_usage().written_bytes
);
}
+
+#[test]
+fn cpu_usage_is_not_nan() {
+ let mut system = sysinfo::System::new();
+ system.refresh_processes();
+
+ ... | [
"366"
] | GuillaumeGomez__sysinfo-367 | GuillaumeGomez/sysinfo | diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.15.2"
+version = "0.15.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, processors, disks, components and... | f57031a38b0d527958a58605682c52e262f3f017 | Process cpu_usage() returns NaN in some cases
Hello,
I'm using `sysinfo` on version `0.15.2` on Linux mint 19.
`cargo -V` outputs `cargo 1.46.0 (149022b1d 2020-07-17)`.
`rustc -V` outputs `rustc 1.46.0 (04488afe3 2020-08-24)`.
When `system.refresh_process(pid)` is called too often, the cpu_usage() of this process... | 0.15 | 367 | This is indeed where the bug is coming from. However, I'm not too aware on how to compare floats and check if they're equal. If you have any directions, it'd be awesome! (You can also send a PR if you want to go faster :wink: ).
I appreciate the quick reply :)
there are some crates that handle this, like [float_cmp](... | 8c2b5a0583404120f1a910d9af32f40fd1dd9d08 |
2020-06-01T11:28:42Z | diff --git a/src/sysinfo.rs b/src/sysinfo.rs
--- a/src/sysinfo.rs
+++ b/src/sysinfo.rs
@@ -92,7 +92,7 @@ cfg_if! {
#[cfg(test)]
const MIN_USERS: usize = 1;
- } else if #[cfg(unix)] {
+ } else if #[cfg(any(target_os = "linux", target_os = "android"))] {
mod linux;
use linux as... | [
"319"
] | GuillaumeGomez__sysinfo-322 | GuillaumeGomez/sysinfo | diff --git a/src/sysinfo.rs b/src/sysinfo.rs
--- a/src/sysinfo.rs
+++ b/src/sysinfo.rs
@@ -151,7 +151,7 @@ mod utils;
/// let s = System::new_all();
/// ```
pub fn set_open_files_limit(mut _new_limit: isize) -> bool {
- #[cfg(all(not(target_os = "macos"), unix))]
+ #[cfg(any(target_os = "linux", target_os = "a... | 98fb1e1d4fc5187b9701464ebd6674245879bea0 | Fails on FreeBSD: cannot find value `CLOCK_BOOTTIME` in crate `libc`
```
error[E0425]: cannot find value `CLOCK_BOOTTIME` in crate `libc`
--> /wrkdirs/usr/ports/shells/starship/work/starship-0.41.3/cargo-crates/sysinfo-0.14.2/src/linux/system.rs:121:43
|
121 | if unsafe { libc::clock_gettime(libc::CLOCK_... | 0.14 | 322 | I'm surprised that FreeBSD is considered as a unix target... I'm sorry but I have no machine with a FreeBSD installed. So I have two leads to solve this issue:
1. Understand which condition failed, allowing FreeBSD to use unix code.
2. Fix the code directly by using the matching constant on FreeBSD.
Practically e... | 98fb1e1d4fc5187b9701464ebd6674245879bea0 |
2020-04-15T13:12:29Z | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -148,3 +72,156 @@ impl DiskExt for Disk {
}
}
}
+
+fn new_disk(name: &OsStr, mount_point: &Path, file_system: &[u8]) -> Disk {
+ let mount_point_cpath = utils::to_cpath(mount_point);
+ let type_ = ... | [
"300"
] | GuillaumeGomez__sysinfo-302 | GuillaumeGomez/sysinfo | diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.13.2"
+version = "0.13.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, processors, disks, components and... | a6228731cb3464cfc72c3475b2ab0e10448262a0 | test_disks fail in Fedora buildsystem
```rust
---- test_disks stdout ----
thread 'test_disks' panicked at 'assertion failed: s.get_disks().len() > 0', tests/disk_list.rs:14:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
test_disks
test result: FAILED. 0 passed; 1 fai... | 0.13 | 302 | You didn't have this issue before I assume?
On 0.12.0 no, but now I upgraded to 0.13.2 and have it :)
I suspect #297, which is weird considering that it was supposed to handle more disk kinds... Can you show what your `/proc/mounts` file contains please?
```
tmpfs /proc tmpfs rw,seclabel,relatime 0 0
proc /proc proc ... | a6228731cb3464cfc72c3475b2ab0e10448262a0 |
2020-03-19T10:58:00Z | diff --git a/src/sysinfo.rs b/src/sysinfo.rs
--- a/src/sysinfo.rs
+++ b/src/sysinfo.rs
@@ -316,3 +316,18 @@ mod test {
assert!(s.get_users().len() >= MIN_USERS);
}
}
+
+// Used to check that System is Send and Sync.
+#[cfg(doctest)]
+doc_comment!(
+ "
+```
+fn is_send<T: Send>() {}
+is_send::<sysinfo:... | [
"282"
] | GuillaumeGomez__sysinfo-283 | GuillaumeGomez/sysinfo | diff --git a/src/unknown/component.rs b/src/unknown/component.rs
--- a/src/unknown/component.rs
+++ b/src/unknown/component.rs
@@ -26,6 +26,5 @@ impl ComponentExt for Component {
""
}
- fn refresh(&mut self) {
- }
+ fn refresh(&mut self) {}
}
diff --git a/src/unknown/system.rs b/src/unknown/sy... | 90049ce2c712284ee93379e4e5f9c03da41b9ee2 | `System` implements `Send` on Linux, but not on Windows
As the title says, the `System` struct implements `Send` on Linux, but not on Windows.
Take a look at the implemented traits:
https://docs.rs/sysinfo/0.11.7/x86_64-pc-windows-msvc/sysinfo/struct.System.html
https://docs.rs/sysinfo/0.11.7/sysinfo/struct.Sy... | 0.11 | 283 | It shouldn't implement `Send` on any platform. Sending a PR. | 90049ce2c712284ee93379e4e5f9c03da41b9ee2 |
2020-02-10T21:08:36Z | diff --git a/tests/process.rs b/tests/process.rs
--- a/tests/process.rs
+++ b/tests/process.rs
@@ -6,12 +6,12 @@
extern crate sysinfo;
+#[cfg(not(windows))]
+use sysinfo::ProcessExt;
+use sysinfo::SystemExt;
+
#[test]
fn test_process() {
- #[cfg(not(windows))]
- use sysinfo::ProcessExt;
- use sysinfo::S... | [
"261"
] | GuillaumeGomez__sysinfo-262 | GuillaumeGomez/sysinfo | diff --git a/src/traits.rs b/src/traits.rs
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -538,7 +538,7 @@ pub trait SystemExt: Sized {
fn refresh_processes(&mut self);
/// Refresh *only* the process corresponding to `pid`. Returns `false` if the process doesn't
- /// exist or isn't listed.
+ /// exist. I... | d7bfc1e62c91c5f34e9e444bb083fa67716f3051 | Different behavior on window for refresh_process
Hi,
I have a use case where I just ran a new child process, and then I call system.refresh_process(pid), and try to get the process info.
Things work fine on linux and mac, however on windows, the process is not found.
I suspect windows does not add a new proces... | 0.11 | 262 | Great catch and thanks for the precise report! I'll check what's going on. | 90049ce2c712284ee93379e4e5f9c03da41b9ee2 |
2020-01-26T22:19:43Z | "diff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -15,7 +15,7 @@ Support the(...TRUNCATED) | [
"215"
] | GuillaumeGomez__sysinfo-245 | GuillaumeGomez/sysinfo | "diff --git a/Cargo.toml b/Cargo.toml\n--- a/Cargo.toml\n+++ b/Cargo.toml\n@@ -16,17 +16,15 @@ build(...TRUNCATED) | 4ae1791d21f84f911ca8a77e3ebc19996b7de808 | "Feature Request: support retrieve CPU number and load info\nThanks for providing the awesome librar(...TRUNCATED) | 0.10 | 245 | "Ah indeed. I'll check if it's available as well on windows and OSX, otherwise I'll have a bit more (...TRUNCATED) | 4ae1791d21f84f911ca8a77e3ebc19996b7de808 |
2019-06-24T15:31:47Z | "diff --git a/src/system.rs b/src/system.rs\n--- a/src/system.rs\n+++ b/src/system.rs\n@@ -25,14 +25(...TRUNCATED) | [
"182"
] | GuillaumeGomez__sysinfo-183 | GuillaumeGomez/sysinfo | "diff --git a/Cargo.toml b/Cargo.toml\n--- a/Cargo.toml\n+++ b/Cargo.toml\n@@ -1,6 +1,6 @@\n [packag(...TRUNCATED) | 5744eb9221c99229f38375d776ee681032ca4f86 | Make get_current_pid() return Result to prevent panic on unknown platform
| 0.8 | 183 | 5744eb9221c99229f38375d776ee681032ca4f86 | |
2019-06-22T11:19:14Z | "diff --git a/src/sysinfo.rs b/src/sysinfo.rs\n--- a/src/sysinfo.rs\n+++ b/src/sysinfo.rs\n@@ -54,7 (...TRUNCATED) | [
"76"
] | GuillaumeGomez__sysinfo-178 | GuillaumeGomez/sysinfo | "diff --git a/.travis.yml b/.travis.yml\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -55,7 +55,7 @@ scr(...TRUNCATED) | bf0691f89ac36af1418a522591cc012ce584d0aa | "`sysinfo::System::new()` slow?\nA simple program creating a `sysinfo::System` takes several times l(...TRUNCATED) | 0.8 | 178 | "Even more than reasonable: it sounds great! I'll gladly accept any patch improving the speed of thi(...TRUNCATED) | 5744eb9221c99229f38375d776ee681032ca4f86 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 5