Skip to content

incompatible_fix_package_group_reporoot_syntax #16323

@brandjon

Description

@brandjon

Description: This flag fixes the behavior of the string "//..." in package_group's packages attribute. Previously, this was treated as including all packages, everywhere, in the package_group. With the flag enabled, it now means all packages in the default repo (i.e. the repo where the package_group lives).

Migration: Wherever the old behavior is desired, replace "//..." with "public", which is the new way to refer to all packages in any repo. The value "public" (and its sibling, "private") is available only if --incompatible_package_group_has_public_syntax is enabled, but it is an error not to enable that flag when this one is on. For a smoother migration, you can opt out of this change (--incompatible_fix_package_group_reporoot_syntax=false) while you incrementally update "//..." occurrences to "public".

Note that in .bzl visibility, "//..." always behaves as if this flag were enabled. So without the flag enabled, this value will mean two different things depending on where it appears.

Rationale: This is more consistent with other possible package specifications. For instance, "//pkg/..." means all packages underneath //pkg in the default repo, not all packages underneath //pkg in any repo. Likewise, "//" means the root package of the default repo, not the root package of any repo. Without this change, there is no easy way to grant visibility to only the current repo via a package_group (although a visibility attribute could use "//:__subpackages__").

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