# Zig 0.13.0 released

**URL:** <https://ziggit.dev/t/zig-0-13-0-released/4616>\
**Category:** News\
**Created:** [June 7, 2024, 7:48am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616 "2024-06-07T07:48:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![FObersteiner](https://ziggit.dev/user_avatar/ziggit.dev/fobersteiner/32/1177_2.png) [@FObersteiner](https://ziggit.dev/u/FObersteiner)\
**Post date:** [June 7, 2024, 7:48am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/1 "2024-06-07T07:48:55Z")

</div>

moving fast! ❤

[https://ziglang.org/download/0.13.0/release-notes.html](https://ziglang.org/download/0.13.0/release-notes.html)

---

<div class="post-metadata">

**Author:** ![matklad](https://ziggit.dev/user_avatar/ziggit.dev/matklad/32/2462_2.png) [@matklad](https://ziggit.dev/u/matklad)\
**Post date:** [June 7, 2024, 8:34am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/2 "2024-06-07T08:34:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![matklad](https://ziggit.dev/user_avatar/ziggit.dev/matklad/32/2462_2.png) [@matklad](https://ziggit.dev/u/matklad)\
**Post date:** [June 7, 2024, 9:46am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/3 "2024-06-07T09:46:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [June 7, 2024, 10:51am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/4 "2024-06-07T10:51:16Z")

</div>

The only breaking change I’ve noticed so far is [std.Build.LazyPath](https://ziglang.org/documentation/master/std/#std.Build.LazyPath). I have to add the following to my build file to support both 0.13.0 and 0.12.0:

```zig
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 };
    }
}

```

---

<div class="post-metadata">

**Author:** ![squeek502](https://ziggit.dev/user_avatar/ziggit.dev/squeek502/32/409_2.png) [@squeek502](https://ziggit.dev/u/squeek502)\
**Post date:** [June 7, 2024, 11:35am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/5 "2024-06-07T11:35:07Z")

</div>

The intended fix is

`b.path(path)`

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

[https://ziglang.org/download/0.12.0/release-notes.html#introduce-bpath-deprecate-LazyPathrelative](https://ziglang.org/download/0.12.0/release-notes.html#introduce-bpath-deprecate-LazyPathrelative)

---

<div class="post-metadata">

**Author:** ![JPL](https://ziggit.dev/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@JPL](https://ziggit.dev/u/JPL)\
**Post date:** [June 7, 2024, 11:37am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/6 "2024-06-07T11:37:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [June 7, 2024, 11:42am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/7 "2024-06-07T11:42:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![FObersteiner](https://ziggit.dev/user_avatar/ziggit.dev/fobersteiner/32/1177_2.png) [@FObersteiner](https://ziggit.dev/u/FObersteiner)\
**Post date:** [June 7, 2024, 12:19pm UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/8 "2024-06-07T12:19:51Z")

</div>

> [@chung-leong](#):
>
> The only breaking change I’ve noticed so far

pretty substantial API change: `std.Progress` ([release note](https://ziglang.org/download/0.13.0/release-notes.html#Reworked-CLI-Progress)). Related: [Zig's New CLI Progress Bar Explained](https://ziggit.dev/t/zigs-new-cli-progress-bar-explained/4499)

---

<div class="post-metadata">

**Author:** ![kinder](https://ziggit.dev/letter_avatar_proxy/v4/letter/k/b4bc9f/32.png) [@kinder](https://ziggit.dev/u/kinder)\
**Post date:** [June 7, 2024, 10:33pm UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/9 "2024-06-07T22:33:05Z")

</div>

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 😅

> **Summary**
>
> 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:
> 
> ```zig
> 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{
> "-Ideps/config",
> "-DMBEDTLS_CONFIG_FILE=\"pkcs1verify_config.h\"",
> "-std=c99",
> "-Wall",
> "-Wextra",
> "-Wwrite-strings",
> "-Wpointer-arith",
> "-Wimplicit-fallthrough",
> "-Wshadow",
> "-Wvla",
> "-Wformat=2",
> "-Wno-format-nonliteral",
> "-Wmissing-declarations",
> "-Wmissing-prototypes",
> "-Wdocumentation",
> "-Wno-documentation-deprecated-sync",
> "-Wunreachable-code",
> };
> // 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.linkLibC();
> lib.addIncludePath(.{ .path = "./deps/mbedtls/include" });
> 
> lib.addIncludePath(.{ .path = libroot });
> 
> b.installArtifact(lib);
> 
> ```

---

<div class="post-metadata">

**Author:** ![marler8997](https://ziggit.dev/user_avatar/ziggit.dev/marler8997/32/77_2.png) [@marler8997](https://ziggit.dev/u/marler8997)\
**Post date:** [June 7, 2024, 10:57pm UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/10 "2024-06-07T22:57:47Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [June 8, 2024, 5:43pm UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/11 "2024-06-08T17:43:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Durobot](https://ziggit.dev/user_avatar/ziggit.dev/durobot/32/447_2.png) [@Durobot](https://ziggit.dev/u/Durobot)\
**Post date:** [June 10, 2024, 8:57am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/12 "2024-06-10T08:57:21Z")

</div>

At just 415 commits, that was… the Spanish Inquisition 😁

---

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [July 2, 2024, 12:47am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/13 "2024-07-02T00:47:48Z")

</div>

I just noticed a bunch of issues on 32-bit Windows. If you need to support that platform, better stick with 0.12.0. I guess somewhere on this planet there’re still people are using Windows XP 😛

---

<div class="post-metadata">

**Author:** ![squeek502](https://ziggit.dev/user_avatar/ziggit.dev/squeek502/32/409_2.png) [@squeek502](https://ziggit.dev/u/squeek502)\
**Post date:** [July 2, 2024, 7:36am UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/14 "2024-07-02T07:36:04Z")

</div>

> <https://github.com/ziglang/zig/issues/20047>
>
> \### Zig Version
> 
> 0.13.0-dev.249+ed75f6256
> 
> \### Steps to Reproduce and Observ…ed Behavior
> 
> When running the standard library tests with \`-target x86-windows\` I hit:
> 
> \`\`\`
> \> zig test lib\\std\\std.zig --zig-lib-dir lib -target x86-windows
> Test \[2/2716\] debug.decltest.machoSearchSymbols... expected debug.MachoSymbol@2b13464, found debug.MachoSymbol@2b13468
> Test \[2/2716\] debug.decltest.machoSearchSymbols... FAIL (TestExpectedEqual)
> Segmentation fault at address 0x0
> Segmentation fault at address 0x0
> Segmentation fault at address 0x0
> Segmentation fault at address 0x0
> Panicked during a panic. Aborting.
> error: the following test command failed with exit code 3:
> C:\\Users\\Ryan\\Programming\\Zig\\zig\\zig-cache\\o\\6b0eda73b9d23fabe1b7288a523661d4\\test.exe
> \`\`\`
> 
> After updating \`resinator\` to latest Zig I hit many similar problems when targeting 32-bit Windows: https://github.com/squeek502/resinator/actions/runs/9204915991/job/25319442772 (but 64-bit Windows and other OSes work fine, even 32-bit targets on other OSes)
> 
> There might be multiple bugs involved here, but here's an as-minimal-as-I-could-get-it reproduction of one manifestation of the problem:
> 
> \`\`\`zig
> const std = @import("std");
> 
> test "limitedWriter basic usage" {
> var buf: \[4\]u8 = undefined;
> const fbs = FixedBufferStream{ .buffer = &buf, .pos = 0 };
> var limited\_stream = LimitedWriter{ .inner\_writer = fbs, .bytes\_left = 4 };
> try std.testing.expectEqual(4, limited\_stream.bytes\_left);
> 
> std.mem.doNotOptimizeAway(&limited\_stream);
> }
> 
> const LimitedWriter = struct {
> inner\_writer: FixedBufferStream,
> bytes\_left: u64,
> };
> 
> const FixedBufferStream = struct {
> buffer: \[\]const u8,
> pos: usize,
> };
> \`\`\`
> 
> This passes for me when targeting \`x86\_64-windows\`:
> 
> \`\`\`
> \> zig test limited\_writer.zig -target x86\_64-windows
> All 1 tests passed.
> \`\`\`
> 
> But fails when targeting \`x86-windows\`:
> 
> \`\`\`
> \> zig test limited\_writer.zig -target x86-windows
> expected 4, found 136223752605138948
> FAIL (TestExpectedEqual)
> Segmentation fault at address 0x0
> Panicked during a panic. Aborting.
> error: the following test command failed with exit code 3:
> C:\\Users\\Ryan\\Programming\\Zig\\tmp\\zig-cache\\o\\5297f27c52f0325a3ca3d5ec831a5abb\\test.exe
> \`\`\`
> 
> Importantly, note that \`doNotOptimizeAway\` is used here because \`limited\_stream\` being \`var\` is necessary. If \`limited\_stream\` is \`const\`, then the test passes.
> 
> \### Expected Behavior
> 
> The reproduction test to pass on 32-bit Windows.

---

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [March 6, 2025, 6:20pm UTC](https://ziggit.dev/t/zig-0-13-0-released/4616/15 "2025-03-06T18:20:59Z")

</div>

Issue is fixed in 0.14.0 in case anyone is wondering. I just ran a bunch of tests.
