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

FSEventStreamCreate is not available at ios #223

Open
anatol opened this issue Aug 3, 2023 · 5 comments
Open

FSEventStreamCreate is not available at ios #223

anatol opened this issue Aug 3, 2023 · 5 comments

Comments

@anatol
Copy link

anatol commented Aug 3, 2023

I am trying to compile the package with gomobile for ios platform

gomobile init
gomobile bind -target=ios,iossimulator -x -o My.xcframework

And I get following error, probably because following API is not available at iOS.

<path>/watcher_fsevents_cgo.go:172:9: could not determine kind of name for C.EventStreamCreate
<path>/watcher_fsevents_cgo.go:171:9: could not determine kind of name for C.FSEventStreamContext
<path>/watcher_fsevents_cgo.go:40:12: could not determine kind of name for C.FSEventStreamCreateFlags
<path>/watcher_fsevents_cgo.go:87:27: could not determine kind of name for C.FSEventStreamEventFlags
<path>/watcher_fsevents_cgo.go:88:27: could not determine kind of name for C.FSEventStreamEventId
<path>/watcher_fsevents_cgo.go:178:3: could not determine kind of name for C.FSEventStreamInvalidate
<path>/watcher_fsevents_cgo.go:35:15: could not determine kind of name for C.FSEventStreamRef
<path>/watcher_fsevents_cgo.go:176:2: could not determine kind of name for C.FSEventStreamScheduleWithRunLoop
<path>/watcher_fsevents_cgo.go:177:5: could not determine kind of name for C.FSEventStreamStart
<path>/watcher_fsevents_cgo.go:192:2: could not determine kind of name for C.FSEventStreamStop
<path>/watcher_fsevents_cgo.go:41:19: could not determine kind of name for C.FSEventsGetCurrentEventId
<path>/watcher_fsevents_cgo.go:40:39: could not determine kind of name for C.kFSEventStreamCreateFlagFileEvents
<path>/watcher_fsevents_cgo.go:40:78: could not determine kind of name for C.kFSEventStreamCreateFlagNoDefer
cgo: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang errors for preamble:
<path>/watcher_fsevents_cgo.go:17:8: error: unknown type name 'FSEventStreamRef'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
       ^
<path>/watcher_fsevents_cgo.go:17:43: error: unknown type name 'FSEventStreamContext'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
                                          ^
<path>/watcher_fsevents_cgo.go:17:109: error: unknown type name 'FSEventStreamEventId'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
                                                                                                            ^
<path>/watcher_fsevents_cgo.go:17:161: error: unknown type name 'FSEventStreamCreateFlags'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
                                                                                                                                                                ^
<path>/watcher_fsevents_cgo.go:19:9: error: call to undeclared function 'FSEventStreamCreate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
               ^
<path>/watcher_fsevents_cgo.go:19:9: note: did you mean 'EventStreamCreate'?
<path>/watcher_fsevents_cgo.go:17:25: note: 'EventStreamCreate' declared here
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
                        ^
<path>/watcher_fsevents_cgo.go:19:36: error: use of undeclared identifier 'FSEventStreamCallback'; did you mean 'FSEventStreamCreate'?
        return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
                                          ^~~~~~~~~~~~~~~~~~~~~
                                          FSEventStreamCreate
<path>/watcher_fsevents_cgo.go:19:9: note: 'FSEventStreamCreate' declared here
        return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
               ^
<path>/watcher_fsevents_cgo.go:19:59: error: expected ')'
        return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
                                                                 ^
<path>/watcher_fsevents_cgo.go:19:28: note: to match this '('
        return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
                                  ^
7 errors generated.
@ReallyLiri
Copy link

FSEvents is not supported natively on iOS AFAIK, kqueue should work though.

@anatol
Copy link
Author

anatol commented Aug 3, 2023

Could notify be updated for that?

@ReallyLiri
Copy link

its not up to notify, its not supported by iOS. but kqueue as the notifier should work fine

@anatol
Copy link
Author

anatol commented Aug 3, 2023

Sure, could the build constrains be updated accordingly to avoid enabling fsevents on a platform that does not support it?

@patryk4815
Copy link

@ReallyLiri ios can disable with build target.
//go:build !ios

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

3 participants