vscode-cmake-tools
vscode-cmake-tools copied to clipboard
No cache object found when manually configuring build folder before cmake-tools
Brief Issue Summary
Only way to get rid of the error [rollbar] Unhandled exception: Unhandled Promise rejection: Post-folder-open Error: No cache object found [object Object]
Is to remove build folder and then ask cmake-tools to configure without configuring with terminal.
What I tried:
- Reset Cmake Tool Extension
- rm -rf build &&
cmake -C CMakeConfig/linux_gcc7.cmake --preset=gcc7_linux_x86_64 -DAMSR_BUILD_TESTING=ON -DAMSR_BUILD_TEST2020=ON -DAMSR_BUILD_DOC=ON -DAMSR_BUILD_EXAMPLE=ON
-DBULLSEYE_ENABLE=ON -DAMSR_BUILD_BENCHMARK=ON -DCMAKE_CXX_FLAGS=(string join ' ' (cmake -LA -N . | grep CMAKE_CXX_FLAGS_INIT |
cut -d= -f2) -- "-Wfatal-errors") -DAMSR_BUILD_TEST2020=ON -DAMSR_BUILD_TESTING=ON -DCMAKE_CXX_FLAGS_DEBUG="-g -O0"
We have a LOT of presets and targets. A gazillion .jsons are created, might be related
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
@mortenfc Thank you for posting this issue. If you reopen the project a bit and then configure it in the terminal does it work? Can you provide a simple reproduction of the project and some detailed reproduction steps to help us quickly investigate this issue?:)
That's gonna be hard. perhaps you know some open source repo with a lot of targets and prefixes? Then I can play around with that
@gcampbell-msft Can you help find a: https://github.com/microsoft/vscode-cmake-tools/issues/4132#issuecomment-2422410463source code repository mentioned by a user? He will use the library we provided to reproduce the problem.
@mortenfc There are a couple of large open source projects that we use commonly for testing. Here are two: https://github.com/Kitware/CMake, https://github.com/ninja-build/ninja
I figured out removing <build_dir>/.cmake/api and then reconfiguring is enough to fix the problem. Perhaps, in short term, the user should be told to try and remove that instead of the mysterious " No cache object found "
@mortenfc Thanks for looking into this and We're happy to see your issue resolved. We'll wait for more polls before posting your suggestion!
@mortenfc We also have this setting: cmake.deleteBuildDirOnCleanConfigure that deletes the entire folder when a clean is performed.
Okay. That is not desirable to me as bunch of cached things exist in build dir, mainly clangd index files which takes over an hour to generate.
@mortenfc Got it, that makes sense, thanks for the insight, in that case, I think I'll re-open this issue and mark it as an enhancement with the idea that we can possibly give some remediation suggestions in the output message rather than simply "No cache object found".