Skip to content
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

It's not working on mac #5

Open
MehdiOrang opened this issue Apr 4, 2021 · 6 comments
Open

It's not working on mac #5

MehdiOrang opened this issue Apr 4, 2021 · 6 comments

Comments

@MehdiOrang
Copy link

MehdiOrang commented Apr 4, 2021

this is the code:

use nixinfo;

fn main() {
    let cpu = nixinfo::hostname();
    println!("cpu: {:?}", cpu);
}

and this is the error. If I'm wrong somewhere let me know

cpu: Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })

@Phate6660
Copy link
Owner

Phate6660 commented Apr 4, 2021

MacOS is a BSD-based OS. I'm still working on adding BSD support.
The reason that errors is because BSDs don't have a /proc.
Well actually it does, it just doesn't have the same stuff as Linux, and you won't really find much useful info in there.
They instead use sysctl for getting system information.

I can work on adding MacOS support as well, however I have absolutely no way of testing it.

@Dazage
Copy link

Dazage commented Apr 4, 2021

I can help with testing on MacOS and BSD.

@Phate6660
Copy link
Owner

Now on to the next step: Finding time to work on it lol.
I'm currently already working on multiple different projects, plus I'll be busy today.
On the bright side though, I had already started adding BSD support here (albeit a month ago): https://github.com/Phate6660/nixinfo/tree/finish_android_start_bsd

@MehdiOrang
Copy link
Author

Maybe I can fork your code and send a pull request in few days..
I thought maybe I missed something, I'll work on it based on your code style ;)

@Phate6660
Copy link
Owner

That would be very much appreciated!

I'll work on it based on your code style ;)

What do you mean?

@tracker1
Copy link

Nice to see this package... I did add a few feature requests... just want to comment that MacOS support would be great to have.

Neofetch does seem to support MacOS output, and detection of M1 series CPU/GPU, which may serve as a point of reference for this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants