pesos / grofer

A system and resource monitoring tool written in Golang!
Apache License 2.0
352 stars 52 forks source link

[BUG] Building the repo fails on Mac M1 machine #147

Open venkateshatr opened 2 months ago

venkateshatr commented 2 months ago

Describe the bug I am trying to build the project on my Mac M1 laptop using the go build grofer.go. But it is failing to build the package with logs like

github.com/pesos/grofer/pkg/sink/tui/misc

pkg/sink/tui/misc/signals.go:174:23: undefined: syscall.SIGCLD pkg/sink/tui/misc/signals.go:184:23: undefined: syscall.SIGPOLL pkg/sink/tui/misc/signals.go:186:23: undefined: syscall.SIGPWR pkg/sink/tui/misc/signals.go:189:23: undefined: syscall.SIGSTKFLT pkg/sink/tui/misc/signals.go:197:23: undefined: syscall.SIGUNUSED

github.com/shirou/gopsutil/disk

iostat_darwin.c:28:2: warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:143:1: note: 'IOMasterPort' has been explicitly marked deprecated here

github.com/shirou/gopsutil/host

smc_darwin.c:75:41: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here

To Reproduce Steps to reproduce the behavior:

  1. Clone the repo on a Apple Mac book M1/M2 laptop
  2. Goto folder where project is cloned and issue the command go build grofer.go (golang already installed)
  3. Check the logs printed.

Expected behavior Build should succeed.

Screenshots

image

Desktop (please complete the following information):

Additional context Existing binary with AMD64 architecture doesn't run on M1 machines.