Introducing zv: A fast Zig version manager written in Rust
Tired of juggling Zig versions? I built zv to make installing/switching between Zig toolchains effortless. Regardless of your platform.
Key features:
Project-aware versioning - Just add .zigversion to your repo and zv automatically uses the right version
Flexible version syntax - zv use 0.13.0 for stable, zv use master for latest dev, or zig +0.14.0 build to run commands with a specific version. This is made possible because I adopted rustupās proxy system for zv.
Smart cleanup - zv rm --except 0.13.0,master to free up space while keeping what you need
Multiple architectures - Your shell/platform is auto-detected.
Status: Alpha but stable! Iāve tested most core features and they work great and working great. ZLS support coming soon
Install via cargo: cargo install zv (latest 0.1.1)
Then run zv setup -d to preview changes (creates an env file & adds ZV_DIR/bin to PATH)
Then after youāve verified the changes run zv setup to install zv @ ZV_DIR/bin by default $HOME/.zv
finally uninstall the cargo binary: cargo uninstall zv
Nice to see a similar thing. I prefix the version with + following rustupās style. About the minimum_zig_version from build.zig/build.zig.zon it shouldnāt be too hard to implement it before 1.0.0. Thanks for the feedback!
Hi @zv2 , welcome to ziggit. The people in here and through out zig communities are generally pretty down to earth. We donāt care to be marketed to. Saying things like āBlazing Fastā are big red flags, especially when there is no accompanying benchmark data.
Instead, just be genuine, and direct. Just tell people what youāve worked on and some things you might be proud of about it.
I donāt say this as a reprimand, but as a kind word to help you assimilate to a new community.
It would be ideal to have something like ./zigw in the root of the repository (similar to ./gradlew). Just run ./zigw and donāt worry about version, mirrors, how it was downloaded or cached and never rely on garbage in your PATH.
Got it, thanks for pointing that out ā I should clarify that the āblazing fastā bit was meant tongue-in-cheek, since that phrase is often jokingly used with Rust projects. What it actually does is pretty straightforward: download + verification + extraction, using the best native Rust crates I could find for the ecosystem. Iāll keep it more direct going forward
Integration with homebrew, scoop, apk etc⦠would be even better than running a shell script which downloads an āuntrustedā binary of course, but thatās also a lot more hassle on the tool authorās side.
I feel you and thatās why this is alpha software. Iāve contemplated both one liner shell-scripts that would fetch some popular binaries generated via CI or integration with some package managers like scoop, choco, apt & pacman but this would come after I reach full feature compatibility (zv update & zls support).
Feel the same, and you know, software that builds software - like Zig - are high-value targets for supply chain attacks.
If I were to use a versioning system for a compiler (Iām personally not), then I want to understand it fully and it must be easy to see what has changed when the version manager is upgraded.
This is asking me to get confident with a surprisingly large amount non-Zig code for a Zig version manager, including a whopping 35 direct dependencies (a grand total of 116 crates were downloaded)