Skip to content

Release v0.1.5-pre

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 29 May 16:23

ZAP Release v0.1.5-pre

Updates

Weird setCookie() release build bug

This is a bugfix release. I noticed that setCookie() would always
return an error in release builds.

In trying to debug what is going on, I captured the return value of the
internal http_set_cookie call in a variable, so I could check AND log
it - instead of just checking if(http_set_cookie() == -1). Strangely
enough, the bug disappeared. Without further examination, this seems
like a bug in the current zig compiler.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.5-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.5-pre.tar.gz",
            .hash = "1220229f4418ff5a969428e2f60e138c8316d3ded0f3c0900e1f62bcb20a2f21c3df",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.5-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.5-pre.tar.gz",
            .hash = "1220229f4418ff5a969428e2f60e138c8316d3ded0f3c0900e1f62bcb20a2f21c3df",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));