microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 451 forks source link

cmake.buildTask does not recognize errors #3389

Open Maddimax opened 11 months ago

Maddimax commented 11 months ago

Brief Issue Summary

When using "cmake.buildTask" a debug run is started even if the build failed.

How to reproduce:

=> The build will fail, but the debug will still start

CMake Tools Diagnostics

{
  "os": "darwin",
  "vscodeVersion": "1.83.0",
  "cmtVersion": "1.16.10",
  "configurations": [
    {
      "folder": "/Users/mtillmanns/projects/qt/qtc-work/master",
      "cmakeVersion": "3.27.1",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "/usr/bin/clang",
        "CXX": "/usr/bin/clang++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "never",
      "configureOnOpen": false
    }
  ]
}

Debug Log

n/a

Additional Information

My launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug Current Target",
            "program": "${command:cmake.launchTargetPath}",
            "args": [],
            "cwd": "${workspaceFolder}",
        }
    ]
}

My tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cmake",
            "label": "CMake: Build the active target",
            "command": "build",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "CMake template build task",
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": true
            },
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": "absolute"
            },
            "options": {
                "environment": {
                    "CMAKE_COLOR_DIAGNOSTICS": "1",
                    "CLICOLOR_FORCE": "1"
                }
            }
        }
    ]
}
gcampbell-msft commented 10 months ago

@Maddimax This is a good call-out, and thanks for the reproduction steps! Marking this as a bug and we will assess it when we can. Thanks!

Maddimax commented 9 hours ago

Any chance this may be worked on? Its quite annoying :)