Skip to content

Improve performance of vcpkg-tool install #29857

Description

@clemenswasser

Is your feature request related to a problem? Please describe.
When setting CMAKE_TOOLCHAIN_PATH to scripts/buildsystems/vcpkg.cmake and using manifest-mode, the vcpkg install command gets run for every CMake rerun. Even if all packages are already installed, this step takes 1.7s on my machine, which is a major delay when working on your Project's CMake Build system with an IDE that re-runs CMake on every edit (e. g. Visual Studio).
Where the time is currently being spent:

PowerShellCoreProvider::get_version 263.1 ms
cmd_execute_and_capture_environment (Executing vcvarsall.bat) 669.5 ms
cmd_execute_and_stream_lines (Executing cmake to detect the compiler) 606.2 ms

Proposed solution
Please either get rid of some steps in vcpkg install or make them faster.
For example, when using vcpkg.cmake we could avoid having to detect the compiler again in vcpkg install.
I have already tried to use GetFileVersionInfoW to detect the PowerShell Core version, but got into some trouble with the fake "app execution alias"/symlink in C:\Users\%USERNAME%\AppData\Local\Microsoft\WindowsApps\

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Labels

Stalecategory:vcpkg-featureThe issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions