skycoin / skywire

Skywire Node implementation
73 stars 45 forks source link

Make build not working on apple silicon #1828

Closed ersonp closed 3 weeks ago

ersonp commented 4 weeks ago

Describe the bug The make command make build gives error on Apple silicon.

Environment information:

Steps to Reproduce Steps to reproduce the behavior:

  1. Run make build

Actual behavior

rm -rf ./build ./local
GO111MODULE=on go build "-ldflags=-X github.com/skycoin/skywire-utilities/pkg/buildinfo.version=v1.3.21-12-g5ebb1e715 -X github.com/skycoin/skywire-utilities/pkg/buildinfo.date=2024-06-05T09:49:22Z -X github.com/skycoin/skywire-utilities/pkg/buildinfo.commit=5ebb1e715245f0ed9e8c8bf9ef3849fd104b0c19 -X github.com/skycoin/skywire/pkg/visor.BuildTag=Darwin" -mod=vendor  -o ./build/skywire ./cmd/skywire
# 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/MacOSX14.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:143:1: note: 'IOMasterPort' has been explicitly marked deprecated here
# github.com/anatol/smart.go
nvme_darwin.cpp:35:54: 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
nvme_darwin.cpp:36:50: 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
# github.com/shirou/gopsutil/cpu
vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go:13:5: error: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
   13 | #if TARGET_OS_MAC
      |     ^
1 error generated.
make: *** [build-merged] Error 1
mrpalide commented 4 weeks ago

I check it again. Errors occurs and related to gopsutil lib we used there, but build done there and work well. Error related to gotop lib that use old version of gopsutil lib there. I trying to make my fork of it and update gopsutil, but not work again and get same error. So I just create a ticket (as bug) on gopsutil repo. https://github.com/shirou/gopsutil/issues/1664