Zig fetch EndOfStream error

zig fetch --save="x86_64-windows-msvc-llvm-18.1.7" https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.7/clang+llvm-18.1.7-x86_64-pc-windows-msvc.tar.xz

this command results in error: unable to unpack tarball to temporary directory: EndOfStream

so, was wondering if this is a known issue. or anyone else is encountering it.

My guess would be that the temporary directory is hitting a physical size limit, for example being on a partition that is running out of memory while the unpacking is being done.

I don’t know where this temporary directory is located on windows.
I imagine if you have a system and user partition and the temporary directory happens to be part of the system partition maybe it is almost full?

All of this are just my first guesses, to dig into it more deeply it would be helpful to get a full stacktrace, I am unsure whether a normal Zig build gives you that, or if you require a debug build of Zig.

Do you have any more info? (Like operating system, zig version, etc.)

Have you checked whether any of your partitions are filled to the brim, so that they can’t fit the uncompressed archive?

Using zig-windows-x86_64-0.14.0-dev.1359+e9a00ba7f, space shouldn’t be an issue also tried on a linux vps, with the same version 0.14.0-dev.1359+e9a00ba7f, got same result, may be some issue from github’s end but manual download using python’s requests module and combination of tar xf command seems to be working normally

1 Like

I just ran the command on linux with zig 0.13.0 and got the same error.
I wonder whether it would be possible to enable a more verbose log level.

Maybe somebody with a debug build of zig can reproduce and see why it fails.

A normal build of LLVM+Zig already takes a long time on my laptop, so I am hesitant going for a debug build.

1 Like

I believe it’s the download that is failing/being truncated, and Zig doesn’t retry on error. Relevant issues:

(downloading the file from the OP in Firefox failed at around 40% for me, but resuming afterwards worked)

3 Likes