facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.72k stars 994 forks source link

Running watchman watch or watch-project in foreground does not watch any folders #946

Open gargolito opened 3 years ago

gargolito commented 3 years ago

Expected Behaviour Running watchman watch or watch-project in the foreground watches given directory.

Actual behaviour If I run watchman watch or watch-project in the foreground, no folders are watched. Using the same commands given in steps to reproduce below, without foreground, everything works as expected. This happens in MacOS and on Linux

Workaround Run watch or watch-project in background, run trigger. Kill processes. Restart watch in foreground.

Steps to reproduce Command: watchman -f -o /dev/stdout watch-project ~/project/foo Output:

2021-09-05T12:08:31,465: [listener] Watchman 2021.06.07.00 <no build info set> starting up on C02YQ69JLVCG
2021-09-05T12:08:31,467: [listener] file limit is 10496 kern.maxfilesperproc=24576
2021-09-05T12:08:31,467: [listener] raised file limit to 24576
2021-09-05T12:08:31,467: [listener] launchd checkin failed: No such process
2021-09-05T12:08:31,468: [sanitychecks] starting sanityCheckThread

In another terminal: Command: watchman watch-list Output:

{
    "version": "2021.06.07.00",
    "roots": []
}

Obviously, when I issue a trigger command: watchman -j <<< '["trigger", ".", "test", "*.py", "--", "python"]' Output:

{
    "version": "2021.06.07.00",
    "error": "RootResolveError: RootResolveError: unable to resolve root /Users/acamilo16/watch: RootResolveError: directory ~/project/foo is not watched"
}

Operating system(s)