-
Notifications
You must be signed in to change notification settings - Fork 4.5k
incompatible_fix_package_group_reporoot_syntax #16323
Copy link
Copy link
Closed
Labels
P1I'll work on this now. (Assignee required)I'll work on this now. (Assignee required)breaking-change-6.0Incompatible flags to be flipped in Bazel 6.0Incompatible flags to be flipped in Bazel 6.0incompatible-changeIncompatible/breaking changeIncompatible/breaking changemigration-readyIncompatible flag is ready for migration with Bazel rolling releases or Bazel@last_greenIncompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green
Metadata
Metadata
Assignees
Labels
P1I'll work on this now. (Assignee required)I'll work on this now. (Assignee required)breaking-change-6.0Incompatible flags to be flipped in Bazel 6.0Incompatible flags to be flipped in Bazel 6.0incompatible-changeIncompatible/breaking changeIncompatible/breaking changemigration-readyIncompatible flag is ready for migration with Bazel rolling releases or Bazel@last_greenIncompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green
Description: This flag fixes the behavior of the string
"//..."inpackage_group'spackagesattribute. Previously, this was treated as including all packages, everywhere, in thepackage_group. With the flag enabled, it now means all packages in the default repo (i.e. the repo where thepackage_grouplives).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_syntaxis 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//pkgin the default repo, not all packages underneath//pkgin 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 apackage_group(although avisibilityattribute could use"//:__subpackages__").