Macchina-CLI / macchina

A system information frontend with an emphasis on performance.
https://crates.io/crates/macchina
MIT License
1.49k stars 52 forks source link

refactor: theme handling #241

Closed grtcdr closed 2 years ago

grtcdr commented 2 years ago

@uttarayan21 Looks like we're getting some errors on Android, ever since I bumped [if-addrs] to version 0.7.0).

Any clue why this might be happening? The crate's maintainer actually published this new version which should've fixed whatever issues occurring on Android. I'm going over the source to try and make sense of what's happening.

EDIT: The commit actually cleaned up what was some C headers they linked against, and they now make use of libc directly. It's a good call, but it's where the issues are stemming from:

use libc::{freeifaddrs, getifaddrs, ifaddrs};
uttarayan21 commented 2 years ago

Since the issue seems to be fixed I guess I don't need to look into it anymore.

Also currently this PR doesn't give an error when no theme is found / invalid theme name is used.

grtcdr commented 2 years ago

Since the issue seems to be fixed I guess I don't need to look into it anymore.

Well no, the issue only appeared after the supposed fix for Android.

Also currently this PR doesn't give an error when no theme is found / invalid theme name is used.

I haven't rebased this branch yet.

uttarayan21 commented 2 years ago

I just skimmed the error messages. Seems like the issue is originating from here

/cargo/registry/src/github.com-1ecc6299db9ec823/if-addrs-0.7.0/src/posix.rs:43: undefined reference to `getifaddrs'

Currently I think it might be due to linking against mismatching android libraries ( target sdk version ).

grtcdr commented 2 years ago

Could you check it out?

uttarayan21 commented 2 years ago

Sure. I'll take a look at it. If we can't fix it we can just rollback the version too right ?

grtcdr commented 2 years ago

Yep, of course.