Skip to content
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

Delete handling for --x-use-aria2, avoid duplicate file hashing, and fix hash mismatch message. #43418

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

BillyONeal
Copy link
Member

@BillyONeal BillyONeal commented Jan 23, 2025

Related microsoft/vcpkg-tool#1582

In microsoft/vcpkg-tool#1580 (comment) I discovered that the existing hash mismatch message was entirely broken.

Also fixed that whenever we had an existing download with a matching SHA, we were SHA512-ing it twice.

It seems like the existing _VCPKG_INTERNAL_NO_HASH_CHECK is broken as the only place it is used is for updating qt, and for those cases not trying to download a current version seems like an error, but I've kept the existing behavior. /cc @Neumann-A

Example new output:

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:93 (message):
    D:/vcpkg-downloads/madler-zlib-v1-8c964249.3.1.tar.gz: error: existing downloaded file had an unexpected hash
    Expected: 8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9087
    Actual  : 8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9088
    note: You may be able to resolve this failure by redownloading the file. To do so, delete D:/vcpkg-downloads/madler-zlib-v1-8c964249.3.1.tar.gz and retry.
Call Stack (most recent call first):

... now matches the current tool output in the download case except for the 'note's. (I would put the note:s there, but CMake already makes emitting reasonable errors here impossible by forcing things to be indented :( )

Downloading https://github.com/madler/zlib/archive/v1.3.1.tar.gz -> madler-zlib-v1-8c964249.3.1.tar.gz
D:\vcpkg-downloads\madler-zlib-v1-8c964249.3.1.tar.gz.28932.part: error: download from https://github.com/madler/zlib/archive/v1.3.1.tar.gz had an unexpected hash
note: Expected: 8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9087
note: Actual  : 8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9088

As an aside, I think there's an argument that the 'existing file' handling belongs in x-download, rather than here in CMake, but as that affects a documented interface I'm not looking to make such a change right now.

@BillyONeal BillyONeal added category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) info:internal This PR or Issue was filed by the vcpkg team. category:code-cleanup This PR cleans up code, without fixing any existing bugs nor adding any features. labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:code-cleanup This PR cleans up code, without fixing any existing bugs nor adding any features. category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants