Prefer rethrowing Skyframe globbing errors rather than legacy globbing errors.

Skyframe globbing errors are more useful to the user (e.g. in the case of a symlink cycle, the error message contains the cycle) and are also persistent. Contrast with legacy globbing errors which are more opaque and are conservatively assumed to be transient.

Unsurprisingly, this change fixes a long-standing discrepancy between incremental and non-incremental package loading. The new, self-consistent behavior, is that PackageFunction will throw a NoSuchPackageException if any glob evaluation encounters a symlink cycle, regardless if glob evaluations were cached via Skyframe globbing. The discrepancy with the old code was that legacy globbing ignores some symlink issues (see UnixGlob.GlobVisitor#processSymlink), and so on non-incremental package loading with a symlink ignored by legacy globbing, PackageFunction wouldn't throw a NoSuchPackageException.

RELNOTES: Package loading now consistently fails if package loading had a glob evaluation that encountered a symlink cycle or symlink infinite expansion. Previously, such package loading with such glob evaluations would fail only in some cases.
PiperOrigin-RevId: 280298226
6 files changed
tree: 7e98f3cf6a0c660128b2f752361ae14ad6f12322
  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