Skip to content

Release v0.1.9-pre

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

ZAP Release v0.1.9-pre

Updates

Static (musl) Build Community Update

Thanks to @mattnite, zap projects can now be built using the
x64_64-linux-musl target, which enables the building static
executables for Linux. (-Dtarget=x86_64-linux-musl).

So, while I was on vacation, Matt just fixed everything with basically a
one-liner, really, really elegantly.

To me, this improvement is HUGE, as it means everybody can build
servers on their laptops, then just copy them onto a server machine or
into a (Docker) container, as a means of deployment, without having to
care about any other build environments.

Damn, I love Zig and working with clever people who dig into stuff like
musl builds. (@ed.yu also contributed a lot!).

Writing servers in Zig has paid off big time to me already, and will do
so even more now, as musl build deployments will def. speed up my
workflows.

So, thanks to y'all, it's been a great vacation, with great progess on
Zap - what more can one ask for 😊?

Using it

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

        // zap v0.1.9-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.9-pre.tar.gz",
            .hash = "12201e3ee597a7d9f98dc7fd19492403d754a1da101d2e678795e330c0382ff02f6a",
        }

Here is a complete build.zig.zon example:

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

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

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"));