Release v0.1.2-pre
Pre-releaseZAP Release v0.1.2-pre
Updates
Stopping ZAP & Memory Fixes
-
UserPassSessionAuth
didn't clean up properly. On top of that, the way it was implemented, made it complicated to free tokens that were created at /login time but in the map of allowed tokens already. This is now fixed. The example even shows how to scope your main function and call thegpa.detectLeaks()
directly. Which is the way to go if you callzap.stop()
-
zap.stop()
introduced. Execution of the main thread continues past thezap.start()
call.
In other news, the build.zig
script now exposes a single zig build test
target that can be used to run all tests in one go. ZAP is a good zig build citizen now 😊.
In ZIG news: the TLS errors are back. I'm in contact with Andrew about that.
Once ziglang/zig#15194 is implemented, I'll see proper backtraces in the CI when building ZAP. The backtraces should help getting the TLS issues fixed.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap v0.1.2-pre
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.2-pre.tar.gz",
.hash = "1220fd222f2f0ddcd3dbc50fae56a8be337002c1fd54e73a5ca67c379ab8955a5a02",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap v0.1.2-pre
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.2-pre.tar.gz",
.hash = "1220fd222f2f0ddcd3dbc50fae56a8be337002c1fd54e73a5ca67c379ab8955a5a02",
}
}
}
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"));