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

[libmagic] build failure #43565

Closed
as-ascii opened this issue Jan 31, 2025 · 11 comments · Fixed by #43635
Closed

[libmagic] build failure #43565

as-ascii opened this issue Jan 31, 2025 · 11 comments · Fixed by #43635
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@as-ascii
Copy link

Operating system

x64-windows

Compiler

MSVC

Steps to reproduce the behavior

vcpkg install libmagic

Failure logs

Installing 92/120 libmagic:[email protected]...
Building libmagic:[email protected]...
Downloading https://github.com/file/file/archive/FILE5_46.tar.gz -> file-file-FILE5_46.tar.gz
D:\a\docwire\docwire\vcpkg\downloads\file-file-FILE5_46.tar.gz.740.part: error: download from https://github.com/file/file/archive/FILE5_46.tar.gz had an unexpected hash
note: Expected: 9165bb5bdbe7b8fccac0c8675d4eb251a286ab2ab7a79e6f8ed98d36fa0928b889cf109c1da3a5cfff64d1b1006b5d73934c2d420484adae6f4c8e26a9ede18f
note: Actual : fb8157ee8065feaf57412ccdeee57cd8fc853b54ac49b0ddc818eeb1ca3555a7cfd25dea08996503f7c565dcba8c57fd7e4dc5fe3452872c617f5612a94a8f0e
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:124 (message):
Download failed, halting portfile.
Call Stack (most recent call first):
scripts/cmake/vcpkg_from_github.cmake:106 (vcpkg_download_distfile)
ports/libmagic/portfile.cmake:21 (vcpkg_from_github)
scripts/ports.cmake:196 (include)

See also: https://github.com/docwire/docwire/actions/runs/13065608685/job/36491110203

Additional context

No response

@as-ascii as-ascii added the category:port-bug The issue is with a library, which is something the port should already support label Jan 31, 2025
@as-ascii
Copy link
Author

The URL is working, file looks like a correct archive but hash is incorrect, File was probably replaced by upstream but better to be safe and double check.

@rjzak
Copy link

rjzak commented Feb 1, 2025

I'm also having this issue. PR: #42939, commit hash ddcee8f.

rjzak added a commit to malwaredb/malwaredb-rs that referenced this issue Feb 1, 2025
* Microsoft vcpkg is broken: microsoft/vcpkg#43565
* This change might not be needed or useful

Signed-off-by: Richard Zak <[email protected]>
@as-ascii
Copy link
Author

as-ascii commented Feb 4, 2025

The github project that is used by VCPKG to download libmagic source code is https://github.com/file/file. There is a homepage https://www.darwinsys.com/file/ mentioned there. The official FTP repository mentioned on that homepage is ftp://ftp.astron.com/pub/file/ but when I downloaded the file from there it has a third, different sha512 checksum:

sha512sum file-5.46.tar.gz 
a6cb7325c49fd4af159b7555bdd38149e48a5097207acbe5e36deb5b7493ad6ea94d703da6e0edece5bb32959581741f4213707e5cb0528cd46d75a97a5242dc  file-5.46.tar.gz

So there is no clear for me what is correct and what is not and how to fix this issue.
Could a maintainer of this port look at this issue please?

I hope it is not some backdoor issue like with XZ packages recently, better to be careful.

@as-ascii
Copy link
Author

as-ascii commented Feb 4, 2025

@FrankXie05 Could you please take a look? I can see that the latest commit in libmagic port directory is yours.

@FrankXie05
Copy link
Contributor

FrankXie05 commented Feb 5, 2025

Could a maintainer of this port look at this issue please?

I hope it is not some backdoor issue like with XZ packages recently, better to be careful.

This port is hosted on github, and vcpkg will also download the source code directly from github.

URLS "${github_host}/${org_name}/${repo_name}/archive/${ref_to_use}.tar.gz"

@FrankXie05
Copy link
Contributor

For hash changes, since the source code download here depends on REF rather than the specific commit hash, it may cause the Tarball generated by github to be different.

@as-ascii
Copy link
Author

as-ascii commented Feb 5, 2025

Maybe it would be better to download files from official website instead of github mirror? The description on github project site clearly states that its automatic mirror. I don't know how this mirror is created but maybe some forced pushes are done etc. Unfortunately the official site supports only FTP downloads I can see. I don't know much about VCPKG official strategy for this kind od issues.

@as-ascii
Copy link
Author

as-ascii commented Feb 6, 2025

Thanks for the fix!

@FrankXie05
Copy link
Contributor

@as-ascii Next time update we will use commit hash to avoid this issue.

@as-ascii
Copy link
Author

as-ascii commented Feb 8, 2025

Just to let you know for the history record: we now have a situation that vcpkg port with the same version number but different port number compiles library that unfortunately WORKS DIFFERENTLY that previous one (for zip files and it seems to have some regressions in this area). Of course the problem is probably on the upstream side but good to know what kind of situations we can have here and introduce solutions that will help to avoid them.

@BillyONeal
Copy link
Member

vcpkg is an index of what upstream says. If upstream changes the behavior without bumping the version number, we already provide mechanisms for you to detect and avoid it: the baseline and asset caching systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants