vscode-cmake-tools
                                
                                 vscode-cmake-tools copied to clipboard
                                
                                    vscode-cmake-tools copied to clipboard
                            
                            
                            
                        corrupt .cmake folder is handled poorly
So I ran find -name '*.json' | xargs rm in my build folder to clean up clang's time traces.
Then I couldn't build anymore, only getting this unhelpful error message:
https://github.com/microsoft/vscode-cmake-tools/blob/38eccc58c403b68d93cf9015715d55f3e9e7a302/src/drivers/cmfileapi-driver.ts#L222
That code location was the only hint I had. Luckily I happen to know that the .cmake folder contains CMake File API json files. Removing it completely solved my problem but the cmake extension should take care of this reset, or at least give a useful hint.
Platform and Versions
- Operating System: Win 10.0.19042 WSL2
- CMake Version: 3.17.3
- VSCode Version: 1.51
- CMake Tools Extension Version: 1.5.2
Thank you for opening this issue. We understand this experience can be improved. Also, one question: you got the "no cache object found" error even if you didn't delete the CMakeCache.txt? Or you only deleted the clang time traces, CMakeCache.txt remained intact, and the extension still errored about it being not found?
Yes I didn't touch the CMakeCache.txt file, at least not knowingly. Maybe I ran Delete and Reconfigure after getting the error popup but I can't remember doing that.
This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label.
I guess this is still valid.
@Trass3r To clarify, the situation is that you manually edit / delete parts of your build folder, and then it fails with this error?
Would it be sufficient to improve the error message? I'm not sure it's desirable to automatically ever delete cache and reconfigure. Any input on this would be great so that we can make it best for users.
Yeah as described the intention was to just clean up clang's time trace json files and it accidentally corrupted the .cmake folder. So this is not about the cmake cache, it's https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html internal files.
I faced the same issue today and I only rebuilt my container with new dependencies without touching the build folder. However one interesting thing is that I encountered this error not only while trying to build but also while trying to clean all my build files and also when I tried a clean rebuild.
@Trass3r @aashrithh Have you tried to delete the cache folder and completely reconfigure? Overall, it's not totally unexpected to hit issues if you manually delete files in your cache files without us knowing about it.