-
Notifications
You must be signed in to change notification settings - Fork 13.3k
port / wrap / package psutil for rust #6808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can take this on. psutil is a nice library but deeply integrated with python. I think it'd be worth separating the important platform bits into their own library which is wrapped by rust. |
So psutil is entirely unsuitable as a library. It is deeply tied into Python and only exports Python data structures. Its organization is unideal for direct adaptation to standalone usage. But there is libstatgrab which is a much better option. It is, however, LGPL. I've contacted the authors to see if it could be relicensed or an exception made. |
I meant the platform specific parts for reading the info, not the parts that form python values. |
The platform specific parts only feed into python values, there's no separation or cross-platform non-python data structures or anything |
Status: investigated libstatgrab as an alternative, but it is LGPL which is unsuitable for inclusion into the standard library. Seems there are no other good libraries, so writing one would be necessary. I'll get to it... eventually, probably after rustdoc, but if someone else wants to do it before that's fine. It'd be best to write a liberally-licensed, robust cross-platform C library that does this, to benefit everyone, and write a Rust wrapper on top. |
(bug triage) Still would be nice, not a milestone blocker. |
I'd like to give this a shot. It seems like something small enough for me to work on as well as to contribute something useful. My plan is to first write a little non copyleft C library that does the same work as the one in psutil but without the Python bindings. I'll make it work fine as a C library. After that, I'll write a rust wrapper for this. I do my work on Debian so I'll make the Linux version first as a proof of concept and work from there. Does this sound like a proper plan? |
@nibrahim that'd be great! |
Well, I'll give it a shot. Gotta start somewhere. :) |
I got tied up but have made some small progress in writing the C parts. If someone has the time to look and offer comments, I'd value them. My C is far from production quality - https://github.com/nibrahim/cpslib |
Triage bump. |
I think this is not suitable for in-tree. Somebody should build this in Cargo. |
Can you elaborate a little? What do you mean by build this in cargo? |
…FN_with_large_array, r=Manishearth Fix FN in `iter_cloned_collect` with a large array fixes rust-lang#6808 changelog: Fix FN in `iter_cloned_collect` with a large array I spotted that [is_iterable_array](https://github.com/rust-lang/rust-clippy/blob/a362a4d1d0edb66aef186c1d27b28c60573078f4/clippy_lints/src/loops/explicit_iter_loop.rs#L67-L75) function that `explicit_iter_loop` lint is using only works for array sizes <= 32. There is this comment: > IntoIterator is currently only implemented for array sizes <= 32 in rustc I'm a bit confused, because I read that [IntoIterator for arrays](https://doc.rust-lang.org/src/core/array/mod.rs.html#194-201) with const generic `N` is stable since = "1.0.0". Although Const Generics MVP were stabilized in Rust 1.51. Should I set MSRV for the current change? I will try to test with older compilers soon.
https://code.google.com/p/psutil/ is a very tidy collection of generic operating system and process monitoring interfaces, with supporting C code for all our tier-1 platforms. I would very much like to see this ported or exposed-and-wrapped in
std::os
.The text was updated successfully, but these errors were encountered: