microsoft / microsoft/vscode-cmake-tools

Improve performance of caching

Open
#4,105 9 comments 0 reactions 0 assignees View on GitHub
enhancement Feature: configure
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

As soon as CMake Tools is done with configuring the project, it crashes the extension host.
The same happens if I use an already-configured configuration, where it only needs to read the cache.
I haven't been able to get much details, so any hints on how to provide extra information is welcome.

### CMake Tools Diagnostics

```shell
{
"os": "win32",
"vscodeVersion": "1.93.1",
"cmtVersion": "1.19.52",
"configurations": [
{
"folder": "e:\\Mega\\main",
"cmakeVersion": "3.30.2",
"configured": false,
"generator": "Ninja",
"usesPresets": true,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "always",
"configureOnOpen": true
}
]
}
```
```

### Debug Log

```shell
I used trace instead of debug as log level

[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake] Checking for new versions of NuGet packages with floating version...
[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake] Temporary project with all NuGet packages was not modified.
[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake]
[cmake] Restoring .\build\nuget\nuget-dependencies.csproj
[kit] Not reading non-existent kits file: e:\Mega\main\.vscode\cmake-kits.json
[rollbar] Invoking async function [] with Rollbar wrapping [Reloading variants file e:\Mega\main\compile_flags.txt]
[variant] Invalid variants specified:
[variant] >> : should be object
[variant] Loaded default variants
[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake] NuGet restore is not required.
[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake] -- Configuring done (29.1s)
[extension] [4667] cmake.logDiagnostics started
[extension] [4667] cmake.logDiagnostics finished (returned undefined)
[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake] -- Generating done (67.5s)
[rollbar] Invoking function [$] with Rollbar wrapping [$Processing "data" event from proc stdout]
[cmake] -- Build files have been written to: E:/Mega/main/.out/asan-clangcl
[rollbar] Invoking function [$] with Rollbar wrapping [$Resolving process on "close" event]
[cmakefileapi-driver]
[cmakefileapi-driver] Checking for new versions of NuGet packages with floating version...
Temporary project with all NuGet packages was not modified.

Restoring .\build\nuget\nuget-dependencies.csproj
NuGet restore is not required.
-- Configuring done (29.1s)
-- Generating done (67.5s)
-- Build files have been written to: E:/Mega/main/.out/asan-clangcl

[cmakefileapi-parser] Read reply folder: E:\Mega\main\.out\asan-clangcl\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-df5af9cfa1bf6faef9ac.json","cmakeFiles-v1-b69ee9cd2ad46d595f75.json" ...
[rollbar] Invoking async function [] with Rollbar wrapping [Update code model for cpptools]
[extension] Not updating the configuration provider because "C_Cpp.intelliSenseEngine" is set to "Disabled"
```
```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

The payload names no source file or test. Begin by reproducing the crash after configuration and during cache-only startup, then inspect the cmakefileapi-parser path handling the .cmake/api/v1/reply cache-v2 JSON shown in the trace. Done means the extension host remains stable in both scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript, vscode
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.