-
Notifications
You must be signed in to change notification settings - Fork 4.4k
incompatible_package_group_has_public_syntax #16355
Description
Description: This flag adds the new string constants "public" and "private" as allowed values for package_group's packages attribute. "public" admits every package into the package group, which is the same behavior as "//..." prior to --incompatible_fix_package_group_reporoot_syntax (#16323). "private" admits no packages and has the same effect as omitting it from the list; it is provided merely for symmetry / readability.
Migration: This flag is an incompatible change because, in the output of bazel query --output=proto (or --output=xml), the names "public" and "private" will stringify in a way that's ambiguous with the hypothetical packages //public and //private. To fix this, --incompatible_package_group_includes_double_slash should be enabled whenever this flag is used. There is no separate migration needed just for --incompatible_package_group_has_public_syntax, except that any tooling that statically processes BUILD files or which consumes query output should be prepared for the possibility of the "public" and "private" values.
Note that in .bzl visibility, the values "public" and "private" are always available regardless of this flag.
Rationale: Flipping this change is a prerequisite to #16323 since without "public" there is no replacement for "//...".