p-e-w / hegemon

A modular system monitor written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

macOS support

p-e-w opened this issue · comments

I’m a rust rookie but am looking to dive more into it and all of my development is on a Mac these days, so I’m interested to help out here. Could you help me understand what work at a high level needs to be done for this effort?

@hawkins Thank you for your interest! There are two things that need to be done here:

  1. Allow Hegemon to build without libsensors (#16). I am already working on this.
  2. Improve macOS support in systemstat. This is the main task. systemstat does have macOS platform code but currently, most of the functions are placeholders. Working macOS code can be found in the sysinfo crate, but keep in mind that sysinfo is MIT-licensed while systemstat aims to be public domain. I have studied both of these crates in detail and while sysinfo's cross-platform support is more mature, I found systemstat to have the better overall design, and its API to be a much better match for Hegemon's requirements.

Thanks so much for the detailed response! 😄 I'll start studying the two libraries as well to see if I can help out in supporting macOS under systemstat on the assumption that we'll figure out licensing issues.

FYI this is what a cargo install hegemon does today

error[E0609]: no field `meminfo` on type `systemstat::PlatformMemory`
  --> /Users/pete/.cargo/registry/src/github.com-1ecc6299db9ec823/hegemon-0.1.0/src/providers/memory.rs:50:50
   |
50 |             let meminfo = memory.platform_memory.meminfo;
   |                                                  ^^^^^^^ unknown field
   |
   = note: available fields are: `active`, `inactive`, `wired`, `cache`, `free`

error[E0609]: no field `meminfo` on type `systemstat::PlatformMemory`
  --> /Users/pete/.cargo/registry/src/github.com-1ecc6299db9ec823/hegemon-0.1.0/src/providers/memory.rs:57:66
   |
57 |                             let meminfo = memory.platform_memory.meminfo;
   |                                                                  ^^^^^^^ unknown field
   |
   = note: available fields are: `active`, `inactive`, `wired`, `cache`, `free`
Darwin baobao 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64 i386 MacBookPro14,1 Darwin

I wasn't able to get anywhere with this last year (obviously and unfortunately 🙁 ), but I heard about this heim library today that I thought sounded interesting for this project. Maybe it's relevant? https://github.com/heim-rs/heim/blob/master/COMPARISON.md