-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[std.http] zig build fails to download large archives from github #15342
Comments
I don't have a minimally failing example, but I think I'm seeing the same thing directly in the HTTP client if I get a response that is both chunked and gzip'd. Posting just in case this is helpful. Snipped loop, reading an HTTP response that has already been
Ends with a GZIP error when it tries to read one more checksum byte after already reaching the end of its input stream.
The actual response size is only 373 bytes, so the loop should only execute once in normal execution. |
I do, and it is Zig itself :) .{
.name = "foo",
.version = "0.0.0",
.dependencies = .{
.zig = .{
.url = "https://github.com/ziglang/zig/archive/bf827d0b555df47ad2a2ea2062e2c855255c74d1.tar.gz",
},
},
} |
Noting that this is blocking Ghostty from adopting the package manager. The following projects are all too build to big:
|
This issue should be renamed, the std.http bug has been fixed for a while now. It's now a std.tar issue. |
Handles .extended_header type to parse PAX attributes and check if they override the path of the next file. Increases maximum file path length from 255 to 1014. Fixes ziglang#15342
The reproduction tar (link provided above) contains PAX attributes.
#16990 adds support for this. |
Handles .extended_header type to parse PAX attributes and check if they override the path of the next file. Increases maximum file path length from 255 to 1014. Fixes ziglang#15342
Handles .extended_header type to parse PAX attributes and check if they override the path of the next file. Increases file path limit to std.fs.MAX_PATH_BYTES. Fixes ziglang#15342
What was the issue / fix / PR for the HTTP part of the issue? |
If I remember correctly #15445 fixed the problem encountered here, the redirect was causing the issue. |
Handles .extended_header type to parse PAX attributes and check if they override the path of the next file. Increases file path limit to std.fs.MAX_PATH_BYTES. Fixes #15342
@truemedian Do you remember/know how #15376 and various other issues only mention Is it possible that this issue was always about the PAX attributes, and the HTTP issue was merely a red herring? |
The HTTP issue was certainly happening for everyone who tried to make a request to github.com/*/archive, because they all redirect to the github CDN. But that issue has been fixed for the past 5 months. |
Right, but the redirect issue was fixed after this issue was filed. The other issue about the redirect bug mentions This makes me wonder if the HTTP bug was really related here (even though it should be because it uses the same GitHub archive link in the Guess I could test it by reverting the PAX attribute impl and seeing what gets thrown. |
Can I specify local folder path instead of using The repo I am talking is capy, UI for Zig. I was hoping that I can learn Zig while doing UI while I have worst ever days with slowest possibly internet, but... |
Zig Version
0.11.0-dev.2648+3cd19dd89
Steps to Reproduce and Observed Behavior
Note: This is almost certainly a bug in
std.http
rather than the build system.build.zig
:build.zig.zon
with a link to reproduce the bug:zig build
The build will fail with one of two errors, seemingly at random:
error: TarComponentsOutsideStrippedPrefix
error: BadReaderState
Note that the tar archive the link points to is very large (>90MB). I suspect that this causes the GitHub server to use chunked encoding, which may cause either invalid data or a crash in the HTTP implementation in the two possible cases.
This is the stack trace produced by a debug build of Zig in the former case:
Expected Behavior
The dependency is downloaded.
The text was updated successfully, but these errors were encountered: