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

perf: avoid scanning convenience symlink directories during initial import #6094

Merged
merged 1 commit into from Feb 21, 2024

Conversation

tpasternak
Copy link
Collaborator

Prior to this change, IntelliJ excluded convenience symlinks by using the addExcludeFolder method. Its drawback was that it didn't work perfectly when the file didn't exist during exclusion. This might cause a race condition where some IntelliJ indexers detected new file creation in these directories while the exclusion mechanism hadn't detected the existence of the symlinks themselves.

This issue is addressed by using 'exclusion patterns' instead of 'excluded folders'. Patterns do not require the files to actually exist. However, their drawback is that they will catch files named bazel-bin and bazel-out nested deep inside the directory hierarchy, not just the top-level ones.

To address this, a project view setting has been added to disable the new behavior.

Fixes #6082

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

…mport

Prior to this change, IntelliJ excluded convenience symlinks by using the
`addExcludeFolder` method. Its drawback was that it didn't work perfectly when the file
didn't exist during exclusion. This might cause a race condition where some IntelliJ
indexers detected new file creation in these directories while the exclusion mechanism
hadn't detected the existence of the symlinks themselves.

This issue is addressed by using 'exclusion patterns' instead of 'excluded folders'.
Patterns do not require the files to actually exist. However, their drawback is that
they will catch files named `bazel-bin` and `bazel-out` nested deep inside the directory
hierarchy, not just the top-level ones.

To address this, a project view setting has been added to disable the new behavior.

Fixes bazelbuild#6082
@tpasternak tpasternak marked this pull request as ready for review February 20, 2024 08:45
@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 Feb 20, 2024
@tpasternak tpasternak assigned ujohnny and unassigned tpasternak, blorente and mai93 Feb 20, 2024
@ujohnny ujohnny merged commit 8b64eb5 into bazelbuild:master Feb 21, 2024
8 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Feb 21, 2024
@tpasternak tpasternak deleted the use-exclusion-patterns branch April 8, 2024 09:46
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.

Whole output base directory is being scanned when on the first import of bazel project
4 participants