Tilt on MacOS can't watch files for resources with 4097+ deps
As reported by @theothertomelliott: filewatching on MacOS fails silently when a resource has 4097+ deps. See repro case - after initial tilt up, Tilt doesn't detect any file changes. (However, the max-dependencies limitation is per-resource, not cumulative - see example.)
We filed a bug against fsnotify: https://github.com/fsnotify/fsevents/issues/48
However, this might even be an underlying issue with fsevents itself.
If enough users run into this issue, we could conceivably fix it on the Tilt side without waiting for a resolution from fsevents, so if this is giving you trouble, drop a comment here.
oh, probably related to: https://github.com/fsnotify/fsevents/issues/37 https://developer.apple.com/documentation/coreservices/1448000-fseventstreamstart
which DM and I hit before - if the StreamStart returns an error code, the fsnotify/fsevents library just throws it out. we can probably break it up a bit into multiple event streams.
also nice find!
oh, probably related to: fsnotify/fsevents#37 https://developer.apple.com/documentation/coreservices/1448000-fseventstreamstart
which DM and I hit before - if the StreamStart returns an error code, the fsnotify/fsevents library just throws it out. we can probably break it up a bit into multiple event streams.
Hey Folks! It looks like this issue still exists and is inherent to fsevents per the discussion in this thread.
Do we expect a fix for this when watching >4096 files? I believe the solution here would be to swap out the fsevents impl for a kqueue one. I believe the watchexec Rust project also came to this conclusion.
In my opinion, this should cause some warning or error in Tilt and be documented somewhere at the very least.