bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Implement ignoring directories based on wildcards.

Open lberki opened this issue 1 year ago • 1 comments

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.

lberki avatar Oct 18 '24 06:10 lberki

Thanks! Waiting for @Wyverald to take a look!

meteorcloudy avatar Oct 18 '24 10:10 meteorcloudy

I addressed the review comments and although the presubmits haven't quite passed yet, they look good so far so I'll context switch away from this. PTAL!

lberki avatar Oct 28 '24 08:10 lberki

Comments addressed and tests are green. PTAL!

lberki avatar Oct 31 '24 08:10 lberki

Done and done. PTYAL!

lberki avatar Oct 31 '24 19:10 lberki