tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Tilt on MacOS can't watch files for resources with 4097+ deps

Open maiamcc opened this issue 5 years ago • 3 comments

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.

maiamcc avatar Jun 12 '20 20:06 maiamcc

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.

nicks avatar Jun 12 '20 22:06 nicks

also nice find!

nicks avatar Jun 12 '20 22:06 nicks

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.

dakota-doordash avatar Mar 10 '25 20:03 dakota-doordash