SYSTEM Cited by 1 source
Watchman¶
Watchman is Meta's open-source file system monitor service (facebook.github.io/watchman). It exposes an incremental "what files changed since timestamp T" API by subscribing to OS-level file-system notifications (inotify on Linux, FSEvents on macOS, ReadDirectoryChangesW on Windows) and maintaining an in-memory index.
Why it matters to the wiki¶
Watchman is load-bearing for any tool that needs to answer "what changed in this working copy" without re-scanning the whole directory tree — a query that becomes impossible at monorepo scale.
Named canonical use in this wiki: Sapling's sl status. Per the
2022-11-15 Sapling announcement post:
"Even without the virtual file system, we speed up
sl statusby utilizing Meta's Watchman file system monitor to query which files have changed without scanning the entire working copy."— Sapling announcement post
The same trick powers Facebook's internal Mercurial/Sapling hg
status and related commands; externally, Buck2, Facebook's React
Native tooling, and various IDEs/build systems also consume Watchman
for incremental file-change subscriptions.
Stub page¶
First wiki page for Watchman. Future sources that touch incremental file-system observation at scale (Bazel daemon, EdenFS, large-repo IDE indexers) should extend this page.
Seen in¶
- sources/2024-09-10-meta-sapling-source-control-thats-user-friendly-and-scalable
— named as the accelerator for
sl statusin working copies without the Sapling virtual file system.
Related¶
- companies/meta — Watchman is a Meta open-source project.
- systems/sapling-scm — the canonical wiki consumer of Watchman.
- concepts/sparse-checkout — similar concern (don't scan the whole tree) from the VCS side.
- concepts/virtual-filesystem-for-monorepo — the heavier-weight alternative for the same scaling problem.