You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make configure-on-open resilient to delayed CMake availability (#4880)
* Fix false 'Bad CMake executable' error when vendor extension is still installing CMake
When a vendor extension (e.g., STM32 for VS Code, ESP-IDF) is still
downloading or installing CMake at the time CMake Tools activates,
the automatic configure-on-open would immediately show a misleading
'Bad CMake executable' error popup.
This change checks cmake availability before the initial configure
attempt. When cmake is not found, it polls with exponential backoff
(2s, 4s, 8s, 16s) using a lightweight getCMakeExecutable() probe
that does not enter the driver strand or trigger error popups. If
cmake becomes available during the retry window, a single configure
runs. If not, the standard error popup fires once after retries
exhaust.
Also fixes reloadCMakeDriver() silently doing nothing when the CMake
driver was never created (null). The method now always disposes the
old driver if present and (re)creates a new one when cmake is
available, or resets to null otherwise. This ensures that changing
cmake.cmakePath in settings takes effect even if the initial cmake
lookup failed.
* Wait for vendor-managed CMake before failing configure-on-open
Add `cmake.vendorIntegrators`, a string array that defaults to
`["ST", "Espressif", "NXP", "Nordic"]`.
During automatic configure-on-open, if CMake is missing but one of
those vendor extensions is installed, do not fail right away. Some of
those extensions install or expose CMake asynchronously, so we now poll
for it with exponential backoff at 2s, 4s, 8s, and 16s before surfacing
the error.
For users without one of those extensions, nothing changes: they still
see the error immediately.
Also fix `reloadCMakeDriver()`. If the CMake driver was never created,
the method used to silently do nothing. It now creates or recreates the
driver when `cmake.cmakePath` changes, even if the initial lookup
failed.
* rename to be more comprehensive
---------
Co-authored-by: Hannia Valera <[email protected]>
Copy file name to clipboardExpand all lines: docs/cmake-settings.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ Options that support substitution, in the table below, allow variable references
28
28
|`cmake.configureEnvironment`| An object containing `key:value` pairs of environment variables, which will be passed to CMake only when configuring.|`null` (no environment variable pairs) | yes |
29
29
|`cmake.configureOnEdit`| Automatically configure CMake project directories when the path in the `cmake.sourceDirectory` setting is updated or when `CMakeLists.txt` or `*.cmake` files are saved. |`true`| no |
30
30
|`cmake.configureOnOpen`| Automatically configure CMake project directories when they are opened. |`true`| no |
31
+
|`cmake.cmakeProviderExtensions`| List of VS Code extension IDs that provide or install their own CMake binary. When CMake is not found during automatic configure-on-open and one of these extensions is installed, CMake Tools will briefly poll for CMake availability instead of showing an immediate error. Set to an empty array to disable this behavior. |`["stmicroelectronics.stm32-vscode-extension", "espressif.esp-idf-extension", "NXPSemiconductors.mcuxpresso", "nordic-semiconductor.nrf-connect"]`| no |
31
32
|`cmake.configureSettings`| An object containing `key:value` pairs, which will be passed to CMake when configuring. The same as passing `-DVAR_NAME=ON` via `cmake.configureArgs`. NOTE: Semicolons (`;`) in string values are automatically escaped to prevent CMake from interpreting them as list separators. If you want to pass a CMake list, use array notation instead, e.g. `"MY_LIST": [ "a", "b" ]`. |`{}` (no values) | yes |
32
33
|`cmake.copyCompileCommands`| If not `null`, copies the `compile_commands.json` file generated by CMake to the path specified by this setting whenever CMake successfully configures. |`null` (do not copy the file) | yes |
33
34
|`cmake.postConfigureTask`| If not `null`, the task with this name is executed whenever CMake successfully configures. |`null` (do not run any task) | yes |
Copy file name to clipboardExpand all lines: package.nls.json
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -275,6 +275,7 @@
275
275
"cmake-tools.configuration.cmake.postConfigureTask.description": "If set, this named task will be executed after a successful CMake configure.",
276
276
"cmake-tools.configuration.cmake.configureOnOpen.description": "Automatically configure CMake project directories when they are opened.",
277
277
"cmake-tools.configuration.cmake.configureOnEdit.description": "Automatically configure CMake project directories when cmake.sourceDirectory or CMakeLists.txt content are saved.",
278
+
"cmake-tools.configuration.cmake.cmakeProviderExtensions.description": "List of VS Code extension IDs that provide or install their own CMake binary. When CMake is not found during automatic configure-on-open and one of these extensions is installed, CMake Tools will briefly poll for CMake availability instead of showing an immediate error. Set to an empty array to disable this behavior.",
278
279
"cmake-tools.configuration.cmake.deleteBuildDirOnCleanConfigure.description": "Delete the entire build directory when a clean configure is invoked.",
279
280
"cmake-tools.configuration.cmake.setBuildTypeOnMultiConfig.description": "Set CMAKE_BUILD_TYPE also on multi config generators.",
280
281
"cmake-tools.configuration.cmake.skipConfigureIfCachePresent.description": "Skip over the configure process if cache is present.",
0 commit comments