Open LordMoMA opened 1 year ago
stream is defined at https://github.com/rjeczalik/notify/blob/8c8ecfea2ebaf5e526db43df4ccb39a9bb7955ff/watcher_fsevents_cgo.go#L117 Make sure you build with cgo and the other expected flags I guess
If I built with CGO_ENABLED=1
, it generates other problems, and the pod could not be spun up
CGO_ENABLED=1 go build -ldflags "-s -w" ./cmd/crypto-tron
CGO_ENABLED=1 go build -ldflags "-s -w" ./cmd/crypto-tron
# github.com/karalabe/hid
In file included from ../../../../.gvm/pkgsets/system/global/pkg/mod/github.com/karalabe/hid@v1.0.0/hid_enabled.go:38:
../../../../.gvm/pkgsets/system/global/pkg/mod/github.com/karalabe/hid@v1.0.0/hidapi/mac/hid.c:693:34: 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/rjeczalik/notify
cgo-gcc-prolog:217:2: warning: 'FSEventStreamScheduleWithRunLoop' is deprecated: first deprecated in macOS 13.0 - Use FSEventStreamSetDispatchQueue instead. [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:1138:1: note: 'FSEventStreamScheduleWithRunLoop' has been explicitly marked deprecated here
I think most of these warnings were fixed in https://github.com/rjeczalik/notify/pull/215 make sure you using the latest code Anyway, I don't see why deprecation warnings failed the build , you sure that's the whole relevant output?
problem solved by upgrading to the latest version and set CGO_ENABLED=0
, why we don't need CGO here?
If you build without cgo you'd actually be using kqueue and not fsevents.
fsevents condition is //go:build darwin && !kqueue && cgo
kqueue condition is //go:build (darwin && kqueue) || (darwin && !cgo) || ...
kqueue might very well suit your needs, depending on your usage of this library.
thank you for the knowledge here ❤️
On Linux Ubuntu, it does not have the below problem, but OS M2 has: