You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like there is a weird cache issue as well, if you use a slightly older zig (0.11.0-dev.2666+1e207f1ed) to successfully build (and generate caches) then use the broken zig (0.11.0-dev.2680+a1aa55ebe) it works but with no cache it fails.
$ rm -rf zig-cache zig-out ~/.cache/zig
$ zig version
0.11.0-dev.2680+a1aa55ebe
$ zig build
error: EndOfStream
$ # switch to working zig tarball
$ zig version
0.11.0-dev.2666+1e207f1ed
$ zig build
$ # switch back to broke zig tarball
$ zig version
0.11.0-dev.2680+a1aa55ebe
$ zig build
$ # same zig that gave `error: EndOfStream` above successfully compiled
$ rm -rf zig-cache zig-out ~/.cache/zig
$ zig build
error: EndOfStream
$ # but with no cache it fails again
I get a different, but possibly related error on 0.11.0-dev.2685+fac120bc3 from TLS: error: TlsInitializationFailed
I don't have the full debugging output to hand right now. However it appears that it's trying to use an expired certificate when downloading libs from GitHub. The certificate appears to be different from the one FireFox displays.
If you have a cache present then possibly it doesn't have to fetch the libraries. I suppose if this is the issue then providing the lib srcs by some other method might work. I'm not sure how it all works.
EDIT: I was able to compile ZLS by serving the archives in build.zig.zon from localhost.
It looks like this only happens when a request is redirected which happens for all github archive urls: https://github.com/project/repo/archive/hash.tar.gz -> https://codeload.github.com/project/repo/tar.gz/hash
There is a different error after the certificate was resolved.
thread 64428 panic: incorrect alignment
... ```
I guess the problem is the headers object is deinitialized 3 times. Because the Request object calls deinit on headers, but it doesn't have owenership of that object. It first gets deinitialized by fetchAndUnpack in Package.zig, then twice by Request in Client.zig due to the redirect.
commit 1342942 seems to be the cause of that. Removing the headers deinit from lib/std/http/Client.zig:512 stops it.
However I then also get the EndOfStream error. So we have come full circle.
However I then also get the EndOfStream error. So we have come full circle.
The EndOfStream error is caused by the client not handling redirects correctly, it never starts a new request so the error you get is from the client trying to read the old connection which have no more data. There is a PR #15443 to fix that issue.
However I then also get the EndOfStream error. So we have come full circle.
The EndOfStream error is caused by the client not handling redirects correctly, it never starts a new request so the error you get is from the client trying to read the old connection which have no more data. There is a PR #15443 to fix that issue.
Same error when building zls from source on Ubuntu 20.04 occurs again with zig version0.12.0-dev.1861+412999621 when behind proxy ... it worked in prior versions? wget and curl work correctly, what could be the reason for this failing with EndOfStream again? Why is there an active internet connection required anyway for building zls?
Activity
leecannon commentedon Apr 20, 2023
Seems like there is a weird cache issue as well, if you use a slightly older zig (0.11.0-dev.2666+1e207f1ed) to successfully build (and generate caches) then use the broken zig (0.11.0-dev.2680+a1aa55ebe) it works but with no cache it fails.
richiejp commentedon Apr 21, 2023
I get a different, but possibly related error on 0.11.0-dev.2685+fac120bc3 from TLS:
error: TlsInitializationFailedI don't have the full debugging output to hand right now. However it appears that it's trying to use an expired certificate when downloading libs from GitHub. The certificate appears to be different from the one FireFox displays.
If you have a cache present then possibly it doesn't have to fetch the libraries. I suppose if this is the issue then providing the lib srcs by some other method might work. I'm not sure how it all works.
EDIT: I was able to compile ZLS by serving the archives in build.zig.zon from localhost.
DraagrenKirneh commentedon Apr 21, 2023
@richiejp The TlsInitializationFailed should be resolved now. The cause was github returning a certificate that had expired, they have fixed it now.
It will still fail on deinit headers though.
neeraj9 commentedon Apr 21, 2023
There is a different error after the certificate was resolved.
andrewrk commentedon Apr 21, 2023
cc @truemedian
neeraj9 commentedon Apr 21, 2023
Could this be due to memory leak identified in #15372?
DraagrenKirneh commentedon Apr 21, 2023
It looks like this only happens when a request is redirected which happens for all github archive urls:
https://github.com/project/repo/archive/hash.tar.gz->https://codeload.github.com/project/repo/tar.gz/hashrenerocksai commentedon Apr 22, 2023
Damn. If I change the URL in my build.zig.zon, zig build doesn't like it because the .tar.gz extension is stripped from the end of the URL
nektro commentedon Apr 23, 2023
@renerocksai you should open that as an issue as well
renerocksai commentedon Apr 23, 2023
Oh, OK, will do
richiejp commentedon Apr 24, 2023
I guess the problem is the headers object is deinitialized 3 times. Because the Request object calls deinit on headers, but it doesn't have owenership of that object. It first gets deinitialized by
fetchAndUnpackin Package.zig, then twice by Request in Client.zig due to the redirect.commit 1342942 seems to be the cause of that. Removing the headers deinit from
lib/std/http/Client.zig:512stops it.However I then also get the
EndOfStreamerror. So we have come full circle.DraagrenKirneh commentedon Apr 24, 2023
The EndOfStream error is caused by the client not handling redirects correctly, it never starts a new request so the error you get is from the client trying to read the old connection which have no more data. There is a PR #15443 to fix that issue.
richiejp commentedon Apr 24, 2023
Yes, that works. Thanks.
truemedian commentedon Apr 24, 2023
#15416 and #15445 fixes all of the associated errors here.
gwd666 commentedon Jan 2, 2024
Same error when building
zlsfrom source on Ubuntu 20.04 occurs again withzig version0.12.0-dev.1861+412999621when behind proxy ... it worked in prior versions?wgetandcurlwork correctly, what could be the reason for this failing withEndOfStreamagain? Why is there an active internet connection required anyway for buildingzls?