Open benschreiber opened 1 month ago
@benschreiber Thank you for your github issue! We followed the command you provided to reproduce the issue, but we encountered error below, in order to better reproduce and solve your issue, could you provide us with your reproduction steps video and reproduction file?
It looks like you are on windows? Then you can modify the preset to use MSVC and the VS Generator. But it would be easier to just try to reproduce on Linux or in WSL.
@Yingzi1234 If you're still stuck, try using this devcontainer.json
{
"image": "mcr.microsoft.com/devcontainers/cpp:debian-12",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}
}
}
@benschreiber Thanks for your reply, based on the latest information you provided, we tried to reproduce your issue on a Linux machine, but are not sure if we got the same results as your issue. When I run the "CMake: configure" command, an error box pops up, but when I go to the output window, the contents show that my configuration was successful. Here's a recording of my reproduction for you to check out. GitHub issue.webm
@Yingzi1234 Yes, that is the same behavior I see. I know that the configure step was successful, but the error box should not pop up.
Hi @gcampbell-msft, based on customer repro steps we can reproduced this issue on Linux platform(Configuration was successful but an error box appears), you can get the details below and we have been changed the issue's status to "Bug" if it is incorrect, could you help change it to the correct label? Thank you in advance!
ENV:
Repro steps:
cmake_minimum_required(VERSION 3.27)
project(foo)
enable_testing()
file(CONFIGURE OUTPUT ${PROJECT_BINARY_DIR}/createTestLabels.cmake CONTENT "execute_process(COMMAND @CMAKE_COMMAND@ -E echo \"Generating test labels...\")\n" @ONLY )
set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES ${PROJECT_BINARY_DIR}/createTestLabels.cmake )
3. Create a CMakePresets.json file and paste the following into it
{ "version": 6, "configurePresets": [ { "name": "gcc-debug", "binaryDir": "${sourceDir}/out/build/${presetName}", "cacheVariables": { "CMAKE_CXX_COMPILER": "g++", "CMAKE_BUILD_TYPE": "Debug" }, "generator": "Unix Makefiles" } ], "buildPresets": [ { "name": "gcc-debug", "configurePreset": "gcc-debug" } ], "testPresets": [ { "name": "gcc-debug", "configurePreset": "gcc-debug" } ] }
4. Create a devcontainer.json file and paste the following into it
{ "image": "mcr.microsoft.com/devcontainers/cpp:debian-12", "customizations": { "vscode": { "extensions": [ "ms-vscode.cpptools", "ms-vscode.cmake-tools" ] } } }
5. After saving all, click F1 to run "CMake: configure" command
**Actual result:**
It shows that "Configuring done" and "Generating done" but pops up with an error message: _"Unexpected token 'G', "Generating"... is not valid JSON"_
[GitHub issue.webm](https://github.com/microsoft/vscode-cmake-tools/assets/101234795/db896b9f-e864-4bc3-8848-c6db048fdc4f)
Brief Issue Summary
My project uses TEST_INCLUDE_FILES to generate labels for CTest tests at runtime.
Our script prints a line
Generating test labels...
to stdout. This causes CMake Tools to report an error when configuring.This can easily be reproduced.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response