Flip package_group incompatible flags

The three flipped flags are: --incompatible_package_group_includes_double_slash, --incompatible_package_group_has_public_syntax, and --incompatible_fix_package_group_reporoot_syntax. The first is a common query flag, and the latter two are stored in starlark semantics.

Logically, these are all one flag that migrates package_group to use `public` instead of `//...`, which now means "this repo only".

A side-effect of this change is that //src/main/java/net/starlark/java:clients is no longer publicly visible. In order to not break bootstrapping from prior Bazel versions, we will tolerate this regression until after the 6.0 release. The Java Starlark interpreter is not a publicly supported API anyway; its main users are Copybara and Stardoc, both of which can simply avoid vendoring-in the 6.0 version.

The //tools source tree is updated to move some allowlist definitions from BUILD files into BUILD.tools files. This works around a bootstrapping issue. The allowlist definitions are not needed at development time for Bazel itself, except for one test that incorrectly referred to a label under the main repo instead of @bazel_tools.

Updated a few test setups to use "public" in place of "//...".

These flags are not yet flipped in Blaze at Google. Our ordinary mechanism for controlling flags with a bazelrc file does not work in this particular case. Therefore, this CL takes the unusual step of factoring out the default values into string constants in stub files (FlagConstants.java) that differ between the internal and external source trees. This hack will be reverted once the flags are flipped in Blaze.

Fixes #16391.
Fixes #16355.
Fixes #16323.
Work toward #11261.

RELNOTES[INC]: In package_group's `packages` attribute, the syntax "//..." now refers to all packages in the same repository as the package group, rather than all packages everywhere. The new item "public" can be used instead to obtain the old behavior. In `bazel query --output=proto` (and `--output=xml`), the `packages` attribute now serializes with the leading double slash included (for instance, `//foo/bar/...` instead of `foo/bar/...`). See also #16355, #16323, and #16391.

PiperOrigin-RevId: 482023278
Change-Id: If86703d279dd3cd18b6b3948f37720816ada465f
21 files changed
tree: a34af0b70874d3fab5597514f35477c809222e32
  1. .bazelci/
  2. .github/
  3. examples/
  4. scripts/
  5. site/
  6. src/
  7. third_party/
  8. tools/
  9. .bazelrc
  10. .gitattributes
  11. .gitignore
  12. AUTHORS
  13. BUILD
  14. CHANGELOG.md
  15. CODE_OF_CONDUCT.md
  16. CODEOWNERS
  17. combine_distfiles.py
  18. combine_distfiles_to_tar.sh
  19. compile.sh
  20. CONTRIBUTING.md
  21. CONTRIBUTORS
  22. distdir.bzl
  23. distdir_deps.bzl
  24. LICENSE
  25. MODULE.bazel
  26. README.md
  27. SECURITY.md
  28. WORKSPACE
  29. WORKSPACE.bzlmod
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

Reporting a Vulnerability

To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.

Contributing to Bazel

See CONTRIBUTING.md

Build status