iTranslated by AI
Zig v0.13.0 Released ⚡
Intro
It looks like Zig v0.13.0 has been released. How exciting! ⚡⚡⚡
Speaking of Zig, it's a language where breaking changes are still introduced with every update. This time, focusing on the differences from v0.12.0, let's take a quick look at the changes in v0.13.0.
Overview
- Release date: 2024.06.07
-
Release Notes
- By the way, Zig release notes since v0.12.0 no longer list breaking changes or API changes. You won't know until you try it—that's Zig.
Changes
Please refer to the release notes for basic changes. Here, I'm picking up only the points that require attention during migration from v0.12.0 or that personally caught my interest.
LazyPath removes the .path field
It seems the .path field has been removed from std.Build.LazyPath (Source). LazyPath used to be used like this when specifying source file paths:
# v0.12.0
dwarf_exe = b.addExecutable(.{
.name = "out",
.root_source_file = .{ .path = "src/main.zig" },
});
In v0.13.0, let's simply use std.Build.path():
dwarf_exe = b.addExecutable(.{
.name = "main",
.root_source_file = b.path("src/main.zig"),
});
zig-cache renamed to .zig-cache
Until Zig v0.12.0, build artifacts were placed in zig-cache at the root of the build tree. From v0.13.0 onwards, they will be placed in .zig-cache. A dot was added—how cute.
Don't forget to update your .gitignore.
glibc 2.39 support
It seems it's now possible to use glibc 2.39 during cross-compilation. By the way, Zig comes bundled with many libcs.
Actually, glibc is already at 2.39... I feel like 2.32 came out only recently.
std.debug.getStderrMutex() is now deprecated
std.debug.getStderrMutex() has been deprecated. In its place, methods like std.debug.lockStdErr() have been added to acquire the lock. It's nice that it saves a step:
# v0.12.0
std.debug.getStderrMutex().lock();
# v0.13.0
std.debug.lockStdErr()
LLVM updated to 18
LLVM has been updated to 18.1.7.
I'm not sure if it's because of this, but I noticed that a section header called .relro_padding has been added to the ELF header. It seems that starting with LLD 18, such sections are being included...
Outro
Honestly, (within the scope of what I use) I don't think there are any massive changes. Even the breaking changes are quite mild this time.
If there are any other changes you think I should be aware of, please let me know.
Well then, I'm going to go pet a Shiba Inu.
Discussion