fsevents
fsevents copied to clipboard
Broken FSEvents for symlink paths on macOS 10.15
Which version of macOS are you using?
ProductName: Mac OS X
ProductVersion: 10.15.1
BuildVersion: 19B88
Please describe the issue that occurred.
FSEvents for symlinks on macOS 10.15 aren't being sent or aren't being captured by fsnotify/fsevents.
Are you able to reproduce the issue? Please provide steps to reproduce and a code sample if possible.
- https://github.com/nonrational/fsevents/pull/1 - PR with
fsevents_test.gomodifications to support testing symlink and non-symlink paths - ❗️ https://circleci.com/gh/nonrational/fsevents/26 - Build Failure on CircleCI macOS 10.15
- ✅ https://travis-ci.org/nonrational/fsevents/jobs/654924846#L140-L143 - Build Success on TravisCI macOS <=10.14
Current tests fail on macOS 10.15 because ioutil.TempDir("", "fsexample") creates a file in /var/tmp/... which is a symlink to /private/var/tmp on macOS. I refactored fsevents_test.go in my fork (where I can run test on 10.15 via CircleCI) to show that the failing scenario is the one involving symlinks.
Workaround
The workaround is to use filepath.EvalSymlinks to get the "real" path then use that real path in the construction of your EventStream.
related: #53