Skip to content

Commit 64fa487

Browse files
committed
Revert "[vcpkg-tool] Replace curl command calls with libcurl (#1660)"
This reverts commit 1cc117b. # Conflicts: # locales/messages.json
1 parent f4ec1e1 commit 64fa487

File tree

24 files changed

+1379
-900
lines changed

24 files changed

+1379
-900
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ jobs:
3636
uses: github/codeql-action/init@v3
3737
with:
3838
languages: javascript-typescript, c-cpp
39-
- name: Install system libcurl
40-
if: matrix.preset == 'linux-arm64-ci' || matrix.preset == 'linux-ci'
41-
run: |
42-
sudo apt update
43-
sudo apt install -y libcurl4-openssl-dev
4439
- name: Configure and Build
4540
if: matrix.preset != 'windows-ci'
4641
run: |

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ set(TEST_SCRIPT_ASSET_CACHE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/test-script
195195

196196
find_package(fmt REQUIRED)
197197
find_package(CMakeRC REQUIRED)
198-
find_package(LibCURL REQUIRED)
199198

200199
# === Target: locale-resources ===
201200

@@ -230,8 +229,6 @@ target_compile_definitions(vcpkglib PUBLIC
230229
_FILE_OFFSET_BITS=64
231230
)
232231

233-
target_link_libraries(vcpkglib PUBLIC CURL::libcurl)
234-
235232
if(VCPKG_STANDALONE_BUNDLE_SHA)
236233
target_compile_definitions(vcpkglib PUBLIC
237234
"VCPKG_STANDALONE_BUNDLE_SHA=${VCPKG_STANDALONE_BUNDLE_SHA}"

NOTICE.txt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,6 @@ SOFTWARE.
7171
=========================================
7272
END OF CMakeRC NOTICES, INFORMATION, AND LICENSE
7373

74-
curl
75-
76-
%% curl NOTICES, INFORMATION, AND LICENSE BEGIN HERE
77-
=========================================
78-
COPYRIGHT AND PERMISSION NOTICE
79-
80-
Copyright (C) Daniel Stenberg, <[email protected]>, and many
81-
contributors, see the THANKS file.
82-
83-
All rights reserved.
84-
85-
Permission to use, copy, modify, and distribute this software for any purpose
86-
with or without fee is hereby granted, provided that the above copyright
87-
notice and this permission notice appear in all copies.
88-
89-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
90-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
91-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
92-
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
93-
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
94-
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
95-
OR OTHER DEALINGS IN THE SOFTWARE.
96-
97-
Except as contained in this notice, the name of a copyright holder shall not
98-
be used in advertising or otherwise to promote the sale, use or other dealings
99-
in this Software without prior written authorization of the copyright holder.
100-
=========================================
101-
END OF curl NOTICES, INFORMATION, AND LICENSE
102-
10374
The following third party software is incorporated into vcpkg-artifacts:
10475

10576
---------------------------------------------------------

azure-pipelines/end-to-end-tests-dir/asset-caching.ps1

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ Throw-IfNotFailed
5959
$expected = @(
6060
"A suitable version of cmake was not found \(required v[0-9.]+\)\.",
6161
"Trying to download cmake-[0-9.]+-[^.]+\.(zip|tar\.gz) using asset cache file://$assetCacheRegex/[0-9a-z]+",
62-
"error: curl operation failed with error code 37 \((Couldn't|Could not) read a file:\/\/ file\)\.",
63-
"error: Not a transient network error, won't retry download from file://$assetCacheRegex/[0-9a-z]+"
62+
"error: curl: \(37\) Couldn't open file [^\n]+",
6463
"error: there were no asset cache hits, and x-block-origin blocks trying the authoritative source https://github\.com/Kitware/CMake/releases/download/[^ ]+",
6564
"note: If you are using a proxy, please ensure your proxy settings are correct\.",
6665
"Possible causes are:",
@@ -112,8 +111,7 @@ if (-not ($actual -match $expected)) {
112111
Refresh-TestRoot
113112
$expected = @(
114113
"^Downloading https://localhost:1234/foobar\.html -> example3\.html",
115-
"error: curl operation failed with error code 7 \((Couldn't|Could not) connect to server\)\.",
116-
"error: Not a transient network error, won't retry download from https://localhost:1234/foobar\.html",
114+
"error: curl: \(7\) Failed to connect to localhost port 1234( after \d+ ms)?: ((Could not|Couldn't) connect to server|Connection refused)",
117115
"note: If you are using a proxy, please ensure your proxy settings are correct\.",
118116
"Possible causes are:",
119117
"1\. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to ``https://address:port``\.",
@@ -136,11 +134,9 @@ if (-not ($actual -match $expected)) {
136134
Refresh-TestRoot
137135
$expected = @(
138136
"^Downloading example3\.html, trying https://localhost:1234/foobar\.html",
139-
"error: curl operation failed with error code 7 \((Couldn't|Could not) connect to server\)\.",
140-
"error: Not a transient network error, won't retry download from https://localhost:1234/foobar\.html",
141137
"Trying https://localhost:1235/baz\.html",
142-
"error: curl operation failed with error code 7 \((Couldn't|Could not) connect to server\)\.",
143-
"error: Not a transient network error, won't retry download from https://localhost:1235/baz\.html",
138+
"error: curl: \(7\) Failed to connect to localhost port 1234( after \d+ ms)?: ((Could not|Couldn't) connect to server|Connection refused)",
139+
"error: curl: \(7\) Failed to connect to localhost port 1235( after \d+ ms)?: ((Could not|Couldn't) connect to server|Connection refused)",
144140
"note: If you are using a proxy, please ensure your proxy settings are correct\.",
145141
"Possible causes are:",
146142
"1\. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to ``https://address:port``\.",
@@ -192,20 +188,42 @@ if (-not ($actual -match $expected)) {
192188
}
193189

194190
# ... also with multiple authoritative URLs
191+
if ($IsWindows) {
192+
# WinHTTP
193+
Refresh-TestRoot
194+
$expected = @(
195+
"^Downloading example3\.html, trying https://nonexistent\.example\.com",
196+
"warning: Download https://nonexistent\.example\.com failed -- retrying after 1000ms",
197+
"warning: Download https://nonexistent\.example\.com failed -- retrying after 2000ms",
198+
"warning: Download https://nonexistent\.example\.com failed -- retrying after 4000ms",
199+
"Trying https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt",
200+
"Successfully downloaded example3\.html",
201+
"$"
202+
) -join "`n"
203+
204+
$actual = Run-VcpkgAndCaptureOutput @commonArgs x-download "$TestDownloadsRoot/example3.html" --sha512 65077997890f66f6041bb3284bb7b88e27631411ccbc253201ca4e00c4bcc58c0d77edffda4975498797cc10772c7fd68fbeb13cc4ac493a3471a9d49e5b6f24 --url https://nonexistent.example.com --url https://raw.githubusercontent.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE.txt
205+
Throw-IfFailed
206+
if (-not ($actual -match $expected)) {
207+
throw "Failure: azurl (no), x-block-origin (no), asset-cache (n/a), download (succeed)"
208+
}
209+
}
210+
211+
# Force curl with --header
195212
Refresh-TestRoot
196213
$expected = @(
197214
"^Downloading example3\.html, trying https://nonexistent\.example\.com",
198-
"error: curl operation failed with error code 6 \((Couldn't|Could not) resolve (hostname|host name)\)\.",
199-
"error: Not a transient network error, won't retry download from https://nonexistent\.example\.com",
200-
"Trying https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt"
215+
"warning: (Problem : timeout\.|Transient problem: timeout) Will retry in 1 seconds?\. 3 retries left\.",
216+
"warning: (Problem : timeout\.|Transient problem: timeout) Will retry in \d+ seconds?\. 2 retries left\.",
217+
"warning: (Problem : timeout\.|Transient problem: timeout) Will retry in \d+ seconds?\. 1 (retries|retry) left\.",
218+
"Trying https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt",
201219
"Successfully downloaded example3\.html",
202220
"$"
203221
) -join "`n"
204222

205223
$actual = Run-VcpkgAndCaptureOutput @commonArgs x-download "$TestDownloadsRoot/example3.html" --sha512 65077997890f66f6041bb3284bb7b88e27631411ccbc253201ca4e00c4bcc58c0d77edffda4975498797cc10772c7fd68fbeb13cc4ac493a3471a9d49e5b6f24 --url https://nonexistent.example.com --url https://raw.githubusercontent.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE.txt --header "Cache-Control: no-cache"
206224
Throw-IfFailed
207225
if (-not ($actual -match $expected)) {
208-
throw "Failure: azurl (no), x-block-origin (no), asset-cache (n/a), download (succeed), headers (cache-control)"
226+
throw "Failure: azurl (no), x-block-origin (no), asset-cache (n/a), download (succeed)"
209227
}
210228

211229
# azurl (no), x-block-origin (yes), asset-cache (n/a), download (n/a)
@@ -229,10 +247,8 @@ Refresh-TestRoot
229247
$expected = @(
230248
"^Trying to download example3\.html using asset cache file://$assetCacheRegex/[0-9a-z]+",
231249
"Asset cache miss; trying authoritative source https://localhost:1234/foobar\.html",
232-
"error: curl operation failed with error code 37 \((Couldn't|Could not) read a file:// file\)\.",
233-
"error: Not a transient network error, won't retry download from file://$assetCacheRegex/[0-9a-z]+",
234-
"error: curl operation failed with error code 7 \((Couldn't|Could not) connect to server\)\.",
235-
"error: Not a transient network error, won't retry download from https://localhost:1234/foobar\.html",
250+
"error: curl: \(37\) Couldn't open file [^\n]+",
251+
"error: curl: \(7\) Failed to connect to localhost port 1234( after \d+ ms)?: ((Could not|Couldn't) connect to server|Connection refused)",
236252
"note: If you are using a proxy, please ensure your proxy settings are correct\.",
237253
"Possible causes are:",
238254
"1\. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to ``https://address:port``\.",
@@ -291,11 +307,7 @@ if (-not ($actual -match $expected)) {
291307
$expected = @(
292308
"^Trying to download example3\.html using asset cache file://$assetCacheRegex/[0-9a-z]+",
293309
"Asset cache miss; trying authoritative source https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt",
294-
"error: curl operation failed with error code 37 \((Couldn't|Could not) read a file:// file\)\.",
295-
"error: Not a transient network error, won't retry download from file://$assetCacheRegex/[0-9a-z]+",
296-
"[^\n]+example3\.html\.\d+\.part: error: download from https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt had an unexpected hash",
297-
"note: Expected: d06b93c883f8126a04589937a884032df031b05518eed9d433efb6447834df2596aebd500d69b8283e5702d988ed49655ae654c1683c7a4ae58bfa6b92f2b73b",
298-
"note: Actual : 65077997890f66f6041bb3284bb7b88e27631411ccbc253201ca4e00c4bcc58c0d77edffda4975498797cc10772c7fd68fbeb13cc4ac493a3471a9d49e5b6f24",
310+
"error: curl: \(37\) Couldn't open file [^\n]+",
299311
"note: If you are using a proxy, please ensure your proxy settings are correct\.",
300312
"Possible causes are:",
301313
"1\. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to ``https://address:port``\.",
@@ -305,6 +317,9 @@ $expected = @(
305317
"The value set by your proxy might be wrong, or have same ``https://`` prefix issue\.",
306318
"3\. Your proxy's remote server is out of service\.",
307319
"If you believe this is not a temporary download server failure and vcpkg needs to be changed to download this file from a different location, please submit an issue to https://github\.com/Microsoft/vcpkg/issues",
320+
"[^\n]+example3\.html\.\d+\.part: error: download from https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt had an unexpected hash",
321+
"note: Expected: d06b93c883f8126a04589937a884032df031b05518eed9d433efb6447834df2596aebd500d69b8283e5702d988ed49655ae654c1683c7a4ae58bfa6b92f2b73b",
322+
"note: Actual : 65077997890f66f6041bb3284bb7b88e27631411ccbc253201ca4e00c4bcc58c0d77edffda4975498797cc10772c7fd68fbeb13cc4ac493a3471a9d49e5b6f24",
308323
"$"
309324
) -join "`n"
310325
$actual = Run-VcpkgAndCaptureOutput @commonArgs x-download "$TestDownloadsRoot/example3.html" --sha512 d06b93c883f8126a04589937a884032df031b05518eed9d433efb6447834df2596aebd500d69b8283e5702d988ed49655ae654c1683c7a4ae58bfa6b92f2b73b --url https://raw.githubusercontent.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE.txt "--x-asset-sources=x-azurl,file://$AssetCache,,readwrite"
@@ -354,8 +369,7 @@ if (-not ($actual -match $expected)) {
354369
Refresh-TestRoot
355370
$expected = @(
356371
"^Trying to download example3\.html using asset cache file://$assetCacheRegex/[0-9a-z]+",
357-
"error: curl operation failed with error code 37 \((Couldn't|Could not) read a file:// file\)\.",
358-
"error: Not a transient network error, won't retry download from file://$assetCacheRegex/[0-9a-z]+",
372+
"error: curl: \(37\) Couldn't open file [^\n]+",
359373
"error: there were no asset cache hits, and x-block-origin blocks trying the authoritative source https://raw\.githubusercontent\.com/microsoft/vcpkg-tool/1767aaee7b229c609f7ad5cf2f57b6a6cc309fb8/LICENSE\.txt",
360374
"note: or https://alternate\.example\.com",
361375
"note: If you are using a proxy, please ensure your proxy settings are correct\.",

cgmanifest.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@
3737
},
3838
"DevelopmentDependency": false,
3939
"DependencyRoots": []
40-
},
41-
{
42-
"Component": {
43-
"Type": "other",
44-
"other": {
45-
"name": "curl",
46-
"version": "8.17.0",
47-
"downloadUrl": "https://github.com/curl/curl/archive/refs/tags/curl-8_17_0.tar.gz",
48-
"hash": "88ab4b7aac12b26a6ad32fb0e1a9675288a45894438cb031102ef5d4ab6b33c2bc99cae0c70b71bdfa12eb49762827e2490555114c5eb4a6876b95e1f2a4eb74"
49-
}
50-
},
51-
"DevelopmentDependency": false,
52-
"DependencyRoots": []
5340
}
5441
]
5542
}

cmake/FindLibCURL.cmake

Lines changed: 0 additions & 93 deletions
This file was deleted.

include/vcpkg/base/contractual-constants.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,4 @@ namespace vcpkg
591591
inline constexpr StringLiteral StatusInstalled = "installed";
592592
inline constexpr StringLiteral StatusNotInstalled = "not-installed";
593593
inline constexpr StringLiteral StatusPurge = "purge";
594-
595-
// App Insights JSON response fields
596-
inline constexpr StringLiteral AppInsightsResponseItemsReceived = "itemsReceived";
597-
inline constexpr StringLiteral AppInsightsResponseItemsAccepted = "itemsAccepted";
598-
inline constexpr StringLiteral AppInsightsResponseErrors = "errors";
599594
}

include/vcpkg/base/curl.h

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)