asdf is a good general tool version management tool. Just like
nodejs. It supports plugins so it can be used as a one tool to rule all languages thing. So I was attempted to use it to manage my local
Then I found
asdf-zig from asdf-community/asdf-zig, and it works, and works great! Until that I found as
zig envolves fast, seems every important project is using their own specific dev version like
0.12.0-dev.1828+225fe6ddb, they are unfortunately not supported by
But I do want to use this tool for managing my local
zig versions, so again, seems the code of
asdf-zig is simple enough, so I forked and created my own flavor, where I put it at https://github.com/liyu1981/asdf-zig.
Simply to say, it allows to create a custom version file at
~/.asdf/custom/zig/versions.json like below
asdf list-all zig can show these versions and
asdf install zig 0.12.0-dev.2139+e025ad7b4 can install it and then use it as it supports natively.
Following pictures shows how it is used
a fork of
asdf-zig for supporting custom versions
asdf-zig can only support what versions are listed at
https://ziglang.org/download/index.json, which are all versions either official or cutting-edge master. But as we know
zig is evolving fast, sometime I need to stick with a specific version for a while, like
0.12.0-dev.2139+e025ad7b4. This is easy job if just download it and make it available to my path. But if there are multiple projects using different custom zig version, manual changing will be tedious.
So I start to miss
asdf, the one shop for managing many different new language runtimes, and luckily there is
asdf-zig, but unluckily it supports no custom versions.
So I just make my fork and adjust it a bit for my usage.
how it works
essentially my fork replaces the official
asdf-zig. To install it, need to remove the old one, just
added the ability to use
zig master version as @justinryanh commented.