Zig plugin for the asdf version manager.
As a bonus, this plugin supports installing zls as well, so zls and zig version can match exactly.
This fork adds support for custom zig versions and master version installation.
bash,python3,tar, and POSIX utilities.- asdf 0.16+
After installing asdf, install the plugin by running:
asdf plugin remove zig # Remove official plugin if installed
asdf plugin add zig https://github.com/liyu1981/asdf-zig.gitor update an existing installation:
asdf plugin update zigThen use asdf-zig to manage zig:
# Show all installable versions
asdf list all zig
# Install specific version
asdf install zig 0.16.0
# or install latest tagged version with
asdf install zig latest
# Set a version globally (on your ~/.tool-versions file)
asdf set --home zig latest
# Now zig commands are available
zig version
# You can also check the ZLS version.
# It is designed to be highly compatible with the specific Zig version you installed.
zls versionCheck asdf readme for more instructions on how to install & manage versions.
This fork supports installing custom zig versions that are not in the official release index.
The official asdf-zig can only support versions listed at https://ziglang.org/download/index.json. But zig evolves fast, and sometimes you need to stick with a specific dev version like 0.12.0-dev.2139+e025ad7b4.
- Create the custom versions directory and file:
mkdir -p ~/.asdf/custom/zig
echo '{"0.12.0-dev.2139+e025ad7b4": {}, "0.12.0-dev.1828+225fe6ddb": {}}' > ~/.asdf/custom/zig/versions.json- Your custom versions will now appear in
asdf list all zigand can be installed withasdf install zig <version>.
You can also install the current master version of zig:
asdf list all zig # Shows master_<version> at the end
asdf install zig master_<version>The master version is prefixed with master_ to distinguish it from release versions.