Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take windows junctions into account with --watchfs
Related PR: #11334 I enabled --watchfs for windows under --experimental_windows_watchfs. Related issues: #11619: 1. (infinite) recursion occurs on the convenience symlinks when they are created while watch is active. This also causes a delay on the first bazel invocation after the symlinks are created. 2. quite often an overflow warning occurs `WARNING: Overflow when watching local filesystem for changes...`. I think this is because the watcher also watches the bazel-* symlinks with many file changes due to being output directories. The reason that this behavior is different on windows seems to be that the convenience symlinks are actually created as junctions. I have tried changed this logic to creating actually directory symlinks which seemed to resolve the issues. This however could be a breaking change on some systems because creating symlinks requires more privileges than creating junctions. ~~Therefore I propose the following changes:~~ ~~1. Watch the root directory non-recursively. As it's done on non windows systems.~~ ~~2. Watch each direct sub-directory recursively. Excluding junctions.~~ ~~The downside of this approach is that the convenience symlinks must be at the root of the workspace. When using --symlink_prefix with a sub-directory (which is the case for in the linked issue) both issues would still occur.~~ I have updated the PR to reflect my comment below because this also resolves the above mentioned downside and is a simpler solution. I have tested several scenarios with regards to the folder locking but was able to delete workspace folders from explorer, ide and cli every time. Closes #12054. PiperOrigin-RevId: 330496447
- Loading branch information
0cdd71f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomdegoede As far as I understand --watchfs feature only helps when the sources are in the root workspace directly. In our case the root workspace is just an orchestrator for the build and does not carry any actual source code. All the source code comes from
http_archive
andgit_repository
rules. Does it mean --watchfs is practically useless in our scenario?0cdd71f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes unfortunately that's correct. The external folder is still manually checked (and the bazel-out as well) which is hurting the performance for us as well. Hopefully someone can rewrite the diffing for external dependencies to use watchfs in the future as well. You can look at
src\main\java\com\google\devtools\build\lib\skyframe\SequencedSkyframeExecutor.java
handleDiffs
for more details.