-
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
Implement ignoring directories based on wildcards. #24032
Conversation
Thanks! Waiting for @Wyverald to take a look! |
src/main/java/com/google/devtools/build/lib/cmdline/IgnoredSubdirectories.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/packages/RepoCallable.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/packages/RepoCallable.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/packages/RepoCallable.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I reviewed some more superficial parts of this change before happening on to the whole "splitting RepoFileFunction into two parts" thing. After reading the context in #7093 (comment), my initial gut reaction is that this is a lot of extra complexity that's really not justified by its gains.
Besides Fabian's suggestion to cut edge 8 (which you had a counterargument for), I was also thinking if we could just cut edge 1 -- that is, WORKSPACE is going away anyway, so let's not worry about that. Essentially, we can try to make the assertion that computing the main repo mapping does not transitively depend on IgnoredPackagePrefixesValue
.
Unfortunately, that's not true... If we have a non-registry override for a bazel_dep
, and the override refers to a patch file (which is addressed by a label), then we'll need to look up the package for that label. (Not to mention we actually need to load @bazel_tools//tools/build_defs/repo:http.bzl
anyway, but I was hoping those could be avoided using exceptions -- which we already have quite a few of, regarding stuff in @bazel_tools
.)
So all that was a long way to say I haven't finished the review yet, and will get to the meaty parts now.
src/main/java/com/google/devtools/build/lib/skyframe/RepoFileFunction.java
Outdated
Show resolved
Hide resolved
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
src/main/java/com/google/devtools/build/lib/skyframe/PackageArgsFunction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/PackageArgsFunction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/PackageArgsFunction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/PackageArgsFunction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/RepoFileFunction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/PackageArgsFunction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/IgnoredPackagePrefixesFunction.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/cmdline/IgnoredSubdirectories.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/packages/RepoFileGlobals.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/BazelSkyframeExecutorConstants.java
Outdated
Show resolved
Hide resolved
Comments addressed and tests are green. PTAL! |
src/main/java/com/google/devtools/build/lib/skyframe/BazelSkyframeExecutorConstants.java
Outdated
Show resolved
Hide resolved
Done and done. PTYAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few more nits, but overall LGTM! Please import this yourself, as I'd imagine there are a few Blaze-specific changes to be made. Or if you'd rather I do the import, just let me know!
@@ -140,7 +136,7 @@ private static String getDisplayNameForRepo( | |||
return displayName; | |||
} | |||
|
|||
private PackageArgs evalRepoFile( | |||
private RepoFileValue evalRepoFile( | |||
StarlarkFile starlarkFile, | |||
RepositoryName repoName, | |||
RepositoryMapping repoMapping, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping -- this arg should be removed
src/main/java/com/google/devtools/build/lib/skyframe/RepoFileFunction.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/IgnoredPackagePrefixesFunction.java
Show resolved
Hide resolved
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.
aff0fba
to
f7fa158
Compare
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
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.