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

v. 1.18.0: build error: 'kFSEventStreamCreateFlagFileEvents' was not declared in this scope #335

Closed
barracuda156 opened this issue Jan 25, 2025 · 10 comments · Fixed by #336
Assignees

Comments

@barracuda156
Copy link

--->  Building fswatch
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0" && /usr/bin/make -j6 -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0'
Making all in libfswatch
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0/libfswatch'
/usr/bin/make  all-recursive
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0/libfswatch'
Making all in src
make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0/libfswatch/src'
  CXX      libfswatch/c++/string/string_utils.lo
  CXX      libfswatch/c/cevent.lo
  CXX      libfswatch/c++/libfswatch_exception.lo
  CXX      libfswatch/c/libfswatch_log.lo
  CXX      libfswatch/c/libfswatch.lo
  CXX      libfswatch/c++/event.lo
  CXX      libfswatch/c++/filter.lo
  CXX      libfswatch/c++/monitor.lo
  CXX      libfswatch/c++/monitor_factory.lo
  CXX      libfswatch/c++/poll_monitor.lo
  CXX      libfswatch/c++/path_utils.lo
  CXX      libfswatch/c++/fsevents_monitor.lo
libfswatch/c++/fsevents_monitor.cpp: In member function 'void fsw::fsevents_monitor::create_stream(CFArrayRef)':
libfswatch/c++/fsevents_monitor.cpp:239:44: error: 'kFSEventStreamCreateFlagFileEvents' was not declared in this scope; did you mean 'kFSEventStreamCreateFlagNoDefer'?
  239 |     FSEventStreamCreateFlags streamFlags = kFSEventStreamCreateFlagFileEvents;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                            kFSEventStreamCreateFlagNoDefer
  CXX      libfswatch/c++/kqueue_monitor.lo
make[3]: *** [libfswatch/c++/fsevents_monitor.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0/libfswatch/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0/libfswatch'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_fswatch/fswatch/work/fswatch-1.18.0/libfswatch'
make: *** [all-recursive] Error 1

@emcrisostomo Could you please take a look? kFSEventStreamCreateFlagFileEvents only exists in 10.7+:
https://developer.apple.com/documentation/coreservices/1455376-fseventstreamcreateflags/kfseventstreamcreateflagfileevents

Also: https://trac.macports.org/ticket/71935

@emcrisostomo
Copy link
Owner

I surely will

@emcrisostomo
Copy link
Owner

Hey, I don't have a system < 10.7, and at first look the configure macros should take that into account. Could you attach the output of ./configure?

@barracuda156
Copy link
Author

I am away from my PowerMac until tomorrow, but the build fails with the same error on buildbots: https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/226218/steps/install-port/logs/stdio
I don’t see how configure can handle this, since the function is used unconditionally (unlike a few other in the same source file).

@emcrisostomo
Copy link
Owner

emcrisostomo commented Jan 25, 2025 via email

@barracuda156
Copy link
Author

@emcrisostomo fsevents are supported back to 10.5, I think, and the code here seems to assume that at least partly it was building (and working?) on Leopard (otherwise why macros for it).
Disabling altogether is still an option, or course, but likely a better one is to support fsevents to an extent possible (given SDK constraints).

@emcrisostomo
Copy link
Owner

In reality this is not a regression: even though macros that detect macOS version back to when FSEvents were introduced in configure.ac, the code of fsevents_monitor class has been such since almost a decade. I will look into retrofitting it back to 10.5.

@emcrisostomo
Copy link
Owner

@barracuda156 , I've pushed a branch with the required changes. I've tested both code paths on macOS-current, but I'm unable to test it on 10.5. Would you help me here? The branch is associated with this issue. I'm attaching a release tarball to make it easier for you to test it out if you're willing.

fswatch-1.19.0-develop.tar.gz

@barracuda156
Copy link
Author

@emcrisostomo Thank you! The build from e2e4a92 worked fine on 10.6 (where it failed before). I do not have a working set-up on earlier systems though.

@emcrisostomo
Copy link
Owner

Thank you very much! 10.6 is good enough I guess. I'll merge it shortly. Could you try the basic functionality of the binary as well?

@emcrisostomo emcrisostomo self-assigned this Jan 27, 2025
@emcrisostomo emcrisostomo changed the title 1.18.0 build error: 'kFSEventStreamCreateFlagFileEvents' was not declared in this scope v. 1.18.0: build error: 'kFSEventStreamCreateFlagFileEvents' was not declared in this scope Jan 27, 2025
@barracuda156
Copy link
Author

Thank you. I will try how it works soon.

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