Skip to content

Configuring two CMake presets using Visual Studio's vcpkg concurrently fails #2066

Description

@Cyphall

When configuring two CMake presets concurrently via CLion, with each CMake preset invoking Visual Studio's vcpkg in manifest mode, one of them randomly fails.

Here is the logs of the failing one:

-- Running vcpkg install
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for boost-optional
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for boost-scope
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for glfw3
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for glm
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for magic-enum
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for spdlog
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for vcpkg-cmake
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for vcpkg-cmake-config
error: "c:\program files\git\cmd\git.exe" "--git-dir=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\Cyphall\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init failed with exit code 128
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/hooks/commit-msg.sample' to 'C:/Users/Cyphall/AppData/Local/vcpkg/registries/git/.git/hooks/commit-msg.sample': File exists

while loading baseline version for vulkan-headers
-- Running vcpkg install - failed
CMake Error at C:/Program Files/Microsoft Visual Studio/18/Community/VC/vcpkg/scripts/buildsystems/vcpkg.cmake:953 (message):
  vcpkg install failed.  See logs for more information:
  C:\Projects\CPP\CyphGPU\build\Windows-MSVC-Profile\vcpkg-manifest-install.log
Call Stack (most recent call first):
  C:/Users/Cyphall/AppData/Local/Programs/CLion/bin/cmake/win/x64/share/cmake-4.2/Modules/CMakeDetermineSystem.cmake:146 (include)
  CMakeLists.txt:5 (project)


CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!

The failure seems to be due to both vcpkg runs using the same registries directory concurrently without any lock.

This issue presumably started happening after the 2026.04.27 release (which includes PR #1938) as before that, the lock was on the VCPKG_ROOT, so two vcpkg runs could not run in parallel at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions