Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined: stream - Issue with Mac OS M2 #222

Open
LordMoMA opened this issue Jul 19, 2023 · 6 comments
Open

undefined: stream - Issue with Mac OS M2 #222

LordMoMA opened this issue Jul 19, 2023 · 6 comments

Comments

@LordMoMA
Copy link

On Linux Ubuntu, it does not have the below problem, but OS M2 has:

# github.com/rjeczalik/notify
../../../pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents.go:49:11: undefined: stream
../../../pkg/mod/github.com/rjeczalik/[email protected]/watcher_fsevents.go:200:13: undefined: newStream
@LordMoMA LordMoMA changed the title Issue with Mac OS M2 undefined: stream - Issue with Mac OS M2 Jul 19, 2023
@ReallyLiri
Copy link

stream is defined at

type stream struct {

Make sure you build with cgo and the other expected flags I guess

@LordMoMA
Copy link
Author

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/[email protected]/hid_enabled.go:38:
../../../../.gvm/pkgsets/system/global/pkg/mod/github.com/karalabe/[email protected]/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

@ReallyLiri
Copy link

I think most of these warnings were fixed in #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?

@LordMoMA
Copy link
Author

problem solved by upgrading to the latest version and set CGO_ENABLED=0, why we don't need CGO here?

@ReallyLiri
Copy link

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.

@LordMoMA
Copy link
Author

thank you for the knowledge here ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants