guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 246 forks source link

OS X < 10.9 not supported by rb-fsevent without recompile #369

Closed vaz closed 8 years ago

vaz commented 8 years ago

So I wanted to point out, after spending some time today being frustrated...

Since v0.9.6, rb-fsevent doesn't support OS X < 10.9 any longer with its precompiled binary. But Listen will try to use it anyway, and the resulting behaviour is that it just doesn't work: no fs changes detected, and none of the typical issues showing up in debug logs, just nothing.

As I found in rb-fsevent's readme, you can go into the gem's directory and recompile the binary (MACOSX_DEPLOYMENT_TARGET="10.7" rake replace_exe) but that's more pain than it's worth if you're using bundler. The other alternative is to use rb-fsevent 0.9.4 (which is what I'm doing now, and it works fine).

I guess I need to admit it's time to upgrade my OS, but in any case this behaviour (silently not picking up on any changes at all) is pretty difficult to debug and I wonder if there's an easy way for Listen to automatically work around it for other users in this situation.

Even if it was falling back to polling for < 10.9 with an informative message in the debug log I think it would be a great improvement as it would point users in the right direction if they want to get the adapter working.

I did add this to the troubleshooting readme for now.

e2 commented 8 years ago

I don't use OSX at all (I'm Linux-only), so I have no idea what issues people have - unless they're being reported.

I believe rb-fsevent should detect if you're using an outdated OS without the right compilation flags.

I can do this in Listen, but I don't even know how to detect the MacOSX version from Ruby to begin with.

Even if you have a bit of code that can detect the issue and fail with an error - that would be helpful.

vaz commented 8 years ago

No problem... I didn't really have time to dig into it before but I wanted to report in case it helped someone searching with the same issue at least.

I was debating whether to report this on rb-fsevent or here but in their readme they're clear about what versions of OS X they support now... it just took me a while to trace the issue from Guard to Listen to the adapter since there was no message. Anyway I figured a general solution for Listen to discover if an adapter is just plain not working and fall back would be nice if it could be worked out. I'll play around with it and see if I can come up with something that catches this automatically and report back.

e2 commented 8 years ago

@vaz - sure, thanks.

My "priority" is to help people so they avoid headaches. E.g. it would be ok to detect an old OSX version and just switch to polling (after showing a warning).

Listen is pretty much "middleware", so it shouldn't really "interact" by showing any output. Unless there's an error, of course.

vaz commented 8 years ago

Right, in terms of showing a warning I was just thinking of the debug log (LISTEN_GEM_DEBUGGING), which would go well with an automatic fallback to polling.

vaz commented 8 years ago

Check out PR: https://github.com/guard/listen/pull/370

e2 commented 8 years ago

Released as v3.1.0

So the problem is now forever solved.

Thanks!