A utility to download and install nightly zig builds.
Find a file
2025-11-24 10:14:55 -05:00
.gitignore initial commit, 1.0 2025-09-06 18:34:39 -04:00
go.mod initial commit, 1.0 2025-09-06 18:34:39 -04:00
LICENSE initial commit, 1.0 2025-09-06 18:34:39 -04:00
main.go added a check to make sure karearl.com is not selected as mirror 2025-11-24 10:14:55 -05:00
README.md broke the types into a separate file, cleaned up some comments 2025-09-13 15:49:22 -04:00
types.go broke the types into a separate file, cleaned up some comments 2025-09-13 15:49:22 -04:00

ZigGet

Description

This is a handy tool for manually installing the master version of Zig in a directory of your choice. Zig master branch is released as a nightly build.

This method gets around the limitations of the package managers being kept up to date. By default, this binary will reach out to the zig website, and compare the date of the nightly build with today's date. If the date on the website is today or yesterday, it will go ahead and download the build. This is done because I wanted this tool to be run with cron and there's no guarantee that when cron kicks off, today's nightly is available. You can do this via a crontab or create a small bash script that calls this binary and put the script in /etc/cron.daily

IMO this method is much easier than waiting on package maintainers, or trying to build from source on distros like Debian which don't get the latest packages.

Becuase we are attempting to manually manage our Zig version, if you don't have any version of Zig already unpacked, you can use the -force flag to make it download the most recent version regardless of the local machine state.

Note

This program assumes you are running on an x64 Linux machine. If you want to download different builds, you can edit the getWebVersion function and change the "newFileName := zigWeb.Master.x8664.Linux.Tarball" parameter to the appropriate build from the struct.

Examples:

  • This will install the zig folder to $HOME/.local. The tarball is downloaded to /dev/shm by default.
ZigGet -force
  • This is a setting you might use as root in the crontab to install Zig in /usr/local/zig for all system users. It also demonstrates changing the download location.
ZigGet -output /tmp -path /usr/local