Support external repository labels in package_group#28811
Draft
meteorcloudy wants to merge 1 commit intobazelbuild:masterfrom
Draft
Support external repository labels in package_group#28811meteorcloudy wants to merge 1 commit intobazelbuild:masterfrom
meteorcloudy wants to merge 1 commit intobazelbuild:masterfrom
Conversation
8c3b751 to
2ec99a5
Compare
2ec99a5 to
2b4c509
Compare
Member
Author
|
@brandjon @Wyverald What do you think about this change? @mkruskal-google needs this for limiting certain abseil targets visibility to a specific new BCR module. already works when you have a |
Collaborator
|
Does this work with nodep deps? That would resolve concerns about increased dep footprint. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR enables
package_groupto correctly interpret labels that include external repositories (e.g.,@module//...or@module//:__subpackages__).Motivation
Previously,
PackageSpecification.javastrictly required package names to start with//, failing on labels with repository prefixes. This made it impossible to define apackage_groupthat includes packages from other Bzlmod modules. This change leveragesLabel.parseWithRepoContextto correctly resolve repository mapping and validate package specifications within the context of the repository where thepackage_groupis defined.Fixes an issue where bazel build would fail when a
package_groupreferenced an external repository in itspackagesattribute.Build API Changes
Yes. This change affects the behavior of the
package_grouprule and thevisibility()function in.bzlfiles.Checklist
Release Notes
RELNOTES:
package_groupnow supports labels with external repositories in thepackagesattribute.