Build configuration#
An application's build.zig delegates its standard build to zyn:
const std = @import("std");
const zyn = @import("zyn");
pub fn build(b: *std.Build) void {
zyn.build_application(b);
}
This entry point defines the application, view compilation, development and deployment servers, route inspection, database seed, and test build graph from the zyn dependency declared by build.zig.zon. Updating that dependency updates the framework-provided build and deployment behaviour.
Applications that need build-time dependencies use zyn.application(b), add imports, and then build the configured application:
pub fn build(b: *std.Build) void {
var app = zyn.application(b);
const dependency = b.dependency("dependency", .{
.target = app.target,
.optimize = app.optimize,
});
app.add_import("dependency", dependency.module("dependency"));
_ = app.build();
}
The application, generated test root, and seed module all receive the db module rooted at db/types.zig. Imports added with app.add_import are shared with those modules.
zyn build refreshes generated application metadata and compiles the ReleaseSafe deployment executable at .zyn/deploy_server for the versioned Linux GNU production profile matching the CLI architecture. The linux-gnu-v1 profile uses a baseline CPU and the exact targets x86_64-linux.5.10...6.19-gnu.2.31 and aarch64-linux.5.10...6.19-gnu.2.31. zyn deploy builds for the detected Linux host target through the same build contract.
app.build() returns the standard check, deploy, serve, dev, routes, seed, tests, and test_run steps, allowing custom work to depend on zyn's graph. The Application value also exposes the selected target and optimize values for dependencies which must match the application. Use `zyn docs api zyn.Application` for the exact build-facing contract.