Windows,JNI: graceful error-handling

CreateJunction and DeletePath are now more
resilient to errors:

- CreateJunction opens the junction path to check
  its target requesting fewer rights and with
  greater sharing permission. This way it can
  check junction targets even if the junction name
  is opened by another process with no sharing.

- DeletePath attempts to call FindFirstFileW if
  GetFileAttributesW fails with
  ERROR_ACCESS_DENIED. There's hardly any info
  about this error mode online, except for a code
  comment in the .NET CoreFX library. (See new
  code comments in this commit.)

Also:

- Change the error codes for DeletePath.

- Wrap the DeletPath error codes in a struct for
  better readability.

Fixes https://github.com/bazelbuild/bazel/issues/5433

Change-Id: I5b6e0f27b5b22c1cf00da90104495eda84178283

Closes #5590.

Change-Id: I5b6e0f27b5b22c1cf00da90104495eda84178283
PiperOrigin-RevId: 204438994
5 files changed
tree: c9843626da589a807d81856b7128f9a5de3c8510
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .gitattributes
  9. .gitignore
  10. AUTHORS
  11. BUILD
  12. CHANGELOG.md
  13. combine_distfiles.py
  14. combine_distfiles_to_tar.sh
  15. compile.sh
  16. CONTRIBUTING.md
  17. CONTRIBUTORS
  18. distdir.bzl
  19. ISSUE_TEMPLATE.md
  20. LICENSE
  21. README.md
  22. 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 only rebuilds 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

Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.