-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any reference to ${command:cmake.getLaunchTargetPath} will reconfigure after a cmake configure task #2878
Comments
Thank you for reporting this issue. We will take a look into it. |
@trondhe Following up on this. Are you still able to reproduce this issue? If so, could you please help us repro by providing an example/repro project? Looking forward to investigating this. |
I am not sure if something changed since last time, not sure it behaves quite the same as before. However there is still a common (to me) flow that often happens. This order of sequence will always end up re-configuring twice for me:
This simple project gives a reproducible setup running the // .vscode/tasks.json
{
"version": "2.0.0",
"windows": {
"options": {
"shell": {
"executable": "powershell.exe"
}
}
},
"tasks": [
{
"label": "_cmake configure",
"type": "cmake",
"command": "configure",
"preset": "${command:cmake.activeConfigurePresetName}",
},
{
"label": "_cmake build",
"type": "cmake",
"command": "build",
"preset": "${command:cmake.activeConfigurePresetName}",
"targets": [
"${command:cmake.buildTargetName}"
],
},
{
"label": "_cmake run target",
"type": "shell",
"command": "${command:cmake.getLaunchTargetPath}",
"dependsOn": "cmake build",
},
]
} # CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(test)
add_executable(mybin main.cpp)
set(seconds 3)
message("Intentionally sleeping for ${seconds} seconds to slow down configure step")
foreach(i RANGE 1 ${seconds})
message("${i} sec")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)
endforeach() // CMakePresets.json
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"displayName": "Default Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/default"
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
}
]
} // main.cpp
#include <iostream>
int main() {
std::cout << "Hello, World!\n";
return 0;
} |
More direct breakage which I think was my original problem: Same initial steps to the problem
|
@trondhe Do you have any automatic configuring settings turned on? For example: Thanks for any information that could help. Running |
Its because it automatically has already configured it for you via the extension. Here is a video that reproduces how it re-configures twice. (btw snipping tool is awesome, just wish it could set a target export size) cmake_double_reconfigure_repro.mp4Here is the diagnostics: {
"os": "win32",
"vscodeVersion": "1.80.1",
"cmtVersion": "1.14.34",
"configurations": [
{
"folder": "c:\\repos\\cmaketoolstest",
"cmakeVersion": "3.26.3",
"configured": true,
"generator": "Ninja",
"usesPresets": true,
"compilers": {
"C": "C:/Programs/LLVM/bin/clang.exe",
"CXX": "C:/Programs/LLVM/bin/clang++.exe"
}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": false
}
]
} |
I successfully am able to reproduce now. I will investigate the issue. Thanks for helping me get the repro! |
Brief Issue Summary
Running a configure task such as
to completion, build with
a follow up with
will always reconfigure.
It seems that the
command:cmake.<vars>
state are not saved/fetched when using a cmake configure task. Such that the extension itself need to load it by doing a configure for itself.Deleting the build folder, configuring, building and running the
cmake run target
task directly after this does not make it reconfigure a second time, which I guess perhaps is also wrong?If one does
Ctrl+shift+p
->Developer: Reload window
after the project is fully configured and built, thecmake run target
task will make the cmake tools extension reconfigure again.CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: