-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[8.0.0] Implement ignoring directories based on wildcards. #24203
Conversation
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
Please take a look at the build failure (probably a missing dep in BUILD) |
Argh, sorry, PTAL. The cherrypick applied cleanly, I built |
Thanks! FYI this missed a doc update though: https://bazel.build/external/overview#repo.bazel
|
It's documented at https://bazel.build/rules/lib/globals/repo, but we should probably add a link from https://bazel.build/external/overview#repo.bazel |
Address #24203 (comment) RELNOTES: None PiperOrigin-RevId: 711671116 Change-Id: Id7aea8b57929b4e0ff77ba359d7b104d5800e746
I was about to add that link and was confused that it's already there :) |
Sorry, should have commented that it's fixed in cae59ef |
No worries, I guess I should also have gotten the above notification from |
No, those reference event won't show up in github notification. |
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