Files
Sylvestre Ledru aefee1489a Bug 2058179 - Add a .watchmanconfig to exclude in-tree objdirs from watchman r=firefox-build-system-reviewers,ahochheiden
Without a .watchmanconfig, watchman watches the whole source tree including the
in-tree objdir. Watchman's default ignore_vcs covers .git, but build output is
not covered. On a Linux checkout this accounted for ~9600 extra inotify watches,
and a build's event burst can overflow fs.inotify.max_queued_events (16384 by
default), which forces a watchman recrawl.

A recrawl makes git's core.fsmonitor hook report a fresh instance, which
invalidates git's untracked cache. The next `git status` then calls opendir() on
41713 directories instead of 0, costing roughly 1.2s extra on a 472k-file
checkout.

Both obj*/ and artifacts/ are already gitignored, so suppressing watchman events
for them cannot cause git to miss a change.

ignore_dirs does not support globs, so the entries have to be exact paths: the
default obj-@CONFIG_GUESS@ names produced by mach plus a few common mozconfig
conventions. Developers using another objdir name can add their own, and an
objdir outside the source tree needs no entry at all. The file has to stay
strict JSON, because watchman silently discards the entire config if it contains
comments.

DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D314383
2026-07-30 06:33:29 +00:00

16 lines
285 B
JSON

{
"ignore_dirs": [
"artifacts",
"obj-aarch64-apple-darwin",
"obj-aarch64-unknown-linux-gnu",
"obj-x86_64-apple-darwin",
"obj-x86_64-pc-linux-gnu",
"obj-x86_64-pc-mingw32",
"obj-debug",
"obj-ff-dbg",
"obj-ff-opt",
"obj-opt",
"objdir"
]
}