zig icon indicating copy to clipboard operation
zig copied to clipboard

avoid file system watches on read-only mounts

Open andrewrk opened this issue 1 year ago • 2 comments

Follow-up from https://github.com/ziglang/zig/pull/20580.

name_to_handle_at gives us a mount ID here:

https://github.com/ziglang/zig/blob/8ab70f80cb8943dde41a5e4a8ca73631d44643a2/lib/std/Build/Watch.zig#L101

If this mount is read-only then the watch system should not waste any resources placing a mark on any directories within because they will never change!

Related:

  • #20670

andrewrk avatar Jul 18 '24 04:07 andrewrk

No insight on the particulars of read-only mounts, but I assume they could be un-mounted and then re-mounted with different data while the program is running? That could either be considered an error and explicitly unsupported, or supported by a "mount watch" mechanism spanning all files within (maybe by only watching the first file on it, if that tells us enough to detect re-mounting?).

rohlem avatar Jul 18 '24 09:07 rohlem

ehh if that's possible and it doesn't even change the mount id then this should be closed

andrewrk avatar Jul 18 '24 19:07 andrewrk