gorakhargosh / watchdog

Python library and shell utilities to monitor filesystem events.

Home Page:http://packages.python.org/watchdog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`watchdog_fsevents.c`: possible to implement a fallback code for < 10.7?

barracuda156 opened this issue · comments

There is an interest from Mac users to have maestral on older systems, I thought to add a port for it, however it requires watchdog, which is presently broken on those systems due to usage of unsupported functionality in watchdog_fsevents.c: https://trac.macports.org/ticket/64584

Is it possible to have a fallback?

What you are asking is a good amount of code for an already complexe beast. Moreover, it would be for a small amount of users.

I won't add compatibility code to FSEvents.

You can stick with a version before 1.0.2 where the support for macOS 10.7 was removed. And even before that, I am not sure it worked for macOS <10.7.

Have a try with older versions, you might have some results.

@BoboTiG Thank you for the reference to a specific version, it is helpful. And yes, I do understand that maintaining a huge amount of code is a burden.

P. S. 1.0.1 still fails on 10.6, but I will try to find the latest that works and see if it passes tests.

@BoboTiG So 0.10.3 installs (after removing one flag unsupported by gcc), and apparently works:

============================= test session starts ==============================
platform darwin -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
rootdir: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-watchdog/py311-watchdog/work/watchdog-0.10.3
configfile: setup.cfg
plugins: flaky-3.7.0
collected 81 items / 3 skipped

tests/test_delayed_queue.py ..                                           [  2%]
tests/test_emitter.py sssssssssssssssssss                                [ 25%]
tests/test_events.py ..........                                          [ 38%]
tests/test_fsevents.py ..                                                [ 40%]
tests/test_logging_event_handler.py .                                    [ 41%]
tests/test_observer.py ........                                          [ 51%]
tests/test_observers_api.py .......                                      [ 60%]
tests/test_observers_polling.py ..                                       [ 62%]
tests/test_pattern_matching_event_handler.py .....                       [ 69%]
tests/test_regex_matching_event_handler.py ......                        [ 76%]
tests/test_skip_repeats_queue.py ....s                                   [ 82%]
tests/test_snapshot_diff.py ............                                 [ 97%]
tests/test_watchmedo.py ..                                               [100%]
===Flaky Test Report===

test_delayed_get passed 1 out of the required 1 times. Success!
test_nondelayed_get passed 1 out of the required 1 times. Success!

===End Flaky Test Report===

======================= 61 passed, 23 skipped in 27.62s ========================