Dr-Noob / cpufetch

Simple yet fancy CPU architecture fetching tool
GNU General Public License v2.0
1.83k stars 100 forks source link

Error: Found invalid cpu_family: 0x00000000 (macOS 13 arm64) #163

Closed p-linnane closed 1 year ago

p-linnane commented 1 year ago

Hello. I am a maintainer for Homebrew project. While attempting to package cpufetch for the arm64 version of macOS Ventura, we are encountering a test failure.

==> Testing cpufetch
  ==> /opt/homebrew/Cellar/cpufetch/1.02/bin/cpufetch -d
  [ERROR]: Found invalid cpu_family: 0x00000000
  Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues

The full GitHub Actions run can be found here. This job was run on a 2020 Mac mini with an M1 chip.

Dr-Noob commented 1 year ago

I don't know how you built the binary, but that error probably means that the build process was not run on an ARM Apple chip. Please note that the program will only work for ARM/Apple if it was built in such an environment.

If you believe it was built inside the right environment, I suggest downloading and compiling manually, like in the README. If you build it following those instructions and you encounter the same problem, then it is a problem of cpufetch itself and I should investigate further - otherwise is a problem with your setup.

p-linnane commented 1 year ago

The job was run on a macOS Ventura VM running on a 2020 Mac mini with an M1 chip. The program builds fine, we are just running make as described in the README. FWIW, this is only happening on the arm64 version of macOS Ventura. We have no issues on 2 other arm64 and 4 other Intel versions of macOS.

Dr-Noob commented 1 year ago

cpufetch uses sysctlbyname to query cpu_family in ARM/macOS, which is the function failing in this case. It is not clear what is the problem - whether it's because of the latest macOS version or because it is running in a VM (VMs typically affect this kind of function) in the latest macOS version.

I would suggest copying the generated executable to a non-vm macOS Ventura and checking if it still fails.

p-linnane commented 1 year ago

I can confirm building locally on my machine returned the expected results. I will need to do some more research into why that particular version of macOS is having issues when virtualized. Thank you.

Dr-Noob commented 1 year ago

Thanks.

If you find something relevant I would appreciate it if you could post it here so I can warn future users about that to avoid confusion.