Skip to content

incompatible_package_group_has_public_syntax #16355

@brandjon

Description

@brandjon

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 "//...".

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)breaking-change-6.0Incompatible flags to be flipped in Bazel 6.0incompatible-changeIncompatible/breaking changemigration-readyIncompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions