Zig
mise can be used to install and manage multiple versions of zig on the same system.
The following are instructions for using the zig mise core plugin.
The code for this is inside the mise repository at ./src/plugins/core/zig.rs.
Usage
The following installs zig and makes it the global default:
mise use -g zig@0.14 # install zig 0.14.x
mise use -g zig@latest # install latest zig release
mise use -g zig@master # install latest nightly from master
mise use -g zig@2024.11.0-mach # install Mach nominated zig
mise use -g zig@mach-latest # install latest Mach nominated zigSee available stable versions with mise ls-remote zig.
Note that Mach versions won't show in mise ls-remote zig due to workaround for version ordering bug. Despite of that, you still can install Mach versions listed in Mach version index. The following command will list available Mach versions:
curl https://machengine.org/zig/index.json | yq 'keys'zig Language Server
The zig language server (zls) needs to be installed separately. You can install it with mise:
mise use -g zls@0.14 # install zls 0.14.x
mise use -g zls@latest # install latest zls releaseNote that a tagged release of zig should be used with the same tagged release of zls. Currently there is no Mach version of zls.
Settings
zig.use_community_mirrors
- Type:
Bool - Env:
MISE_ZIG_USE_COMMUNITY_MIRRORS - Default:
true
This setting allows mise to fetch Zig from one of many community-maintained mirrors.
The ziglang.org website does not offer any uptime or speed guarantees, and it recommends to use the mirrors. The mirror list is cached and allows the installs to succeed even if the main server is unavailable.
The downloaded tarballs are always verified against Zig Software Foundation's public key, so there is no risk of third-party modifications. Read more on ziglang.org.
If you don't have the mirror list cached locally, you can place the newline-separated
server list inside mise cache path, folder zig as community-mirrors.txt.