-
Notifications
You must be signed in to change notification settings - Fork 307
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
fix: Query Sync: don't check for validity of excludes that are system… #6841
Conversation
…-excludes (bazel-bin, .ijwb, etc.)
@@ -85,6 +90,11 @@ public QuerySpec deriveQuerySpec(Context<?> context, Path workspaceRoot) throws | |||
} | |||
} | |||
for (Path exclude : projectExcludes()) { | |||
if(systemExcludes().contains(exclude.toString())){ | |||
// We don't have to check if these dirs are valid for queries, because they also don't fall into //... wildcard | |||
continue; |
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.
but do we still need to exclude them via result.excludePath(exclude);
or not?
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.
I'm not sure, can investigate it later. The whole point of this PR is to avoid isValidPathForQuery
for these paths which might be super expensive
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 that's basically an optimization, it doesn't change the behavior
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.
what happens if we added result.excludePath(exclude);
instead of continue
? if we get the same performance improvement then it seems like the right thing to do
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.
I haven't tried but I think it could go to the query, as a subtraction unconditionally, without validity check and hence could result in a crash
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.
I see that makes sense, I can merge it as is to release for 2024.3 but we may come up with a better optimization later
…-excludes (bazel-bin, .ijwb, etc.)
Demo for bazelbuild/bazel:
Screen.Recording.2024-10-03.at.23.15.04.mov
Checklist
Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.
Discussion thread for this change
Issue number:
<please reference the issue number or url here>
Description of this change