Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0.0] Implement ignoring directories based on wildcards. #24203

Merged

Conversation

lberki
Copy link
Contributor

@lberki lberki commented Nov 5, 2024

This is accomplished by a new directive in REPO.bazel, "ignore_directories()". It takes a single argument, a list of directories to ignore and it allows the same wildcards as glob().

This is done separately from .bazelignore to provide a migration path off of that weird single-purpose configuration file.

Implementing this requires splitting RepoFileFunction into two: a part that parses the repository file and one that creates a PackageArgs instance. This was necessary to avoid a Skyframe dependency cycle: when a WORKSPACE file is present and it loads a .bzl file from a repository with a REPO.bazel file, the repo mapping for the main repository depends on the WORKSPACE file, which depends on the .bzl file, which depends on the IgnoredPackagePrefixesValue of its repository, which then depends on the repo mapping of the main repository and the one the .bzl file is in, which then depend on the WORKSPACE file.

Fixes #7093.

RELNOTES[NEW]: REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics.

Closes #24032.

PiperOrigin-RevId: 693227896
Change-Id: Ia3e02a2bfe9caf999fc641f75261b528b19c1d03

This is accomplished by a new directive in REPO.bazel, "ignore_directories()". It takes a single argument, a list of directories to ignore and it allows the same wildcards as glob().

This is done separately from .bazelignore to provide a migration path off of that weird single-purpose configuration file.

Implementing this requires splitting RepoFileFunction into two: a part that parses the repository file and one that creates a PackageArgs instance. This was necessary to avoid a Skyframe dependency cycle: when a WORKSPACE file is present and it loads a .bzl file from a repository with a REPO.bazel file, the repo mapping for the main repository depends on the WORKSPACE file, which depends on the .bzl file, which depends on the IgnoredPackagePrefixesValue of its repository, which then depends on the repo mapping of the main repository and the one the .bzl file is in, which then depend on the WORKSPACE file.

Fixes #7093.

RELNOTES[NEW]: REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics.

Closes #24032.

PiperOrigin-RevId: 693227896
Change-Id: Ia3e02a2bfe9caf999fc641f75261b528b19c1d03
@lberki lberki requested a review from a team as a code owner November 5, 2024 09:17
@github-actions github-actions bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Nov 5, 2024
@meteorcloudy
Copy link
Member

Please take a look at the build failure (probably a missing dep in BUILD)

@lberki
Copy link
Contributor Author

lberki commented Nov 5, 2024

Argh, sorry, PTAL. The cherrypick applied cleanly, I built //src:bazel and called it good.

@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 5, 2024
@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 5, 2024
@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 5, 2024
Merged via the queue into release-8.0.0 with commit 00da366 Nov 5, 2024
47 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Nov 5, 2024
@iancha1992 iancha1992 added this to the 8.0.0 release blockers milestone Nov 5, 2024
@iancha1992 iancha1992 changed the title Implement ignoring directories based on wildcards. [8.0.0] Implement ignoring directories based on wildcards. Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants