Skip to content

release-0.0.21-localhost

Pre-release
Pre-release
Compare
Choose a tag to compare
@renerocksai renerocksai released this 19 May 01:01
· 435 commits to master since this release

ZAP Release release-0.0.21-localhost

This is probably the last localhost release, as 14 hours ago Andrew fixed the bug causing the need for it. Unfortunately, it didn't make it into the last nightly build.

Using it

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

        // zap release-0.0.21-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.21-localhost.tar.gz",
            .hash = "12207c67914fc9f69de6d614df75364e85bc2ebd847a659e8a904981bc7bb125c3cd",
        }
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server 

This hosts the downloaded dependencies locally on port 8000. After the firstzig build, you can stop the python http server with CTRL+C.

From then on, this release of ZAP and its dependency will remain in ZIG's global build cache. So you don't need to start an HTTP server on every build.

Here is a complete build.zig.zon example:

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

    .dependencies = .{
        // zap release-0.0.21-localhost
        .zap = .{
            .url = "http://127.0.0.1:8000/release-0.0.21-localhost.tar.gz",
            .hash = "12207c67914fc9f69de6d614df75364e85bc2ebd847a659e8a904981bc7bb125c3cd",
        }
    }
}

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