-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vcpkg_download_distfile and .netrc authorization #42161
Comments
As said on discord you can currently achieve the same by using asset caching.
Where your custom download script should download from url, do a hash check against sha512 and then copy the file to dst. Or you just skip the hash check and just directly do |
Elaborating on @Neumann-A's response. As a workaround you can leverage the asset caching feature with a custom script. I had Copilot create a PowerShell script (it looks correct to me, but I haven't tested it yet). You would create this script with the name
Example: set $env:NETRC_FILE="C:\Users\<user>\.netrc"
set $env:VCPKG_ASSET_CACHE_DIR="C:\vcpkg-cache\assets"
set $env:VCPKG_KEEP_ENV_VARS="NETRC_FILE;VCPKG_ASSET_CACHE_DIR"
set $env:X_VCPKG_ASSET_SOURCES="clear;x-script,pwsh C:/path/to/asset-cache-script.ps1 {url} {sha512} {dst};x-block-origin"
vcpkg install ...
|
Is your feature request related to a problem? Please describe.
Hello. Right now the only way of authorization for vcpkg_download_distfile is via HEADERS. It would be nice to allow authorization via .netrc file, which I think is not possible to do with HTTP headers. I am not using aria2 to download, in the logs I see curl.
Proposed solution
Add some option to vcpkg_download_distfile, which allows to enable .netrc authorization, with optional .netrc file location (--netrc or --netrc-file in case of curl).
Describe alternatives you've considered
Custom-made script which replaces vcpkg_download_distfile completly. I think that vcpkg_download_distfile uses vcpkg x-download, which is not possible to anyhow update.
Additional context
No response
The text was updated successfully, but these errors were encountered: