Repository navigation
Conversation
This fixes to copying in MSBuild jobs: Before: https://github.com/libssh2/libssh2/actions/runs/27891639324/job/82535960547 (277 steps) After: https://github.com/libssh2/libssh2/actions/runs/27901568257/job/82562736781 (229 steps) No longer having these lines: ``` D:/a/libssh2/libssh2/bld/example/Release\libssh2.dll: message: deploying dependencies ``` (and the same for OpenSSL crypto DLL if built with it)
GHA jobs surprised me with a kind of failure I've never seen, without any change on libssh2's end: https://github.com/libssh2/libssh2/actions/runs/27823077802/job/82340632890 msvc (windows-2022, x64, uwp, WinCNG, OFF, OFF, ON, OFF, ON) https://github.com/libssh2/libssh2/actions/runs/27838566519/job/82392203784 msvc (windows-2022, x64, windows, OpenSSL, OFF, OFF, ON, OFF, ON) https://github.com/libssh2/libssh2/actions/runs/27838566519/job/82392203753 msvc (windows-2022, x64, windows, WinCNG, OFF, OFF, OFF, OFF, ON) ``` Version: 20260616.203.1 [...] MSBuild version 17.14.40+3e7442088 for .NET Framework [...] D:/a/libssh2/libssh2/bld/tests/Release\libssh2.dll: message: deploying dependencies D:/a/libssh2/libssh2/bld/tests/Release\libcrypto-3-x64.dll: message: deploying dependencies The process cannot access the file because it is being used by another process. [...] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_rsa_sha2_256_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_rsa_sha2_256_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited with code 32. [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_rsa_sha2_256_signed.vcxproj] D:/a/libssh2/libssh2/bld/tests/Release/test_auth_keyboard_info_request.exe: message: deploying dependencies D:/a/libssh2/libssh2/bld/tests/Release\libcrypto-3-x64.dll: message: deploying dependencies test_auth_pubkey_ok_rsa_openssh.vcxproj -> D:\a\libssh2\libssh2\bld\tests\Release\test_auth_pubkey_ok_rsa_openssh.exe ``` Ref: libssh2#2078 Follow-up to a95a02c libssh2#2093 Follow-up to 97d8e8d libssh2#2091 Follow-up to d652ba0 libssh2#2090 Follow-up to dd50a41 libssh2#1638 Follow-up to 694b9d9 libssh2#1610 Follow-up to 6bf8983
Member
Author
|
Sadly this did not fix the newly arrived flaky MSVC failures. With this said, I still agree with this commit, and now edit: suspect that MS made a feature similar to this and it arrived |
vszakats
added a commit
that referenced
this pull request
Jun 22, 2026
During last week MSVC GHA jobs started failing on occasion. Log clues. are "deploying dependencies", "The process cannot access the file because it is being used by another process.", and "C:\vcpkg\vcpkg.exe z-applocal". Turns out the latter command has been introduced recently. Then two weeks ago vcpkg's cmake script switched to it by default for the `VCPKG_APPLOCAL_DEPS` option. This option is enabled by default. It's vcpkg's implementation of the DLL copying feature, which I just dropped from libssh2 (suspecting it as a root cause for these failures). Fix by disabling this option, since libssh2 CI jobs don't need it. Examples, with shared libssh2: combined with WINCNG: Before: https://github.com/libssh2/libssh2/actions/runs/27901568257/job/82562736781 (229 steps) After: https://github.com/libssh2/libssh2/actions/runs/27924142060/job/82623203836 (179 steps) combined with OpenSSL: Before: https://github.com/libssh2/libssh2/actions/runs/27902733625/job/82565870012 (229 steps) After: https://github.com/libssh2/libssh2/actions/runs/27924142060/job/82623203795 (179 steps) Fixing: ``` D:/a/libssh2/libssh2/bld/tests/Release/test_read.exe: message: deploying dependencies The process cannot access the file because it is being used by another process. sftp_RW_nonblock.vcxproj -> D:\a\libssh2\libssh2\bld\example\Release\sftp_RW_nonblock.exe C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command "setlocal [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: C:\vcpkg\vcpkg.exe z-applocal --target-binary=D:/a/libssh2/libssh2/bld/tests/Release/test_auth_pubkey_ok_ecdsa_signed.exe --installed-bin-dir=C:/vcpkg/installed/x64-windows/bin [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1 [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited with code 32. [D:\a\libssh2\libssh2\bld\tests\test_auth_pubkey_ok_ecdsa_signed.vcxproj] ``` Ref: https://github.com/libssh2/libssh2/actions/runs/27922679181/job/82619051657?pr=2113 Refs: 1e5e292 https://devblogs.microsoft.com/cppblog/whats-new-in-vcpkg-apr-2026/ https://github.com/microsoft/vcpkg/blame/a0b1c8d3a477c1cb4813d8e127a56961707ca42b/scripts/buildsystems/vcpkg.cmake#L48-L50 https://github.com/microsoft/vcpkg/blob/a0b1c8d3a477c1cb4813d8e127a56961707ca42b/scripts/buildsystems/vcpkg.cmake#L622 microsoft/vcpkg@b8ab03c microsoft/vcpkg#52315 Bug: #2101 (comment) Follow-up to 3b730f2 #2101 Closes #2114
vszakats
added a commit
to curl/curl-for-win
that referenced
this pull request
Oct 24, 2026
…skip] For libssh2 >1.11.1. The DLL copying is no longer done by the build in the libssh2 master branch. Refs: libssh2/libssh2@3b730f2 libssh2/libssh2#2101
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature has been permanently enabled since the initial commit
adding CMake builds to libssh2. Limited to libssh2's own DLL (if built
that way), and OpenSSL's crypto DLL. While limited to these two DLLs
(and not supporting other dependencies), history shows this feature was
prone to break, and recently started breaking parallel builds, due to
MSBuild failing while copying the DLLs to the same location in
concurrent threads. This recently made MSVC GHA jobs flaky.
It's also a potential performance and disk trashing issue when copying
large DLLs (OpenSSL
libcrypto-*.dll) on each build, for each of the 52(at the time of this commit) targets. That's potentially 104 copy
operations. Perhaps this could be limited to once per each target
directory, but that's adding even more complexity and development time.
There is also no generalized/trivial way to pick up the complete set of
DLL dependencies; e.g. libcrypto.dll may need other DLLs. Another
disadvantage is copying around DLLs eventually ends up contributing to
DLL-hell, copies may go stale, picked up when undesired, or due the
heuristic detection, they may not match the dependency version/instance
actually linked. The copying was done on all platforms, while typically
the issue is exclusive to Windows MSVC (and it's also where it breaks.)
As a replacement, I propose to add any necessary DLL location to
PATHbefore running examples or tests. It works well in CI. Also in curl.
Fixing:
Refs (MSVC):
https://github.com/libssh2/libssh2/actions/runs/27838566519/job/82392203784 OpenSSL
https://github.com/libssh2/libssh2/actions/runs/27838566519/job/82392203753 WinCNG
https://github.com/libssh2/libssh2/actions/runs/27823077802/job/82340632890 WinCNG UWP
Examples, with shared libssh2:
combined with WINCNG:
Before: https://github.com/libssh2/libssh2/actions/runs/27891639324/job/82535960547 (277 steps)
After: https://github.com/libssh2/libssh2/actions/runs/27901568257/job/82562736781 (229 steps)
combined with OpenSSL:
Before: https://github.com/libssh2/libssh2/actions/runs/27902131772/job/82564199274 (326 steps)
After: https://github.com/libssh2/libssh2/actions/runs/27902733625/job/82565870012 (229 steps)
Observe these steps no longer performed:
Ref: #2078
Ref: 1e5e292
Follow-up to a95a02c #2093
Follow-up to 97d8e8d #2091
Follow-up to d652ba0 #2090
Follow-up to dd50a41 #1638
Follow-up to 694b9d9 #1610
Follow-up to 97417ad #899
Follow-up to 19884e5 #818
Follow-up to 6bf8983