How to install Zig of a specific snapshot version

Hello. I’m having issues with 0.16 when targeting wasm32-emscripten and as far as I’m aware it’s a known problem. Latest 0.17 works fine, but ZLS stops working and it’s hard to work without an LSP.

ZLS explicitly states:

  • use Zig 0.17.0-dev.387+31f157d80 with master branch ZLS

So 0.17.0-dev.387+31f157d80 is both 0.17 and works with ZLS (in theory). The question is - how to obtain it? Is building from source the only way?

The official Zig downloads page has some snapshots available for download. For example, I was able to download zig-aarch64-macos-0.17.0-dev.1252+e4b325c19 earlier by just putting the version in the url. Unfortunately, this doesn’t work for 0.17.0-dev.387+31f157d80, probably because this snapshot was never available for download anyways.

Easiest way would be to use one of the many zig version manager tools, e.g anyzig, zvm, zigman, etc.

These will download from community mirrors (well anyzig doesnt last i checked)

Mirrors aren’t guaranteed to have the version you want, but I did test and some do.

zvm cannot do that. It seems to only allow stable version and latest master (?). Didn’t know about the others, might actually works, thx. Maybe I will be able to download from community mirrors myself

I can tell you for a fact zigman works.

I can also say for a fact that it verifies downloads properly and cycles through mirrors until one (or none) is found that has the version you request.

Disclaimer that I made it, and that it is not feature complete.

How to find zigman? I mean, I don’t see it in search results..

https://codeberg.org/vulpesx/zigman

I should work on it again sometime soon

1 Like

Thanks. I was actually able to download the necessary snapshot from one of the mirrors. Hope you continue your work on zigman.

1 Like

I’ve typically used anyzig for automatically managing odd zig versions.

1 Like