vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

[Bug][Regression] Project cannot stop build after setting "cmake.buildTask" as true

Open Amy-Li03 opened this issue 6 months ago • 6 comments

Brief Issue Summary

Environment:

VS Code 1.100.2+ CMake Tools v1.21.27 (pre-release)

More info:

  1. Repro on Windows, Linux, Mac
  2. It starts repro from v1.21.5 to latest v1.21.27, so this is a regression issue
  3. This issue doesn't repro when disable cmake.buildTask

Repro steps:

  1. Create a folder and open it with VS Code
  2. Open workspace settings.json, and set "cmake.buildTask": true
  3. Create project using command "CMake: Quick Start"
  4. Reopen project
  5. Open the command palette(F1 or Ctrl+Shift+P)
  6. Enter and select the command "Tasks: Configure Task"
  7. Choose "CMake: build"
  8. Select the Build button from the Status bar and select a build task

test_project.zip

Expected Result:

Project should build successfully Image

Actual Result:

Project cannot stop build Image

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.100.2",
  "cmtVersion": "1.21.27",
  "configurations": [
    {
      "folder": "c:\\Users\\v-amyli3\\Desktop\\Cmake_tools_Monthly\\test_project",
      "cmakeVersion": "3.31.5",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {
        "C": "C:/msys64/ucrt64/bin/cc.exe",
        "CXX": "C:/msys64/ucrt64/bin/c++.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 1,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "Helloworld",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: C:/Users/v-amyli3/Desktop/Cmake_tools_Monthly/test_project/out/build/MyPresets 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build 
[proc] Executing command: chcp

Additional Information

No response

Amy-Li03 avatar May 22 '25 02:05 Amy-Li03

Hi @gcampbell-msft @PILIX123, it seems to have the same root cause as https://github.com/microsoft/vscode-cmake-tools/issues/4424

Amy-Li03 avatar May 22 '25 02:05 Amy-Li03

i will make a fork this weekend with the patch i found the other day and we could try and see if this still happens? @Amy-Li03

PILIX123 avatar May 28 '25 13:05 PILIX123

@Amy-Li03 https://github.com/PILIX123/vscode-cmake-tools/tree/main this branch has the potential fix i was talking about. can you try and see if it fixes it, if so im going to open a PR

PILIX123 avatar Jun 09 '25 22:06 PILIX123

@PILIX123 Thanks for your fix!

After installed the VSIX built from https://github.com/PILIX123/vscode-cmake-tools/tree/main branch, this issue was fixed. But the VSXI version of cmake tools is 1.13.0, is this the correct version number?

Image

Amy-Li03 avatar Jun 10 '25 01:06 Amy-Li03

The version number should match when the PR is merged correct?

PILIX123 avatar Jun 10 '25 13:06 PILIX123

I opened the PR for it https://github.com/microsoft/vscode-cmake-tools/pull/4479

PILIX123 avatar Jun 10 '25 13:06 PILIX123

Verified on CMake Tools v1.21.31(pre-release), issue was fixed, so close it.

Image

Amy-Li03 avatar Jun 19 '25 07:06 Amy-Li03