What are other people doing? I read somewhere that using master may make it easier to transition as things change in the language.
I think it depends on your individual goals. I use a tagged release for the hobby projects I make every once in a while. I usually don’t port these to the newest Zig versions, since they are just learn projects or experiments.
I only use tagged releases and I port my projects when a new one comes out. It’s usually very simple! Make sure to read the release notes and then let the compile errors guide you
please where to find the master’s notes
There are some recommendations here.
I am currently use tagged/master at a random.
Sometimes I use master, sometimes tagged.
For some of my (hobby) projects I do code adjustments for the very recent tagged version, for some other I don’t.
In my /opt
I currently have:
$ ls -1 /opt/ | grep zig
zig-0.10
zig-0.11
zig-0.12
zig-0.13
zig-0.14
In the past, users have been recommended to target master due to the frequent breaking changes to the language and build system in combination with most documentation and beginner resources assuming you use master. And there’s no problem targeting master as long as you are fine with occasional breaking changes that might require you to do some investigative work to find the fixes to on your own.
However, one of the stated goals of the 0.12 (and by extension 0.13, which is feature-wise more or less identical to 0.12 without many breaking changes between them) was to leave Zig in enough of a good spot that projects could pin their required version to 0.12/0.13 instead of targeting master.
As far as I’m aware there haven’t yet been any major breaking changes to the language, the standard library or the build system since the tagged 0.13 release. I would say that the most significant additions that are exclusive to the master branch so far is support for file system watching with --watch
and support for fuzz testing.
If you want to target master but also want something more stable than “just download the most recent build and hope it works”, you could compromise by targeting one of Mach game engine’s nominated Zig master versions. (Note however that they haven’t yet nominated a 0.14 master version.)
Many people would also recommended you to use version managers like zvm or zigup to make it easier to switch between different versions of the compiler.
There isn’t one, but big PR’s tipically have the migration instructions in their notes. I usually check here in the forums and, if nobody’s saying anything, I check the recent merged pull requests.
I use the latest tagged release alongside the previous one, since those are my project’s targets. I also cross-compile occasionally for RISC-V and PowerPC. Master doesn’t support these platforms so well. Once in a while I switch to the newest master to check for breaking changes.
The main advantage of using master is that you get access to new compiler features and bug fixes before the release. For example last time I checked the current master was a lot faster than 0.13.0 at compiling my application (10s → 7.5s).
The main disadvantage is that it’s hard to get an old master release in the future. The master releases on ziglang.org are removed regularly, so if your application depends on a specific version, it will be difficult to compile it in the future. For example many of my old projects have ended in an unusable state, because the compiler version cannot be downloaded anymore.
So, unless you really want or need the latest master, I would recommend to go with a tagged release.
good point - today’s main is tomorrow’s tech debt!