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

Not able to resolve headers when using bazel mod #7003

Open
tusharg1993 opened this issue Nov 19, 2024 · 0 comments
Open

Not able to resolve headers when using bazel mod #7003

tusharg1993 opened this issue Nov 19, 2024 · 0 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: CLion CLion plugin type: bug

Comments

@tusharg1993
Copy link

tusharg1993 commented Nov 19, 2024

Description of the bug:

CLion is not able to resolve the headers for Bazel mod dependencies. Whenever I try to navigate to the header, it simply fails to do so.

However, the same version of the repo with WORKSPACE files is working fine with CLion and able to navigate the headers and symbols just fine.

I am using Bazel version 7.4.1. I tried to debug by checking the compiler information for hello_test.cc (see repro information below), and only difference I found was the ~ character at the end of the module names in case of bazel mod setup.

Here is the snip of Header Search paths between WORKSPACE (working) and Bazel mod (not working). Let me know if you want me to share the full compiler information printed out by the CLion.

WORKSPACE

Header Search paths:
	Pointer(user): file:///home/tgoyal/crap/abseil-hello/bazel-hello
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/execroot/_main/bazel-out/k8-fastbuild/bin
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/com_google_absl
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/com_google_googletest
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/bazel_tools
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/com_google_googletest/googlemock
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/com_google_googletest/googlemock/include
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/com_google_googletest/googletest
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/com_google_googletest/googletest/include
	Pointer: file:///usr/include/c++/11.2.0
	Pointer: file:///usr/include/c++/11.2.0/x86_64-pc-linux-gnu
	Pointer: file:///usr/include/c++/11.2.0/backward
	Pointer: file:///usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include
	Pointer: file:///usr/local/include
	Pointer: file:///usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include-fixed
	Pointer: file:///usr/include

Bazel Mod

Header Search paths:
	Pointer(user): file:///home/tgoyal/crap/abseil-hello/bazel-hello
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/execroot/_main/bazel-out/k8-fastbuild/bin
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/abseil-cpp~
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/googletest~
	Pointer(user): file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/bazel_tools
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/googletest~/googlemock
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/googletest~/googlemock/include
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/googletest~/googletest
	Pointer: file:///home/tgoyal/.cache/bazel/_bazel_tgoyal/c8b9105b783a7ea15548cb37d0f0cabf/external/googletest~/googletest/include
	Pointer: file:///usr/include/c++/11.2.0
	Pointer: file:///usr/include/c++/11.2.0/x86_64-pc-linux-gnu
	Pointer: file:///usr/include/c++/11.2.0/backward
	Pointer: file:///usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include
	Pointer: file:///usr/local/include
	Pointer: file:///usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include-fixed
	Pointer: file:///usr/include

Which category does this issue belong to?

CLion

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Use https://github.com/abseil/abseil-hello/tree/master/bazel-hello repo to reproduce the issue.

The latest commit (d4018e85a8764c3adcf21074b78089b5f5dc806b) contains the setup based on bazel mod. Previous commit (b4803b41ab3d58c503265148e5a7d3fd2a8e46d3) contains the setup based on WORKSPACE.

I had to upgrade googletest binary to 1.15.2 in both of the cases. (It was primarily to fix the issue with bazel 7.4.1).

Which Intellij IDE are you using? Please provide the specific version.

CLion 2024.2.3 Build #CL-242.23726.125, built on October 27, 2024

What programming languages and tools are you using? Please provide specific versions.

C++ gcc version 11.2.0

What Bazel plugin version are you using?

Bazel for CLion 2024.10.22.0.1-api-version-242

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@tusharg1993 tusharg1993 added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Nov 19, 2024
@github-actions github-actions bot added the product: CLion CLion plugin label Nov 19, 2024
@ujohnny ujohnny assigned LeFrosch and unassigned ujohnny Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: CLion CLion plugin type: bug
Projects
Status: Untriaged
Development

No branches or pull requests

3 participants