microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.39k stars 6.47k forks source link

[vcpkg-tool] fetch downloads 7-zip, ignores VCPKG_FORCE_SYSTEM_BINARIES #26844

Open demianmnave-pti opened 2 years ago

demianmnave-pti commented 2 years ago

Describe the bug vcpkg fetch 7zip downloads 7-zip even if the system version is sufficient, and even if 'VCPKG_FORCE_SYSTEM_BINARIES' is set.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Bootstrap vcpkg .
  2. Execute ./vcpkg.exe fetch 7zip

    A suitable version of 7zip was not found (required v21.7.0). Downloading portable 7zip v21.7.0... Downloading 7zip... https://www.7-zip.org/a/7z2107-extra.7z -> \downloads\7z2107-extra.7z Extracting 7zip...

    \downloads\tools\7zip-21.07-windows\7za.exe

Expected behavior vcpkg fetch 7zip finds the installed version of 7-zip.

Failure logs

Additional context ToolCacheImpl (src/vcpkg/tools.cpp) has no way of finding tools defined in vcpkgTools.xml unless there is a corresponding implementation of ToolProvider.

yvvki commented 1 year ago

Is there any update or branch for this issue?

MaxRev-Dev commented 11 months ago

I have some DNS issues when downloading 7zip, which can be related to my provider restrictions. This host doesn't work for me and fails with ERR_NAME_NOT_RESOLVED. error: https://www.7-zip.org/a/7z2301-extra.7z: WinHttpSendRequest failed with exit code 12007

Nevertheless, I have the latest 7zip installed 23.1 in my build pipeline, but it still fails. How to override the 7zip URL or binary location? I tried to set VCPKG_FORCE_SYSTEM_BINARIES and it doesn't change anything

github-actions[bot] commented 5 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

demianmnave-pti commented 5 months ago

Any ideas on how to fix this?

greenozon commented 3 months ago

@demianmnave-pti according to the used env var VCPKG_FORCE_SYSTEM_BINARIES it is not designed to support all the binaries in vcpkg, but just 2:

https://learn.microsoft.com/en-us/vcpkg/users/config-environment#vcpkg_force_system_binaries

dg0yt commented 3 months ago

@greenozon According to the implementation, it is not intented to be limited. There are really many more tools.

greenozon commented 3 months ago

interesting! then we have mis-alignment between official doc portal and the tool itself are there any steps to update official MS doc info for this env var?

greenozon commented 3 months ago

Found the list of supported system tools, it does not have 7z in it...

https://github.com/microsoft/vcpkg-tool/blob/4063a94150c5d691a4fb39353bd9d48dc940b22b/src/vcpkg/tools.cpp#L861

means this env var does not cover 7z, right?

but at the same time the code has initial support for it! means someone has to add the missed code for 7z...

dg0yt commented 3 months ago

are there any steps to update official MS doc info for this env var?

Read the notes in the docs footer, or go to https://github.com/microsoft/vcpkg-docs/

Found the list of supported system tools, it does not have 7z in it...

https://github.com/microsoft/vcpkg-tool/blob/4063a94150c5d691a4fb39353bd9d48dc940b22b/src/vcpkg/tools.cpp#L861

means this env var does not cover 7z, right?

You are jumping into conclusions. I deliberately omitted the reference to the code because I was afraid of that.

vszakats commented 1 month ago

Since the latest vcpkg update it no longer downloads one 7-zip package, but two of its packages:

vcpkg package management program version 2024-09-18-5f5da308dd1dd3cc49641c60eafff176e248a9dd
[...]
Additional packages (*) will be modified to complete this operation.
A suitable version of 7zip was not found (required v24.8.0).
Downloading https://github.com/ip7z/7zip/releases/download/24.08/7z2408-extra.7z
Extracting 7zip...
A suitable version of 7zr was not found (required v24.8.0).
Downloading https://github.com/ip7z/7zip/releases/download/24.08/7zr.exe

https://github.com/curl/curl/actions/runs/11163546704/job/31030787352#step:5:34

(This is when all packages are coming from the cache.)

Looks like a waste of time and bandwidth. Ideally both tools would be part of the Windows runner on GHA, and vcpkg would use them, if present, automatically.