添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 (Question/Possible bug) How to configure Bazel for CLion with Remote CLion IDE for C++ BAZEL project with protobufs & external libraries #4964 (Question/Possible bug) How to configure Bazel for CLion with Remote CLion IDE for C++ BAZEL project with protobufs & external libraries #4964 imageschool opened this issue Jun 9, 2023 · 12 comments

Description of the bug:

I am new to C++ development and currently working in a company where both Python and C++ are used extensively, with a large git repository. I'm facing difficulties in correctly setting up the (Remote) CLion IDE for a C++ BAZEL project that involves protobufs and external libraries.

Due to the size of the repository (Around 10 GB), using SSHFS for local development is not feasible as it is extremely slow (Is there any solution for this?) . Therefore, I am using the remote development feature in CLion, which is still in beta and seems to have some bugs.

I have installed the " Bazel for CLion " plugin, but when attempting to sync Bazel with Blaze, I encounter the following error: " xcode_locator should not be invoked on non-darwin systems. " It's important to note that the remote IDE is running on Linux, whereas my local machine runs MacOS.

As a newcomer to this setup, I'm unsure if the plugin is expected to configure automatically after installation or if there are additional steps I need to take. I have searched extensively on Google, but there seems to be limited information available on using CLion with Bazel.

As a temporary workaround, I uninstalled the Bazel plugin for CLion and created a fake CMakeLists.txt file using the bazel-cmakelists tool in the repository ( https://github.com/lizan/bazel-cmakelists ). CLion successfully detects most of the headers; however, it fails to include all the generated compiled protobuf files (.pb.h) and some other external libraries that are supposed to be installed with the Bazel build file.

I would greatly appreciate any guidance or assistance in resolving this issue. If anyone has experience setting up (Remote) CLion with Bazel, protobufs, and external libraries within a heavy git repository, your insights would be invaluable.

Thank you in advance for your help.

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

  • Configure any Bazel c++ project
  • Run Remote CLion IDE with bazel plugin on Linux
  • Which Intellij IDE are you using? Please provide the specific version.

    JetBrains Client 2023.1.2

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

    C++, bazel 5.4.0, Remote CLion (JetBrains Client 2023.1.2)

    What Bazel plugin version are you using?

    2023.05.30.0.1-api-version-231

    Have you found anything relevant by searching the web?

    I tried to use local development with SSHFS (But was too slow) and searched in Google for any alternative solutions but have not come up with a proper solution

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

    "xcode_locator should not be invoked on non-darwin systems."

    changed the title (Question) How to configure Bazel for CLion with Remote CLion IDE for C++ BAZEL project with protobufs & external libraries (Question/Possible bug) How to configure Bazel for CLion with Remote CLion IDE for C++ BAZEL project with protobufs & external libraries Jun 9, 2023

    Hey @imageschool , thank you for reaching us here. It seems that the "xcode_locator should not be invoked on non-darwin systems." error was just a bug we introduced recently. It should be fixed in v2023.06.13 cc @Pavank1992

    #4970

    And about remote development - unfortunately we only provide a not-very-user-friendly workaround to support it. If you open a project (instead of "import bazel project" action not available in Gateway), an empty projectview file will be created, as described in this PR #3601 . There are also some ways to override it, described there.

    @tpasternak Wow, did not know this kind of workaround existed!

    It sounds amazing as I had so much difficulty setting it up correctly.
    I will try both downgrade method & the overriding method for my C++ Bazel project. Thanks a lot and I will get back to you!

    And about remote development - unfortunately we only provide a not-very-user-friendly workaround to support it. If you open a project (instead of "import bazel project" action not available in Gateway), an empty projectview file will be created, as described in this PR #3601 . There are also some ways to override it, described there.

    @tpasternak Sync works great after downgrading!

    I must be missing something but what exactly should i do for the automatic import projects? The PR does not seem to have some instructions included, or does it?

    In .clwb/.bazelproject I just have a minimal example as below

    directories:
    derive_targets_from_directories: true
    

    Also due to the large size of repo, I need to exclude some directories but it seems not available (

    @tpasternak Oh right, automatic import is already updated and I just need to configure it on the project view file so remote IDE picks it up automatically. As described in here.

    It seems to work great, I appreciate it, it's much better experience!

    Sorry to keep bothering you,

    My Remote CLion IDE setup is perfect except that external repositories (submodules) do not sync.
    Do you know any workaround for this?

    Seems to be related to #374 and #4774 but could not find any more info on this..

    Hello @tpasternak,

    I was wondering if you could assist me with a question regarding the Remote CLion IDE. I was wondering if there is any method available to sync the external repositories, specifically the git submodules. (The codebase in the external repositories are missing IDE hints)

    I would greatly appreciate any help or guidance you could provide on these matters. Thank you kindly in advance!

    Hello @tpasternak,

    I was wondering if you could assist me with a question regarding the Remote CLion IDE. I was wondering if there is any method available to sync the external repositories, specifically the git submodules. (The codebase in the external repositories are missing IDE hints)

    I would greatly appreciate any help or guidance you could provide on these matters. Thank you kindly in advance!

    Hey @imageschool - This isn't currently supported unfortunately - I opened #4774 to request it.

    If you could upvote the ticket or leave a comment that might help it get prioritized!

    Hello @tpasternak,
    I was wondering if you could assist me with a question regarding the Remote CLion IDE. I was wondering if there is any method available to sync the external repositories, specifically the git submodules. (The codebase in the external repositories are missing IDE hints)
    I would greatly appreciate any help or guidance you could provide on these matters. Thank you kindly in advance!

    Hey @imageschool - This isn't currently supported unfortunately - I opened #4774 to request it.

    If you could upvote the ticket or leave a comment that might help it get prioritized!

    @isaactorz Thanks for letting me know and I have upvoted it!

    Is syncing the only way to provide a basic IDE support like type hinting, finding usages?

    I am struggling to find an alternative way as all my classes defined in external repositories show file not found from other cc files in my main project. If you have any tips, please share it with me!