How to install Zig on your machine?

Today I see a new tool to install zig,

AFAIK, there are some similar tools for this purpose, maybe we should mention in Install Zig from a Package Manager · ziglang/zig Wiki · GitHub

@kristoff Any thoughts?

I used zigenv to manage multiple zig versions. However, it seems to be only worked on Linux for now.

Some time ago, I wrote a script to do a similar thing: mydots/.local/bin/zigup at main · michalsieron/mydots · GitHub.
I was inspired by zipgup from marler8997, but thought that a full-blown binary was a little too much for this job. It was also a nice exercise in writing a bigger shell script.

I use asdf but that doesn’t recognize “smaller than patch” changes, like all changes to master (updates keep 0.11.0 version). It does update but needs a uninstall/install to activate.

I think that most of these tools should not be endorsed as an official way of getting Zig.
The best way to get Zig is to get the archive, unzip it and add it to PATH manually, or trust your distro’s package manager to do the correct thing (which right now mostly defaults to giving you a stale copy of Zig, unfortunately, but also understandably given the unstable nature of the project).

Third party tools like this one can be useful for sure but require trusting somebody who isn’t us nor your distro maintainers, and they tend to have their own install instructions and/or dependencies.

The fact that Zigup is a static binary is good because it means that it has no dependencies and it’s guaranteed to work every time.

1 Like

I use a short shell script to install/update the latest from zig-master.

It includes checksum verification and depends on jq, curl, and tar.

It makes sense that Zig does not bless an official installer/updater for now, though. Manual installation is secure and dependency-free. This thread shows that there are plenty of options for people who want to automate updates.