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

Resolve symbolic links from external workspace to workspace root #5228

Merged

Conversation

ujohnny
Copy link
Collaborator

@ujohnny ujohnny commented Aug 11, 2023

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: #4774

Description of this change

This PR addresses 2 issues both related to symbolic links from external workspace to workspace root.
When some catalog from project is added via local_repository then bazel sets up symbolic link from
external workspace location to project, but CLion, for example, considers symbolic links as files itself,
thus the real files beneath links are either not marked as synced or not used for header location
resolution. This PR introduces the ability to resolve real files by following symbolic links what fixes #4774.

@github-actions github-actions bot added product: Android Studio Android Studio plugin product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Aug 11, 2023
If some header search path to external workspace
actually points to workspace files then resolve
it to workspace path so code navigation is performed
to project files.
If source artifact points to project workspace then
resolve it to project location so project files should
be marked as synced in project view.
If external workspace for some reason is located inside the
project (ie as a git submodule and added as local_repository)
then add it to resolve configurations and include in project
indexing to provide proper code insight. This will allow to
jump to definitions of thirdparty code or find usages etc.
Require external target directory within project to be listed
in directories section of project view file. Also introduces
registry key "bazel.cpp.sync.external.targets.from.directories"
which can be used to disable mentioned external targets sync.
@ujohnny ujohnny force-pushed the enovozhilov/external-workspace-to-project branch from c54a34b to 8946c22 Compare September 22, 2023 08:38
@tpasternak tpasternak merged commit 5f6f15d into bazelbuild:master Sep 22, 2023
6 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: Android Studio Android Studio plugin product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
Development

Successfully merging this pull request may close these issues.

clion: external repositories do not sync with the IDE
2 participants