Zig 0.13.0 released

moving fast! :heart:



Plans to upgrade to 0.12 before the next release comes out, shattered :rofl:


Jokes aside, I really appreciate this smaller release: dealing with language/stdlib changes and potential fallout from LLVM upgrade at the same time would be horrifying.

It’s very helpful both that the two failure modes are separated into two releases, and that there are just more releases, so there’s more incrementality to upgrades.

1 Like

The only breaking change I’ve noticed so far is std.Build.LazyPath. I have to add the following to my build file to support both 0.13.0 and 0.12.0:

fn lazyPath(b: *std.Build, path: []const u8) std.Build.LazyPath {
    if (@hasField(std.Build.LazyPath, "src_path")) {
        // 0.13.0
        return .{ .src_path = .{ .owner = b, .sub_path = path } };
    } else {
        // 0.12.0
        return .{ .path = path };
1 Like

The intended fix is


It was a 0.12.0 change but wasn’t breaking in 0.12.0:



there is also
std.ChildProcess (0.12.0) to std.process.Child(0.13.0)

Ah, there’s a built-in function. Nice. Thanks for the heads up.

1 Like

pretty substantial API change: std.Progress (release note). Related: Zig's New CLI Progress Bar Explained

I was able to convert build paths and ComptimeStringMap in one project. In my other project, I
…I’m just dumb. Seeing how other projects do it was more than obvious :sweat_smile:


don’t know how to change the Step.Compile.addIncludePath Does anyone know how I replace the addIncludPath? Build.zig below in second/third to last lines:

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});
    const project_level = b.addOptions();

    // enable clib cross-compilation
    const lib = b.addStaticLibrary(.{
        .name = "pkcs1verify",
        .target = target,
        .optimize = optimize,

    const libroot = "./deps/mbedtls/library/";
    const cflags = [_][]const u8{
    // subset from mbedtls_config.h for pkcs1v15 verify only
    lib.defineCMacro("MBEDTLS_ENTROPY_C", "1");
// .....list of C macros abbreviated for length

    const sources = [_][]const u8{
        libroot ++ "entropy.c",
// .....concatenated list of C source files abbreviated for length

    lib.addCSourceFiles(.{.files=&sources, .flags=&cflags});
    lib.addIncludePath(.{ .path = "./deps/mbedtls/include" });

    lib.addIncludePath(.{ .path = libroot });


I was in the middle of upgrading zig from 0.11.0 to 0.12.0 for Tuple today when I found out 0.13.0 was just released…lol! Went ahead and skipped 0.12.0 :slight_smile:

1 Like

Note that std.process.Child also works in 0.12.0.


At just 415 commits, that was… the Spanish Inquisition :grin: