https://ziglang.org/download/latest does not exist (macos, x86_64)
os=macos, arch=x86_64
❯ zig-out/bin/zigup fetch latest
install directory '/Users/me/zig'
mkdir '/Users/me/zig'
rm -rf '/Users/me/zig/latest.installing'
mkdir '/Users/me/zig/latest.installing'
downloading 'https://ziglang.org/download/latest/zig-macos-x86_64-latest.tar.xz' to '/Users/me/zig/latest.installing/zig-macos-x86_64-latest.tar.xz'
error: download 'https://ziglang.org/download/latest/zig-macos-x86_64-latest.tar.xz' failed: HTTP server replied with unsuccessful response '404 Not Found'
rm -rf '/Users/me/zig/latest.installing'
https://ziglang.org/download/latest/ does not exist. From what I can tell with my limited zig-knowledge zigup.zig downloads download_index_url = "https://ziglang.org/download/index.json" and I don't see how it gets this latest/ path .
I think you're looking for zigup master. latest isn't a special reserved version so it's trying to interpret it as a version specifier (i.e. 0.14.0-dev.2271+f845fa04a). It would be nice to improve this error message but having non-special versions has valid use cases, for example you can copy a versioned subdirectory and name it whatever you want and just switch to it via zigup my-custom-version.
If I try to download a nominated zig version like 2024.10.0-mach with zigup 0.14.0-dev.1911+3bf89f55c, I also get a 404 error.
I just looked up the latest nominated version from here.
└─> zigup 0.14.0-dev.1911+3bf89f55c
install directory '/home/henning/zig'
mkdir '/home/henning/zig'
rm -rf '/home/henning/zig/0.14.0-dev.1911+3bf89f55c.installing'
mkdir '/home/henning/zig/0.14.0-dev.1911+3bf89f55c.installing'
downloading 'https://ziglang.org/builds/zig-linux-x86_64-0.14.0-dev.1911+3bf89f55c.tar.xz' to '/home/henning/zig/0.14.0-dev.1911+3bf89f55c.installing/zig-linux-x86_64-0.14.0-dev.1911+3bf89f55c.tar.xz'
error: download 'https://ziglang.org/builds/zig-linux-x86_64-0.14.0-dev.1911+3bf89f55c.tar.xz' failed: HTTP server replied with unsuccessful response '404 Not Found'
rm -rf '/home/henning/zig/0.14.0-dev.1911+3bf89f55c.installing'
I am experiencing the same issue.
$:~/code/zig-game-dev$ zigup 0.13.0-dev.351+64ef45eb0
install directory '/home/caps/zig'
mkdir '/home/caps/zig'
rm -rf '/home/caps/zig/0.13.0-dev.351+64ef45eb0.installing'
mkdir '/home/caps/zig/0.13.0-dev.351+64ef45eb0.installing'
downloading 'https://ziglang.org/builds/zig-linux-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz' to '/home/caps/zig/0.13.0-dev.351+64ef45eb0.installing/zig-linux-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz'
error: download 'https://ziglang.org/builds/zig-linux-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz' failed: HTTP server replied with unsuccessful response '404 Not Found'
rm -rf '/home/caps/zig/0.13.0-dev.351+64ef45eb0.installing'
I don't know if this helps, but as far as i can tell from https://ziglang.org/downloads the URLs for versions 13 and 12 appear to be different. Instead of builds/version the are in the format of downloads/0.13.0/version (or 0.12.0)
URL for 0.13.0: https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz
As a quick workaround I tried putting a manually downloaded version into the $HOME/zig directory, but zigup default <version> returns a compiler is not installed error. Is there a way to add a compiler version manually?
I think the reason it's not working is likely cause it's old enough that it's been cleaned up from the server and is no longer available.
To answer your second question, yes you can manually add compilers to zigup. Just copy the compiler to your install directory. It does need to go into a subdirectory named files though, maybe that's why it didn't work for you?
Thank you for your advice.
After putting the compiler files in a sub-folder files it stopped throwing the error. However the zig command cannot be found. It seems that zigup isn't creating any links (seems to be a permissions issue).
$ zigup default 0.14.0
install directory '/home/caps/zig'
mkdir '/home/caps/zig'
ln -s '/home/caps/zig/0.14.0/files/zig' '/usr/bin/zig'
error: AccessDenied
When I checked the /usr/bin directory there was a broken symbolic link named zig. After deleting it the error persists.
I was able to work around this by using zigup with sudo, but in that case it created the folder containing the compilers under /root/zig, which is undesirable.
Do I need to create a link manually or have I done something wrong during installation?
To provide some context for my question all I did for installation was curl the zigup archive, extract it and move it to usr/bin.
Zigup is failing to create the 'zig' symlink because it doesnt have permission to create it at /usr/bin/zig'. Zigup creates the zig symlink in the same directory where zigup lives, so the solution is to put the zigup binary in a directory that your current user has write access to.
I typically put zigup in $HOME/bin/zigup which my current user always has write access to. If you do this you likely also want to ensure $HOME/bin is added to your PATH environment variable by whatever mechanism your OS uses to manage it.