vcpkg
vcpkg copied to clipboard
[windows-11] vcpkg binary cache source doesn't support http in full scale
Describe the bug
According to the documentation the http protocol is supported for binary caching either via env variable or CLI
VCPKG_BINARY_SOURCES=[http,<url_template>[,<rw>[,<header>]]]
However, vcpkg apparently uses built-in curl to authenticate with the backend server and it fails to upload:
DEBUG] 1024: cmd_execute_and_stream_data() returned 0 after 777907 us
[DEBUG] 1025: CreateProcessW(curl -X PUT -H "Authorization: Basic xxxxxxxx" -w "\n9a1db05f-a65d-419b-aa72-037fb4d0672e%{http_code}" https://myserver/artifactory/boost-filesystem_x64-windows_1.81.0_fa81929789b56c67c0db4014729456cd7f54b38b1cedbaf050cf12110cf0b186 -T "C:\AndroidProjects\ngpos\dev\external\vcpkg\packages\boost-filesystem_x64-windows.zip")
[DEBUG] 1025: cmd_execute_and_stream_data() returned 35 after 163236 us
error: curl failed to put file to https://myserver/artifactory/boost-filesystem_x64-windows_1.81.0_fa81929789b56c67c0db4014729456cd7f54b38b1cedbaf050cf12110cf0b186 with exit code 35 and http code 0.
Environment
- OS: Windows 11
- Vcpkg version: 2024-02-07-8a83681f921b10d86ae626fd833c253f4f8c355b
To Reproduce Steps to reproduce the behavior:
- Set your VCPKG_BINARY_SOURCES to any JFrog server
- Encode your basic authentication scheme, username:password or username:apikey in the same line
- Install any available package
vcpkg install zlib:x64-windows
Expected behavior After the package build successfully the genrated zip file should be uploaded to the server succesfully
Is there any way to override the built-in curl? It works perfectly with public domain curl (v 8.7.1). And you may also think of adding JFrog support as it is widely used in many companies.
Curl exit code 35 means
A TLS/SSL connect error. The SSL handshake failed. The SSL handshake can fail due to numerous different reasons so the error message may offer some additional clues. Maybe the parties could not agree to a SSL/TLS version, an agreeable cipher suite or similar.
iirc you can put your curl on the PATH before the systems curl and then your curl is used.
My path variable is overridden by vcvarsall.bat
as it seems:
PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\AndroidProjects\ngpos\dev\external\vcpkg\downloads\tools\powershell-core-7.2.16-windows;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg
Strangely, it doesn't happen when I manually run the script on the command line. You can check with the following command to see:
vcpkg install zlib:x64-windows --debug --debug-env
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.