Build Preset with Docker Toolchain starting wrong cmake after restart of CLion

Completed

We have Build Presets that use a Docker Toolchain to build Linux code on a Mac. When opening the project the first time, it runs cmake in the docker container and then when you build the projects, it executes:

/usr/bin/cmake --build ..... (correctly in the docker container)

If you close CLion, start it again and open the project, make a change and compile, then instead of calling cmake in the docker, it calls the local version. In the build view, you can see the following:

====================[ Build | TestingEngine | Linux Clang Debug ]===============
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/...../build/linux-clang-debug --target TestingEngine
CMake Error: The current CMakeCache.txt directory /Users/...../build/linux-clang-debug/CMakeCache.txt is different than the directory /tmp/..../build/linux-clang-debug where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
No such file or directory
CMake Error: Generator: execution of make failed. Make command was: /usr/bin/ninja TestingEngine && 

If you reload CMake in the CMake Tool Window, this solves the problem, but you have to recompile everything.

I found a workaround that needs less time. You can go to the Preferences->Build->CMake and enable or disable another profile without disabling the profile that uses the docker toolchain. After turning back CMake reruns as well, but it does not have to compile everything again. The object files don't seem to be deleted like if you reload the CMake settings in the CMake Tool Window.

When testing the same with a small hello world project, it works perfectly. Is this a bug or do we have a misconfiguration somewhere?

0
1 comment

Hello!

To begin with, please send the following diagnostic materials to clion-support at jetbrains.com:

  1. Reproduce the issue, do Help | Collect Logs and Diagnostic Data and send us the resulted archive. Note that logs might contain private user's information (like file paths and names).
  2. A screenshot of `Preferences | Build, Execution, Deployment | Toolchains` (please capture the screenshot after the compiler detection is completed).
  3. Your CMake Preset if possible.
0

Please sign in to leave a comment.