Skip to content

[9.2.0] Gate external-repo source dir package boundary checks behind a flag (https://github.com/bazelbuild/bazel/pull/30019)#30040

Merged
iancha1992 merged 1 commit into
release-9.2.0from
wyv-920-srcdir
Jun 26, 2026
Merged

[9.2.0] Gate external-repo source dir package boundary checks behind a flag (https://github.com/bazelbuild/bazel/pull/30019)#30040
iancha1992 merged 1 commit into
release-9.2.0from
wyv-920-srcdir

Conversation

@Wyverald

Copy link
Copy Markdown
Member

Description

#29692 made the package-boundary check for source directories in RecursiveFilesystemTraversalFunction repo-aware. Besides fixing the false positives reported in #29688, it also made the check effective for source directories in external repos, which is a breaking change.

This PR gates that new enforcement behind --incompatible_check_external_repo_source_dir_package_boundary (default off).

When the flag is off, package boundary crossings by source directories in external repositories are skipped entirely rather than reverting to the old main-repo lookup. As a result, #29688 stays fixed regardless of the flag value.

Motivation

#29688 (comment)

Build API Changes

Yes: adds the command-line flag --incompatible_check_external_repo_source_dir_package_boundary.

  1. Has this been discussed in a design doc or issue? N/A
  2. Is the change backward compatible? Yes. The flag defaults to off, preserving the pre-Fix repo collisions when checking package traversals of source dirs #29692 (9.1.x) behavior for source directories in external repositories.
  3. If it's a breaking change, what is the migration plan? Enabling the flag (eventually flipping the default to on in a future major release) restores the strict, repo-aware enforcement.

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: Source directories in external repositories are temporarily allowed to cross package boundaries. This will be disallowed in the future, gated by the new --incompatible_check_external_repo_source_dir_package_boundary flag.

Closes #30019.

PiperOrigin-RevId: 938703055
Change-Id: I5bf779d6ea0c10579564d77fc9eb0adf6aaacd03

(original commit 3ad37ef)

…a flag (#30019)

This PR gates that new enforcement behind `--incompatible_check_external_repo_source_dir_package_boundary` (default off).

When the flag is off, package boundary crossings by source directories in external repositories are skipped entirely rather than reverting to the old main-repo lookup. As a result, #29688 stays fixed regardless of the flag value.

#29688 (comment)

Yes: adds the command-line flag `--incompatible_check_external_repo_source_dir_package_boundary`.

1. Has this been discussed in a design doc or issue? N/A
2. Is the change backward compatible? Yes. The flag defaults to off, preserving the pre-#29692 (9.1.x) behavior for source directories in external repositories.
3. If it's a breaking change, what is the migration plan? Enabling the flag (eventually flipping the default to on in a future major release) restores the strict, repo-aware enforcement.

- [x] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

RELNOTES: Source directories in external repositories are temporarily allowed to cross package boundaries. This will be disallowed in the future, gated by the new `--incompatible_check_external_repo_source_dir_package_boundary` flag.

Closes #30019.

PiperOrigin-RevId: 938703055
Change-Id: I5bf779d6ea0c10579564d77fc9eb0adf6aaacd03

(original commit 3ad37ef)
@Wyverald Wyverald requested a review from a team as a code owner June 26, 2026 19:10
@github-actions github-actions Bot added team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob labels Jun 26, 2026
@iancha1992 iancha1992 added this pull request to the merge queue Jun 26, 2026
Merged via the queue into release-9.2.0 with commit 153f3f9 Jun 26, 2026
7 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Core Skyframe, bazel query, BEP, options parsing, bazelrc team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants