-
Notifications
You must be signed in to change notification settings - Fork 6.9k
vcpkg_download_distfile no longer downloads files off a network store [with VS2022 version of vcpkg] #45686
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
Comments
I fail to see a link between source file:// urls and destination filepath changes. |
Sorry, I should have been more clear. It's not specific to file urls, that's just an easy way to reproduce the issue. If you look at two spots of the script, and assume the download with matching hash does not already exist in the downloads folder: line 48: line 117:
Only the filename of each URL is being appended to the params variable now, and that variable is later used in a call to vcpkg_execute_in_download_mode, which will understandably fail. Commit 93c2011 changed downloaded_file_path to arg_FILENAME on line 117 which causes the issue. Changing it back will fix the reported issue. |
But it works for everyone else, doesn't it? There are 400 calls to this function in vcpkg ports, for tools, sources and patches. I don't want to say there couldn't be a problem. But maybe the focus needs to be shifted towards your environment instead. Did you re-run bootstrap after updating your git checkout? Check your vcpkg tool version. It is also included in the issue_body.md created for most build failures. |
Presumably it does, but yes that's a good point - it could be an environmental issue. The system that's failing is using vcpkg that's integrated with VS2022 (v17.14.2) and everything worked before the VS update (which AFAIK included the above mentioned changes to vcpkg_download_distfile). Next week I'll setup a test repository on a fresh vcpkg clone and dig deeper into what's going on. |
I'm able to reproduce this issue in a clean environment. I've also setup a test repository that can be used to replicate the issue here: The README includes steps to use a fresh Windows Sandbox environment and new install of the latest VS2022 (17.14.2 at the time of writing) and vcpkg that ships with Visual Studio. Following the steps in the README should lead to download failure; making the single cmake script change mentioned in the README should then allow the download to complete successfully. Anyone who can test this, or offer some advice of what to check next would be greatly appreciated. If helpful, these are the variable values sent into the script at the time of the call:
When arg_FILENAME is used to build params (currently failing), params looks like this:
When downloaded_file_path is used to build params (working on test repo), params it looks like this:
The params variable is then used in vcpkg_execute_in_download_mode.cmake in a cmake_language CALL with these variables:
I haven't dug into vcpkg-tools, but from a quick glace it looks like vcpkg-tool/src/vcpkg/base/files.cpp::Filesystem::create_directories is possibly being asked to create an empty string when it fails:
|
I've verified that this is a bug in the version of vcpkg that ships with Visual Studio 2022 17.14.2 and 17.14.3. The needed fix has been added to vcpkg-tool and I verified it fixes the issue: The fix will presumably be in the next release of VS (17.14.4). I'll close this issue and retest again in the future once 17.14.4 is released. Thanks for your feedback @dg0yt! |
Thanks for the feedback. Let me add the trace to the first reported issue: |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Using vcpkg_download_distfile now fails. For example, this network path to an archive file will fail:
URLS file://some/network/path/file.zip
Environment
To Reproduce
Expected behavior
The download should not fail.
Additional context
I believe the issue was added in Commit 93c2011 and that it can be fixed by reverting the params assignment to use the full download path instead of just the arg_FILENAME. I've tested this change and it works for network archive files as expected again.
Here is a commit with the change, I can issue a pull request if that would be helpful:
master...jblaisdev:vcpkg:master
The text was updated successfully, but these errors were encountered: