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

fix: Query Sync: don't check for validity of excludes that are system… #6841

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

tpasternak
Copy link
Collaborator

…-excludes (bazel-bin, .ijwb, etc.)

Demo for bazelbuild/bazel:

Screen.Recording.2024-10-03.at.23.15.04.mov

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

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

@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Oct 3, 2024
@@ -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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Collaborator

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

Copy link
Collaborator Author

@tpasternak tpasternak Oct 3, 2024

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

Copy link
Collaborator

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

@tpasternak tpasternak merged commit fb7e43e into bazelbuild:master Oct 4, 2024
6 checks passed
@tpasternak tpasternak deleted the qsync-4 branch October 4, 2024 06:13
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants