Closed chengguangnan closed 7 years ago
by python you meant legacy old python monitor ? It's obsolete now and unison uses it's own monitor written in OCaml (native Unison language). Older python version was using intervals to monitor files and "-repeat watch" uses inotify library. Update your unison then.
I'm using unison 2.50.0 and it's still using fsmonitor.py.
I built it from the git master branch. When I run unison default --repeat watch
there is an error about fsmonitor in the log:
Unison 2.50.0 (ocaml 4.04.1): Contacting server...
Connected [//-> //]
Looking for changes
file File "/usr/local/bin/fsmonitor.py", line 326
except os.error, msg:
^
SyntaxError: invalid syntax
(most recent call last):
File "/usr/local/bin/fsmonitor.py", line 307, in <module>
from FSEvents import *
@alkuzad @bcpierce00 where is this new OCaml monitor?
unison 2.50.0 still uses the old python monitor.
@chengguangnan new: https://github.com/bcpierce00/unison/blob/master/src/fswatch.ml + https://github.com/bcpierce00/unison/tree/master/src/fsmonitor old: https://github.com/bcpierce00/unison/blob/master/src/fswatchold.ml
I use released version not trunk so i can not verify this.
unison version 2.48.3
But I had this error on mac and ubuntu. See error below.
~ ➤ unison default -repeat watch
Contacting server...
Connected [//MacBook-Pro.local//Users/chengguangnan -> //PowerEdge//home/chengguangnan]
Looking for changes
| workspace...abc.htmlTraceback (most recent call last):
File "/usr/local/bin/fsmonitor.py", line 307, in <module>
from FSEvents import *
ImportError: No module named 'FSEvents'
| workspace...abc.html File "/usr/local/bin/fsmonitor.py", line 326
except os.error, msg:
^
SyntaxError: invalid syntax
Waiting for changes from server
Reconciling changes
Nothing to do: replicas have not changed since last sync.
^CTerminated!
Killed by signal 2.
Hi, I tried to use
-repeat watch
but had problems to run it on macOS.First of all,
/usr/bin/python
on macOS is python 2.7, but unison would still picked up~/anaconda3/bin/python
to run the scripts, which is is python 3 and there were syntax errors.Maybe we could somehow integrate http://entrproject.org/ which does fs-montior? It might be more convenient, eg:
echo Documents/path/ | entr -d unison default
echo Documents/path/\nDocuments/path_2/ | entr -d unison default