Skip to content

Conversation

@bazel-io
Copy link
Member

This reverts commit 7111cbf, which in turn reverted cecc26b.

The regression is fixed by adding an additional fallback to a repo mapping lookup for the main repo to accommodate the tests in rules_cc and rules_java. The restructuring of the checks also results in a further improvement down to a 1% slowdown incurred by the checks (vs. 10-20% before this change).

Closes #28217.

PiperOrigin-RevId: 855249997
Change-Id: I7da63fa9d6727a771e94be86bf62e7a6f957cfc7

Commit 37fb3c5

This reverts commit 7111cbf, which in turn reverted cecc26b.

The regression is fixed by adding an additional fallback to a repo mapping lookup for the main repo to accommodate the tests in rules_cc and rules_java. The restructuring of the checks also results in a further improvement down to a 1% slowdown incurred by the checks (vs. 10-20% before this change).

Closes bazelbuild#28217.

PiperOrigin-RevId: 855249997
Change-Id: I7da63fa9d6727a771e94be86bf62e7a6f957cfc7
@bazel-io bazel-io requested a review from a team as a code owner January 12, 2026 17:02
@bazel-io bazel-io added the awaiting-review PR is awaiting review from an assigned reviewer label Jan 12, 2026
@bazel-io bazel-io requested a review from hvadehra January 12, 2026 17:02
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request relands a performance optimization for checking builtin restrictions, which was previously reverted due to a regression. The change avoids expensive repository mapping lookups by adding fast paths for Bzlmod-managed repositories and the bazel_tools repository. The regression is addressed by reintroducing a repository mapping lookup as a fallback, but only when checking labels in the main repository. This ensures correctness for allowlisted rulesets that might be the main repository. The logic appears sound and the refactoring to use RepositoryName.BUILTINS is a good improvement.

@Wyverald Wyverald enabled auto-merge January 12, 2026 17:06
@Wyverald Wyverald added this pull request to the merge queue Jan 12, 2026
Merged via the queue into bazelbuild:release-9.0.0 with commit 26760a0 Jan 12, 2026
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jan 12, 2026
@Wyverald Wyverald deleted the cp28217-9.0.0 branch January 12, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants