-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Error downloading zip from GitHub: "stream reading entries with data descriptors" #1080
Comments
Looks like this is a limitation of the |
Yeah, I also think it is an async-zip limitation as I don't remember adding this to binstalk-downloader. @mtkennerly can you try creating zips without data descriptors? |
@mtkennerly Thank you for filing this bug and finding out the root case! |
Sorry, I'm actually not sure how to do that. It was just created by However, I just tried the
I even went back a few versions, and it was still working. I have no idea why it works in that example but not in cargo-binstall. |
@mtkennerly I think that's because you use the AsyncSeek API which does support data descriptorsc whereas binstalk-downloader uses the streaming API which does not support this. |
Can you manually create the zip, then use https://github.com/softprops/action-gh-release to upload it release or just manually create and upload the zip? |
According to wikipedia page for zip format:
That basically explains what data descriptor is and the challenges for implementing this in streaming mode. |
From man zip(1):
and
@ |
@mtkennerly I think if you use zip directly to create a new achieve from scratch, then it will not use data descriptors. |
Ah, yeah, you're right, the example uses the other API.
Sure! Created a zip through Windows Explorer and made a test release. It works: [package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-url = "https://github.com/mtkennerly/playground/v0.1.0/ludusavi-async-zip-test{ archive-suffix }"
|
I'm not familiar with all the trade-offs between the seek and stream APIs, but do you think it could make sense for cargo-binstall to use the seek API if it has broader compatibility? I'd guess that a lot of GitHub projects could be affected by this if they're also using |
Yeah I think this makes sense, but let me create an issue at the upstream first to see if it's going to be implemented in next version and how long it will take. If they are going to support this soon, then we might not need to switch to AsyncSeek API. |
I've opened Majored/rs-async-zip#94 in upstream |
I noticed that Majored/rs-async-zip#94 is closed and that cargo-binstall is now using async_zip v0.0.17, so I gave this a try with cargo-binstall v1.9.0 and got a different error:
I also get that error using the zip link from #1080 (comment) , which had worked when I made that comment. |
It seems the pre-built binary for that crate is broken, the crc32 checksum doesn't match. |
I think it's caused by this issue: Majored/rs-async-zip#141 |
Thanks, once async-zip fixed it I would bump it and cut a new release |
I could open a separate issue for this if you'd like? This seems to be another failure example with $ cargo binstall qsv
INFO resolve: Resolving package: 'qsv'
WARN resolve: Error while downloading and extracting from fetcher github.com: Failed to extract zipfile: Encountered an unexpected header (actual: 0x6501040c, expected: 0x4034b50).
WARN resolve: Error while downloading and extracting from fetcher github.com: Failed to extract zipfile: Encountered an unexpected header (actual: 0x6501040c, expected: 0x4034b50).
WARN The package qsv v0.134.0 will be installed from source (with cargo) The Building from source uses over 10GB in RAM I think (due to their release profile having UPDATE: Ran with verbose output, it found the correct asset from the Verbose output scoped from check to warning
Since the archive has more than one file, curl -o qsv.zip -fsSL https://github.com/jqnatividad/qsv/releases/download/0.134.0/qsv-0.134.0-x86_64-unknown-linux-musl.zip && unzip qsv.zip qsv From this
@mtkennerly off-topic, but you may want to consider dropping the version from your published releases (see this issue for justification), |
I think your reasoning in the other ticket is valid, but I do like having the version as a personal preference. I'm the type to hang onto old installers and manage programs manually, so I like when the installer file names are sorted and won't conflict with each other if I download multiple versions. (Yes, I use Windows 🙃) |
We could fork the upstream and publish the latest main. or maybe we could consider switching to rc-zip, it seems to have more activity and also supports async, but not sure if it reaches feature parity with rs-async-zip |
The upstream has not responded yet and I think rc-zip is probably good enough, so we should switch to it. |
Fixed #1080 In this commit, binstalk-downloader is updated to - first download the zip into a temporary file, since there is no correct way to extract zip from a stream. - then use rc-zip-sync to read from the zip and extract it to filesystem. Signed-off-by: Jiahao XU <[email protected]>
Fixed #1080 In this commit, binstalk-downloader is updated to - first download the zip into a temporary file, since there is no correct way to extract zip from a stream. - then use rc-zip-sync to read from the zip and extract it to filesystem. Signed-off-by: Jiahao XU <[email protected]>
Fixed #1080 In this commit, binstalk-downloader is updated to - first download the zip into a temporary file, since there is no correct way to extract zip from a stream. - then use rc-zip-sync to read from the zip and extract it to filesystem. Signed-off-by: Jiahao XU <[email protected]>
* Use rc-zip-sync for zip extraction Fixed #1080 In this commit, binstalk-downloader is updated to - first download the zip into a temporary file, since there is no correct way to extract zip from a stream. - then use rc-zip-sync to read from the zip and extract it to filesystem. Signed-off-by: Jiahao XU <[email protected]> * Fix returned `ExtractedFiles` in `do_extract_zip` Signed-off-by: Jiahao XU <[email protected]> * Fix clippy in zip_extraction.rs Signed-off-by: Jiahao XU <[email protected]> --------- Signed-off-by: Jiahao XU <[email protected]> Signed-off-by: Jiahao XU <[email protected]>
This works for me now in 1.10.10 🎉 Thanks! |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [cargo-bins/cargo-binstall](https://github.com/cargo-bins/cargo-binstall) | patch | `v1.10.8` -> `v1.10.13` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>cargo-bins/cargo-binstall (cargo-bins/cargo-binstall)</summary> ### [`v1.10.13`](https://github.com/cargo-bins/cargo-binstall/releases/tag/v1.10.13) [Compare Source](cargo-bins/cargo-binstall@v1.10.12...v1.10.13) *Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`.* ##### In this release: - Use git credential helper for github token auto discovery (can be disabled via `--no-discover-github-token`) ([#​1871](cargo-bins/cargo-binstall#1871)) ##### Other changes: - Upgrade transitive dependencies ### [`v1.10.12`](https://github.com/cargo-bins/cargo-binstall/releases/tag/v1.10.12) [Compare Source](cargo-bins/cargo-binstall@v1.10.11...v1.10.12) *Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`.* ##### In this release: - Speedup installation script by avoiding additional network trip ##### Other changes: - Upgrade dependencies (hickory-dns, thiserror, file-format, etc). ### [`v1.10.11`](https://github.com/cargo-bins/cargo-binstall/releases/tag/v1.10.11) [Compare Source](cargo-bins/cargo-binstall@v1.10.10...v1.10.11) *Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`.* ##### In this release: - Upgrade dependencies to fix compilation failures due to yanked dependency fs4 0.10 ### [`v1.10.10`](https://github.com/cargo-bins/cargo-binstall/releases/tag/v1.10.10) [Compare Source](cargo-bins/cargo-binstall@v1.10.9...v1.10.10) *Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`.* ##### In this release: - Use rc-zip-sync for zip extraction ([#​1080](cargo-bins/cargo-binstall#1080) [#​1942](cargo-bins/cargo-binstall#1942)) - Better UI: default to "yes" for installation prompt, and display more readable message for the prompt ([#​1943](cargo-bins/cargo-binstall#1943) [#​1948](cargo-bins/cargo-binstall#1948) [#​1950](cargo-bins/cargo-binstall#1950) ) ##### Other changes: - Upgrade dependencies ([#​1949](cargo-bins/cargo-binstall#1949)) ### [`v1.10.9`](https://github.com/cargo-bins/cargo-binstall/releases/tag/v1.10.9) [Compare Source](cargo-bins/cargo-binstall@v1.10.8...v1.10.9) *Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`.* ##### In this release: - Upgrade dependencies </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Hi! I was trying to add cargo-binstall support to a project of mine, but I got an error about the zip file on GitHub:
I'm using cargo-binstall 0.23.0 on Windows 11. Here's the excerpt from my Cargo.toml:
Log excerpt showing the URL:
The text was updated successfully, but these errors were encountered: