10 Commits

Author SHA1 Message Date
Andrew Kelley
4442288656 std: fix inappropriate use of unreachable in fanotify_init 2024-09-25 16:07:04 -07:00
Jarrod Meyer
9be10ea964 Watch.zig: fixes for windows implementation
Using --watch I noticed a couple of issues with my initial attempt. 1) The index I used as 'completion key' was not stable over time, when directories are being added/removed the key no longer corresponds with the intended dir. 2) There exists a race condition in which we receive a completion notification for a directory that was removed. My solution is to generate a key value and associate it with each Directory.
2024-08-14 13:21:01 -07:00
Jarrod Meyer
2de0e2eca3 Watch.zig: add initial windows implementation 2024-07-27 11:32:43 -04:00
Andrew Kelley
5efcc2e9e7 build runner: refactor fs watch logic for OS abstraction
Makes the build runner compile successfully for non-linux targets;
printing an error if you ask for --watch rather than making build
scripts fail to compile.
2024-07-12 14:20:20 -07:00
Andrew Kelley
61d2234743 std.Build.Watch: add ONDIR to fanotify event mask
This makes mkdir/rmdir events show up.
2024-07-12 00:14:08 -07:00
Andrew Kelley
7bccef3e4e std.Build.Watch: introduce special file "." to watch entire dir
And use it to implement InstallDir Step watch integration.

I'm not seeing any events triggered when I run `mkdir` in the watched
directory, however, and I have not yet figured out why.
2024-07-12 00:14:08 -07:00
Andrew Kelley
956f1ebc70 std.Build.Watch: gracefully handle fanotify queue overflow 2024-07-12 00:14:08 -07:00
Andrew Kelley
001ff7b3b2 std.Build.Watch: make dirty steps invalidate each other
and make failed steps always be invalidated
and make steps that don't need to be reevaluated marked as cached
2024-07-12 00:14:07 -07:00
Andrew Kelley
6f89824c22 build system: make debounce interval CLI-configurable 2024-07-12 00:14:07 -07:00
Andrew Kelley
5ee3971b18 proof-of-concept --watch implementation based on fanotify
So far, only implemented for InstallFile steps.

Default debounce interval bumped to 50ms. I think it should be
configurable.

Next I have an idea to simplify the fanotify implementation, but other
OS implementations might want to refer back to this commit before I make
those changes.
2024-07-12 00:14:07 -07:00