bazelbuild / intellij

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

Ray Code cannot be recognized in CLion. #6389

Open louj1988 opened 4 months ago

louj1988 commented 4 months ago

Description of the issue. Please be specific.

What's the simplest set of steps to reproduce this issue? Please provide an example project, if possible.

Recently, I've been studying and researching Ray, which is a project built with Bazel. I've installed Bazel locally, and I can compile successfully. However, when using CLion Bazel project, the code is not recognized. I've tried options in the Bazel plugin menu, but they didn't work.

image

Version information

CLion: 2024.1 Platform: Mac OS X 14.1 Bazel for CLion plugin: 2024.03.26.0.1-api-version-241 Bazel: 5.4.1

louj1988 commented 4 months ago

Clion can't seem to get it recognized. Any suggestions?

LeFrosch commented 4 months ago

Hi @louj1988, thanks for sharing this issue. I am assuming you are trying to edit the ray source code using CLion. However, I was not able to reproduce your issue. Could you maybe share your project view file? You can find this file under Bazel -> Project -> Open Project View File. Also I noticed that syncing the entire project yields many errors. Maybe a more restricted view could help. You can try restricting the bazel plugin to only the source directory using the project view file:

directories:
  # Add the directories you want added as source here
  # By default, we've added your entire workspace ('.')

  # Add the next line to your project view file
  src 

# Automatically includes all relevant targets under the 'directories' above
derive_targets_from_directories: true

targets:
  # If source code isn't resolving, add additional targets that compile it here

additional_languages:
  # Uncomment any additional languages you want supported
  # dart
  # javascript
  # python
  # typescript
hujianxin commented 4 months ago

same issue in my own project 😢

LeFrosch commented 4 months ago

Hi @hujianxin, sorry to hear that. Could you please share more details. What is not working and what have you tried?

brt-alexei commented 4 months ago

I'm also having similar problem. One thing I've noticed. These third party libraries are using "includes" attribute of cc_library. In particular, grpc has

        includes = [
            "api/include",
            "include",
            "src/core/ext/upb-generated",  # Once upb code-gen issue is resolved, remove this.
            "src/core/ext/upbdefs-generated",  # Once upb code-gen issue is resolved, remove this.
        ],

yet, when I do "Copy search path to clipboard", these folders are missing. Only main folder of cc_library is there:

/home/user/.cache/bazel/_bazel_user/650b5629231673163f54992a623cc0a9/external/com_github_grpc_grpc
/home/user/.cache/bazel/_bazel_user/650b5629231673163f54992a623cc0a9/execroot/repo/bazel-out/k8-opt/bin/external/com_github_grpc_grpc

CLion 2024.1.1 Bazel plugin 2024.04.09.0.1-api-version-241