bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
761 stars 303 forks source link

Disable indexing and watching of files in special directories #2032

Open dlsniper opened 4 years ago

dlsniper commented 4 years ago

Hello, I'm forwarding the following piece of feedback for the plugin:

  • by default bazel creates several "convenient symlinks" to the bazel-bin/bazel-out directory within the workspace, containing several million files. Opening a project with those folders nearly crashes Goland. Luckily it's possible to disable those symlinks in the bazelrc file.

As a proposed solution, it would be better if the user doesn't need to disable the symlink feature in the bazelrc but have the plugin automatically ignore the bazel-bin and bazel-out from the indexing and watching for changes features.

Original comment with the feedback.

Thank you.

rdesgroppes commented 1 year ago

On my machine, straceing the fsnotifier process indeed shows millions of watches on Bazel cache entries looking like:

inotify_add_watch(3, "$HOME/.cache/bazel/_bazel_$LOGNAME/$DIGEST/execroot/...
inotify_add_watch(3, "$HOME/.cache/bazel/_bazel_$LOGNAME/$DIGEST/external/...
inotify_add_watch(3, "$HOME/.cache/bazel/_bazel_$LOGNAME/install/$DIGEST/...
rdesgroppes commented 1 year ago

A workaround consists in a filtering wrapper script :

#!/usr/bin/env sh

grep -v -F /_bazel_ | /path/to/original/bin/fsnotifier "$@"

... declared in idea.properties:

# custom IntelliJ IDEA properties (expand/override 'bin/idea.properties')

idea.filewatcher.executable.path=/path/to/my/bin/fsnotifier-wrapper
sgowroji commented 1 year ago

@rdesgroppes Thanks for sharing the workaround. @dlsniper Feel free to reach if you still have any further queries on the same.

dlsniper commented 1 year ago

@sgowroji while the workaround is good, I don't think this issue is closed. I don't expect many/all people using the plugin to come to this thread and apply the workaround. The plugin should really take care of this on its own and handle this case.

rdesgroppes commented 1 year ago

Right, such a workaround had only be crafted to buy some time. Thanks for having reopened the issue.

github-actions[bot] commented 11 months ago

Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-maintainer". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

jschaf commented 11 months ago

Still relevant: @bazelbuild/triage isn't a GitHub team so not sure who to reach out to.