Importing Bazel project gets stuck / does not finish
Description of the bug:
When I try to import a new Bazel project (File > Import Bazel Project...), the new project window immediately gets stuck with a dialog window and a spinning wheel, making CLion unusable.
This state never finishes. Therefore, I am unable to importing projects / project clones which I did not import before.
I can still open Bazel projects which I imported before with older versions of CLion and "Bazel for CLion" and (around 2025-05), but I cannot say at which point the import stopped working.
Project size does not seem to be relevant. Even the official hello world examples (e.g. https://github.com/bazelbuild/examples/tree/main/cpp-tutorial/stage1) cannot be imported.
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.
- Clone https://github.com/bazelbuild/examples
- In CLion: File > Import Bazel Project...
- Workspace = .../examples/cpp-tutorial/stage1 > Next
- Create from scratch > Next
- Create
(Always trust project)
Which Intellij IDE are you using? Please provide the specific version.
CLion 2025.2.1
What programming languages and tools are you using? Please provide specific versions.
C++
What Bazel plugin version are you using?
2025.08.04-api-version-252
Have you found anything relevant by searching the web?
No, I did not find reports of the whole IDE getting stuck when importing a project.
Any other information, logs, or outputs that you want to share?
I have zero introspection into what is blocking, as there are no tool windows, consoles, ... in the new window. I can try to provide log files if someone points me to where they are. I can press "Cancel" in the opened dialog to abort the import.
Could you please invoke jstack on clion process and share a thread dump with us? Thanks!
Hi @ujohnny, thank your for the response. Please find the output of jstack in the attached file.
For clarity, here is what I did:
- Use the JetBrains Toolbox to start CLion, opening an already imported Bazel project.
- Make sure there is no .clwb directory in the Bazel project I want to import in the next step.
- Use "Import Bazel Project..." as described above, selecting the C++ hello world example mentioned above.
- Wait a second until the screen above is visible (initial CLion window from step 1 is still open).
- Execute
jstack 1074448 > clion-jstack.txt 2>&1(where 1074448 should be the PID of CLion process). - (Redact the name and path of opened project from step 1 from dump file.)
I hope this helps in tracking down the cause. Thank you!
Might be a deadlock with Rider Backend startup, but not sure. cc @ujohnny
@rkartmann thanks, I checked the thread dump and I see one part of a deadlock, while I can't find the other part, who's holding the lock preventing lock acquisition for project opening. Can you invoke submit a bug report and share a link to youtrack ticket or link to uploads.jetbrains.com you'll get automatically filled to the ticket description?
Hi @ujohnny, thank you for looking into it and sorry for my late reply.
For some reason, I cannot reproduce the issue anymore. The version of the Bazel plugin is still the same as when I opened this issue (and I deliberately did not update it), but I am using CLion 2025.2 now (instead of CLion 2025.2.1), so maybe that fixed the issue. A colleague of mine also reported that it now works for him.
I would like to reproduce the issue to do what you suggested, but the JetBrains toolbox offers no quick way to switch back to CLion 2025.2.1.
So if you agree, we can consider this issue fixed with a newer version of CLion and/or the Bazel plugin. Thank you for your efforts!