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

Don't recurse into directories referenced by local_repository #68

Open
jayconrod opened this issue Jan 3, 2018 · 2 comments
Open

Don't recurse into directories referenced by local_repository #68

jayconrod opened this issue Jan 3, 2018 · 2 comments

Comments

@jayconrod
Copy link
Contributor

Bazel allows subdirectories within a workspace to be treated as external repositories with by referencing them with local_repository. This is useful for vendoring repositories that already have build files; import paths and labels within the vendored repository don't need to be updated.

Bazel automatically avoids building targets within these repositories. Gazelle should be aware of these repository rules and should avoid indexing and updating build files in these subdirectories.

@Globegitter
Copy link
Contributor

Just running into this now - and dependencies are generated incorrectly currently. We have an experimental directory specified as a workaround to include it in bazel build/test //... per default and in the experimental folder now instead of //path/to/dep:go_default_library we get "//experimental/path/to/dep:go_default_library",. I tried to add gazelle:exclude experimental into the root BUILD file as a workaround for now but also that does not work.

Also for our use-case we would be happy for gazelle still to process the files in the local_repository, but just creating dep paths as bazel expects. But also having two separate gazelle commands, one in the root directory and one in the local_repository would also be ok.

@garymm
Copy link

garymm commented Aug 31, 2022

Adding # gazelle:exclude <subdir that is local repo> in my root BUILD.bazel did work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants