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

vcpkg fails to extract 7-zip during install #42804

Open
constcuriosity opened this issue Dec 20, 2024 · 4 comments
Open

vcpkg fails to extract 7-zip during install #42804

constcuriosity opened this issue Dec 20, 2024 · 4 comments
Assignees
Labels
category:question This issue is a question

Comments

@constcuriosity
Copy link

constcuriosity commented Dec 20, 2024

Describe the bug
I updated to the latest baseline to take advantage of a recently added port (sdl3). When I went to install my packages though vcpkg install fails:

CMake Error: Problem with archive_read_next_header():
CMake Error: Problem extracting tar: C:\Users\private\projects\vcpkg\downloads\7z2409.7z
'CMake' failed while extracting C:\Users\private\projects\vcpkg\downloads\7z2409.7z.

This is hit before any of the ports that I indicated in my manifest were attempted to be downloaded. This is part of a vcpkg prep step to make sure it has a bunch of local tools downloaded to perform the next operations.

Environment

  • OS: Windows

To Reproduce
Steps to reproduce the behavior:

  1. Update to latest baseline (6de717b)
  2. Run vcpkg with any manifest file

Expected behavior
I expect install vcpkg processes to successfully download and install the ports that I request

Failure logs

Here's the tail end of a vcpkg install --debug

The following packages will be built and installed:
    fmt:[email protected]#1 -- C:\Users\private\AppData\Local\vcpkg\registries\git-trees\07a73a7565e5de9eb42e90c16c133bdfdfebbcda
    imgui[core,sdl2-binding]:[email protected] -- C:\Users\private\AppData\Local\vcpkg\registries\git-trees\1b5f147821dea003ee9d733b40bfff23e2c40f04
  * sdl2:[email protected] -- C:\Users\private\AppData\Local\vcpkg\registries\git-trees\c34f21447296be501bab81979e8d0698264b48c3
    sdl3:[email protected]#2 -- C:\Users\private\AppData\Local\vcpkg\registries\git-trees\696763312883c589e3a9b07f42b7293de4dcf2b1
  * vcpkg-cmake:x64-windows@2024-04-23 -- C:\Users\private\AppData\Local\vcpkg\registries\git-trees\e74aa1e8f93278a8e71372f1fa08c3df420eb840
  * vcpkg-cmake-config:x64-windows@2024-05-23 -- C:\Users\private\AppData\Local\vcpkg\registries\git-trees\97a63e4bc1a17422ffe4eff71da53b4b561a7841
Additional packages (*) will be modified to complete this operation.
[DEBUG] Default binary cache path is: C:\Users\private\AppData\Local\vcpkg\archives
A suitable version of 7zip was not found (required v24.9.0) Downloading portable 7zip 24.9.0...
Downloading 7zip...
https://github.com/ip7z/7zip/releases/download/24.09/7z2409.exe->C:\Users\private\projects\vcpkg\downloads\7z2409.7z.exe
Downloading https://github.com/ip7z/7zip/releases/download/24.09/7z2409.exe
[DEBUG] Trying to hash C:\Users\private\projects\vcpkg\downloads\7z2409.7z.exe.9952.part
[DEBUG] C:\Users\private\projects\vcpkg\downloads\7z2409.7z.exe.9952.part has hash a39a84b13b383ac5fca20eb6d92ec6b8bc85f1b6a545c441efdbe054d8d12c9ebe97d366235bdf1383bbdb2a9666d18d0145b10b6e589180502c0c2dfa26ef14
Extracting 7zip...
[DEBUG] 1016: CreateProcessW("C:\Users\private\projects\vcpkg\downloads\tools\cmake-3.30.1-windows\cmake-3.30.1-windows-i386/bin/cmake.exe" -E tar xzf "C:\Users\private\projects\vcpkg\downloads\7z2409.7z")
CMake Error: Problem with archive_read_next_header():
CMake Error: Problem extracting tar: C:\Users\private\projects\vcpkg\downloads\7z2409.7z
[DEBUG] 1016: cmd_execute() returned 1 after 13274 us
'CMake' failed while extracting C:\Users\private\projects\vcpkg\downloads\7z2409.7z.
[DEBUG] D:\a\_work\1\s\src\vcpkg\archives.cpp(323):
[DEBUG] Time in subprocesses: 1434477us
[DEBUG] Time in parsing JSON: 38199us
[DEBUG] Time in JSON reader: 1316us
[DEBUG] Time in filesystem: 6095us
[DEBUG] Time in loading ports: 646us
[DEBUG] Exiting after 2.3 s (2291753us)

Additional context

I was looking at some of the scripts that download the tools, and it looks like there's been a change within the last week to use something called z-extract? Commit 0c4cf19. Maybe that's the culprit?

Also FWIW, I do have the correct version of 7zip installed, but it looks like it's already a known issue that vcpkg does not inspect the local path for tool compatibility and instead always downloads its own version.

@jimwang118
Copy link
Contributor

Yes, vcpkg has updated the tools that need to be downloaded. The solution is that you need to re-run the ./bootstrap-vcpkg.bat script to update the vcpkg tools after updating the vcpkg library.

@jimwang118 jimwang118 added the category:question This issue is a question label Dec 20, 2024
@evilteq
Copy link

evilteq commented Dec 20, 2024

bootstrap-vcpkg.bat solved the issue for me, thanks a lot!

However, as someone who spent some time trying to figure out what was going on, I'd suggest that something(tm) could be checked and reported better to the user. The error is very very misleading.

@constcuriosity
Copy link
Author

Thanks jimwang118! That did resolve my issue.

Echoing evilteq above, some more actionable error reporting would be every nice. I was expecting to only require running bootstrap once upon vcpkg installation, and not other times when getting latest.

@amir1376irani
Copy link

Yes, vcpkg has updated the tools that need to be downloaded. The solution is that you need to re-run the ./bootstrap-vcpkg.bat script to update the vcpkg tools after updating the vcpkg library.

It certainly solves the issue
I think it's better to close the issue and mark it as solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

4 participants