feat: use FSEvents for macOS file-watch triggers - #1753
Merged
Conversation
Contributor
📸 Docs previewPreview screenshots for this PR were cleaned up after it was closed. |
Contributor
📊 Test coverage
Per-file Go coverage (most uncovered first) — click to expand
Base coverage: Go |
d0ugal
force-pushed
the
d0ugal/graith/issue-1750-fsevents-d815fd6e
branch
2 times, most recently
from
July 27, 2026 11:02
7be89d5 to
ae7583a
Compare
d0ugal
force-pushed
the
d0ugal/graith/issue-1750-fsevents-d815fd6e
branch
from
July 27, 2026 11:07
ae7583a to
60fa427
Compare
d0ugal
force-pushed
the
d0ugal/graith/issue-1750-fsevents-d815fd6e
branch
from
July 27, 2026 11:22
60fa427 to
c40b370
Compare
d0ugal
force-pushed
the
d0ugal/graith/issue-1750-fsevents-d815fd6e
branch
from
July 27, 2026 11:30
c40b370 to
5aa4db5
Compare
d0ugal
marked this pull request as ready for review
July 27, 2026 11:34
d0ugal
force-pushed
the
d0ugal/graith/issue-1750-fsevents-d815fd6e
branch
from
July 27, 2026 11:35
5aa4db5 to
a52b58d
Compare
d0ugal
enabled auto-merge (rebase)
July 27, 2026 11:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
darwin && cgo, with fsnotify preserved everywhere else.Resource evidence
TestFSEventsBackendUsesSingleRecursiveStreamcreates a nested worktree and a broad**/*.gowatch withwatch_max_directories = 1; the binding stays healthy withwatch_backend=fsevents, one recorded watch path, and daemon watch cost1.Scope notes
Fixes #1750
Test plan
go test -v ./internal/daemon -run 'Test(FSEventsBackend|HandleWatchEvent_(CoalescedSubtreeScan|LossySubtreeScanNotesEligibleDirectory|LossyMissingSubtreeNotesEligibleDirectory|RenamedDirectoryScansSubtree|PreciseDirectoryScanDoesNotNoteEmptyEligibleSubtree)|FileWatchBudgetDegradesAndReleases|WatcherDiagnosticAttribution)$' -count=1go test -v ./internal/daemon -run 'TestFSEventsBackend(UsesSingleRecursiveStream|EndToEndNestedCreate|DirectoryRenameRequestsSubtreeScan)$' -count=1go test ./internal/cli -run 'TestCheckWatcherResources|TestTrigger' -count=1go test ./internal/config -count=1go test ./internal/protocol -count=1go build ./cmd/graithmake lint-onlygit diff --checkNote: before the rebase onto #1752, the same focused daemon suite also passed under
-race. A full localgo test ./internal/daemon -count=1attempt was interrupted after several minutes in unrelated lifecycle coverage without surfacing a concrete failure; CI remains the authoritative full-suite run.