`install --only-downloads` reports success even when download(s) failed
Nobody has claimed this yet.
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
**Describe the bug**
The command `vcpkg install --only-downloads` always reports success (Exit Code 0) even when port(s) fail to download. It even writes a nice colorful green lie at the end.
> All requested installations completed successfully in:...
**Environment**
This affects all environments and affects both classic and manifest mode.
**To Reproduce**
Steps to reproduce the behavior:
1. Disconnect machine entirely from the internet, e.g. disable network adaptor or unplug cable
2. Run `vcpkg install --only-downloads abseil`
**Expected behavior**
The `vcpkg install --only-downloads` command should fail with a non-zero exit code when any of the downloads failed. It definitely should _not_ lie to the user and say that the package was "DOWNLOADED" when it wasn't.
**Failure logs**
You can see here the result of running a simple install on my Linux machine.
```
> $ ./vcpkg/vcpkg --version
vcpkg package management program version 2026-04-08-e0612b42ce44e55a0e630f2ee9d3c533a63d8bc1
See LICENSE.txt for license information.
> $ ./vcpkg/vcpkg install --only-downloads abseil
Computing installation plan...
The following packages will be built and installed:
abseil:x64-linux@20260107.1#3
* vcpkg-cmake:x64-linux@2024-04-23
* vcpkg-cmake-config:x64-linux@2024-05-23
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Compiler found: /usr/bin/c++
Installing 1/3 vcpkg-cmake:x64-linux@2024-04-23...
vcpkg-cmake:x64-linux@2024-04-23 package ABI: 90d41a8086fb6c527e136b32de4c58226b91b3fcb51ad7b4a03bf72159a29a0b
Building vcpkg-cmake:x64-linux@2024-04-23...
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake_x64-linux/share/vcpkg-cmake/vcpkg_cmake_configure.cmake
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake_x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake_x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake_x64-linux/share/vcpkg-cmake/vcpkg-port-config.cmake
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake_x64-linux/share/vcpkg-cmake/copyright
Downloading https://github.com/NixOS/patchelf/releases/download/0.15.5/patchelf-0.15.5-x86_64.tar.gz -> patchelf-0.15.5-x86_64.tar.gz
error: curl operation failed with error code 6 (Could not resolve hostname).
error: Not a transient network error, won't retry download from https://github.com/NixOS/patchelf/releases/download/0.15.5/patchelf-0.15.5-x86_64.tar.gz
note: If you are using a proxy, please ensure your proxy settings are correct.
Possible causes are:
1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to `https://address:port`.
This is not correct, because `https://` prefix claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr, etc...) is an HTTP proxy.
Try setting `http://address:port` to both HTTP_PROXY and HTTPS_PROXY instead.
2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings set by your proxy software. See: https://github.com/microsoft/vcpkg-tool/pull/77
The value set by your proxy might be wrong, or have same `https://` prefix issue.
3. Your proxy's remote server is out of service.
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
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136 (message):
Download failed, halting portfile.
Call Stack (most recent call first):
scripts/cmake/vcpkg_find_acquire_program.cmake:205 (vcpkg_download_distfile)
scripts/cmake/z_vcpkg_fixup_rpath.cmake:74 (vcpkg_find_acquire_program)
scripts/ports.cmake:216 (z_vcpkg_fixup_rpath_in_dir)
Downloaded sources for vcpkg-cmake:x64-linux@2024-04-23
Elapsed time to handle vcpkg-cmake:x64-linux: 19.1 ms
Installing 2/3 vcpkg-cmake-config:x64-linux@2024-05-23...
vcpkg-cmake-config:x64-linux@2024-05-23 package ABI: 105edb7eb53394b1f823f1fc19214c653d8c1d7cc08dc121131bed7d2b3f4fe8
Building vcpkg-cmake-config:x64-linux@2024-05-23...
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake-config_x64-linux/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake-config_x64-linux/share/vcpkg-cmake-config/vcpkg-port-config.cmake
-- Installing: /home/steve/workspace/vcpkg-downloads-test/vcpkg/packages/vcpkg-cmake-config_x64-linux/share/vcpkg-cmake-config/copyright
Downloading https://github.com/NixOS/patchelf/releases/download/0.15.5/patchelf-0.15.5-x86_64.tar.gz -> patchelf-0.15.5-x86_64.tar.gz
error: curl operation failed with error code 6 (Could not resolve hostname).
error: Not a transient network error, won't retry download from https://github.com/NixOS/patchelf/releases/download/0.15.5/patchelf-0.15.5-x86_64.tar.gz
note: If you are using a proxy, please ensure your proxy settings are correct.
Possible causes are:
1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to `https://address:port`.
This is not correct, because `https://` prefix claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr, etc...) is an HTTP proxy.
Try setting `http://address:port` to both HTTP_PROXY and HTTPS_PROXY instead.
2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings set by your proxy software. See: https://github.com/microsoft/vcpkg-tool/pull/77
The value set by your proxy might be wrong, or have same `https://` prefix issue.
3. Your proxy's remote server is out of service.
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
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136 (message):
Download failed, halting portfile.
Call Stack (most recent call first):
scripts/cmake/vcpkg_find_acquire_program.cmake:205 (vcpkg_download_distfile)
scripts/cmake/z_vcpkg_fixup_rpath.cmake:74 (vcpkg_find_acquire_program)
scripts/ports.cmake:216 (z_vcpkg_fixup_rpath_in_dir)
Downloaded sources for vcpkg-cmake-config:x64-linux@2024-05-23
Elapsed time to handle vcpkg-cmake-config:x64-linux: 18.7 ms
Installing 3/3 abseil:x64-linux@20260107.1#3...
abseil:x64-linux@20260107.1#3 package ABI: fb461503fcfa0b757cf8d9ac7ae59da412010a464d0a673669f3b481200e60d7
Building abseil:x64-linux@20260107.1#3...
Downloading https://github.com/abseil/abseil-cpp/archive/20260107.1.tar.gz -> abseil-abseil-cpp-20260107.1.tar.gz
error: curl operation failed with error code 6 (Could not resolve hostname).
error: Not a transient network error, won't retry download from https://github.com/abseil/abseil-cpp/archive/20260107.1.tar.gz
note: If you are using a proxy, please ensure your proxy settings are correct.
Possible causes are:
1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to `https://address:port`.
This is not correct, because `https://` prefix claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr, etc...) is an HTTP proxy.
Try setting `http://address:port` to both HTTP_PROXY and HTTPS_PROXY instead.
2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings set by your proxy software. See: https://github.com/microsoft/vcpkg-tool/pull/77
The value set by your proxy might be wrong, or have same `https://` prefix issue.
3. Your proxy's remote server is out of service.
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
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136 (message):
Download failed, halting portfile.
Call Stack (most recent call first):
scripts/cmake/vcpkg_from_github.cmake:120 (vcpkg_download_distfile)
ports/abseil/portfile.cmake:5 (vcpkg_from_github)
scripts/ports.cmake:206 (include)
Downloaded sources for abseil:x64-linux@20260107.1#3
Elapsed time to handle abseil:x64-linux: 19.3 ms
Total install time: 57.1 ms
RESULTS
vcpkg-cmake:x64-linux: DOWNLOADED: 19.1 ms
vcpkg-cmake-config:x64-linux: DOWNLOADED: 18.7 ms
abseil:x64-linux: DOWNLOADED: 19.3 ms
SUMMARY FOR x64-linux
DOWNLOADED: 3
All requested installations completed successfully in: 57.1 ms
```
**Additional context**
Add any other context about the problem here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce with `vcpkg install --only-downloads abseil` while offline, then trace the reported failure through `scripts/cmake/vcpkg_download_distfile.cmake`, `scripts/cmake/vcpkg_from_github.cmake`, and `ports/abseil/portfile.cmake`. Check how the command aggregates download results and formats its summary; done means failed downloads produce a non-zero exit code and are not reported as DOWNLOADED or successful.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100