Fix an initialization race in MacOSXFsEventsDiffAwareness and reenable tests.

MacOSXFsEventsDiffAwareness creates a thread at initialization time to run
the fsevents loop. This process takes two steps: first, registering the
fsevents queue with the kernel, which determines the point in time from
which we want to receive events; and, second, the actual start of the
run loop.

Before returning from init(), we must ensure we have at least completed
the first step of waiting for the queue registration -- or else any
file system operations that happen before the registration are lost.

I thought about splitting the run() method in two parts instead of using
a latch for synchronization but that doesn't work: note that the "run"
part of the loop relies on the current thread's CFRunLoop, which is
different from the one we'd do in the preparatory step outside of the
thread.

Tested: Added a sleep in the thread right before we call run().  Without
this fix, we consistently lose all events from the test, and with this
fix, we get them all.

Fixes #10776.

RELNOTES: None.
PiperOrigin-RevId: 297648494
3 files changed
tree: 1bbbda9c680bf2f40897e1b0f5909d902fb80203
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .bazelrc
  9. .gitattributes
  10. .gitignore
  11. AUTHORS
  12. BUILD
  13. CHANGELOG.md
  14. CODEOWNERS
  15. combine_distfiles.py
  16. combine_distfiles_to_tar.sh
  17. compile.sh
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. distdir.bzl
  21. ISSUE_TEMPLATE.md
  22. LICENSE
  23. README.md
  24. WORKSPACE
README.md

Bazel

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

  • Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

  • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

  • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

  • Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status