hegemon icon indicating copy to clipboard operation
hegemon copied to clipboard

macOS support

Open p-e-w opened this issue 7 years ago • 5 comments

p-e-w avatar Sep 30 '18 14:09 p-e-w

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 avatar Dec 01 '18 20:12 hawkins

@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.

p-e-w avatar Dec 08 '18 07:12 p-e-w

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.

hawkins avatar Dec 08 '18 14:12 hawkins

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

fenollp avatar May 28 '19 12:05 fenollp

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

hawkins avatar Oct 29 '19 12:10 hawkins