Commit graph

99 commits

Author SHA1 Message Date
00140fcfe6
fix: make sure we release self.snapshots_mutex on errors 2026-03-14 18:42:43 +01:00
505b9efeb8
fix: propagate unwatch() errors if backend.remove_watch can fail 2026-03-14 18:30:30 +01:00
f107b97214
build: fix build options 2026-03-14 18:04:22 +01:00
8662a3f7fd
feat: add --version 2026-03-14 18:01:32 +01:00
f68fdfe013
fix: restart FSEvents stream at last seen event id to avoid dropping events 2026-03-14 14:39:06 +01:00
e602a0638c
fix: propagate watch errors from FSEvents.add_watch 2026-03-14 14:20:05 +01:00
3bb3def510
fix: always use cross platform path separators 2026-03-14 14:13:16 +01:00
67af608357
fix: remove unused wait_readable_cb 2026-03-14 14:08:33 +01:00
bb32bcea1e
fix: polling check is reversed 2026-03-14 13:59:04 +01:00
b1457806d7
docs: update readme 2026-03-13 10:23:23 +01:00
40deced0f2
docs: fully document the public API and add examples 2026-03-13 09:38:53 +01:00
af29f5ea5e
build: set build version to 1.0.0 2026-03-13 07:45:15 +01:00
d674f255e6
docs: improve macos_fsevents option description 2026-03-13 07:43:41 +01:00
6b0cbe7171
build: add option to install tests 2026-03-09 12:19:23 +01:00
5b2962fdc0
build: rename test executable 2026-03-09 12:15:52 +01:00
2aa3c1afc7
refactor: clean-up empty test targets 2026-03-09 12:14:14 +01:00
163150690f
feat(cli): add colored output when stdout is a tty 2026-03-09 11:56:09 +01:00
19b7fd4c4a
refactor: move on watch messages to stdout 2026-03-09 11:45:53 +01:00
7b47ff775a
refactor: comment on watch messages 2026-03-09 11:42:40 +01:00
e0eac53bca
fix: flush stderr after watch startup 2026-03-09 11:39:58 +01:00
d1864f26fb
fix: cli should use the selected watcher interface 2026-03-09 11:37:40 +01:00
adc8f81b4f
refactor: run tests for all available variants 2026-03-09 11:33:40 +01:00
0813294652
refactor: select fsevents by default if it is enabled in build 2026-03-09 11:19:32 +01:00
b82c86acc9
refactor: misc cleanup 2026-03-09 11:17:59 +01:00
dd2bbb66ed
refactor: use polling interface on linux in nightwatch cli 2026-03-09 11:14:47 +01:00
6f8cfc946b
refactor: misc minor clean-ups 2026-03-09 11:02:47 +01:00
aa4e2920dd
build: allow selecting a backend at comptime instead of via a build flag 2026-03-09 10:46:29 +01:00
6930adae7f
refactor: re-organize backends into separate files 2026-03-09 09:51:01 +01:00
e5373cb143
build: remove unused flags dep 2026-03-08 22:17:36 +01:00
dfebd9ba4b
feat: add --ignore option to cli 2026-03-08 22:17:09 +01:00
37f16a03b7
refactor: make detects_file_modifications a backend member 2026-03-08 22:04:01 +01:00
08ff4a6231
feat: add alternate directory only kqueue backend 2026-03-08 22:02:34 +01:00
3ba8b2bac5
refactor: arean allocate temporaries in kqueue backend 2026-03-08 21:24:33 +01:00
0548953460
refactor: move pending_renames so we don't have to re-allocate it all the time 2026-03-08 21:20:20 +01:00
e3c093c729
refactor: fixup windows backend allocator usage 2026-03-08 20:57:08 +01:00
0dcd30acb4
feat: add object type to APIs and CLI output 2026-03-08 20:49:49 +01:00
a2523a5b53
docs: add some more platform support details to the readme 2026-03-08 20:11:18 +01:00
a951162c52
docs: reformat README.md 2026-03-08 20:10:56 +01:00
0f048dc47d
build: add the other BSDs 2026-03-08 20:06:56 +01:00
1e29da7765
fix(fsevents): fix FSEvents backend
Three bugs caused all integration tests to fail with -Dmacos_fsevents=true:

- FSEventStreamCreate was passed *CallbackContext directly as the context
  parameter, which expects *FSEventStreamContext (a struct with version=0,
  info=ptr, retain/release/copyDescription). The handler pointer landed in
  the version field (must be 0) and info received by callbacks was garbage,
  so the callback returned immediately on every event.

- FSEvents coalesces operations into a single delivery with multiple flags
  set (e.g. ItemCreated|ItemModified, ItemRenamed|ItemModified). The
  callback used an if/else chain that only emitted the first matching event
  type, so a write coalesced with a create or rename produced no 'modified'
  event. Fixed by checking each flag independently.

- FSEvents delivers spurious historical events for watched root directories
  at stream start (even with kFSEventStreamEventIdSinceNow), causing
  phantom dir_created events. Fixed by snapshotting the watched root paths
  in CallbackContext at arm() time and skipping events whose path exactly
  matches a root.

Also: arm() is now a no-op when no paths are watched yet (stream starts on
the first add_watch call), add_watch/remove_watch restart the stream so
paths added or removed take effect immediately, and makeTempDir resolves
/tmp to /private/tmp on macOS so test-constructed paths match FSEvents
canonical output.
2026-03-08 14:11:41 +01:00
4a8ab550e9
build: rename use_fsevents build option to macos_fsevents 2026-03-08 09:57:30 +01:00
82344d475b
refactor: enable linux background read thread by default 2026-03-08 09:49:25 +01:00
5502f8940a
feat: add support for a background read thread in linux too 2026-03-08 09:49:03 +01:00
1cbbdbd3cb
docs: add a basic manual test script for windows 2026-03-08 09:22:49 +01:00
7851312cfe
fix(windows): more cross platform path join to fix tests on windows 2026-03-08 09:22:32 +01:00
8491389023
fix(windows): use cross platform path join to fix tests on windows 2026-03-07 21:38:11 +01:00
24a3537ef8
fix(windows): use proper temp dir for testing on windows 2026-03-07 21:37:19 +01:00
240f3f148f
fix(linux): prevent double delete notification on directories 2026-03-07 21:14:48 +01:00
d66fd9348a
docs: add simple manual test script 2026-03-07 21:12:30 +01:00
5deb3dfa8b
fix: don't resolve symlinks when making a relative path absolute
Using realpath() in watch() caused events to be emitted under the resolved
path (e.g. /private/tmp/...) rather than the path the caller provided (e.g.
/tmp/..., where /tmp is a symlink on macOS). This broke all integration
tests on macOS since the test file paths didn't match the emitted event
paths.

For absolute paths, use them unchanged. For relative paths, join with the
current working directory without further symlink resolution. This
preserves the caller's view of the path while still satisfying the kqueue
backend's requirement for absolute paths.
2026-03-07 20:49:03 +01:00