Last updated: 2026-11-17
CLI & Entrypoints
Build Info
Build metadata exported by `build.zig` for CLI version reporting.
The values in this module are generated at compile time from build options such as `-Dversion` and `-Dcommit`, then printed by `zinc --version`.
8 exports shown
constant
version
pub const version = build_options.version Semantic version string for this build (from `-Dversion`, e.g.
`0.3.1`).
constant
commit
pub const commit = build_options.commit Short git commit hash this binary was built from (from `-Dcommit`).
constant
target
pub const target = build_options.target Compilation target triple this binary was built for (from `-Dtarget`).
constant
optimize
pub const optimize = build_options.optimize Active optimize mode, e.g.
`ReleaseFast` or `Debug` (from `-Doptimize`).
constant
backend
pub const backend = build_options.backend Single GPU backend compiled into this binary, e.g.
`vulkan`, `rocm`, or `metal`.
struct
Metadata
pub const Metadata = struct Shared identity for CLI JSON, diagnostics and HTTP discovery.
function
writeVersionJson
pub fn writeVersionJson(writer: *std.Io.Writer) !void No public doc comment yet.
function
writeVersion
pub fn writeVersion(writer: anytype) !void Write the full `zinc --version` report to `writer`.
Emits the version, commit, target, optimize mode, and compiled-in backend, each on its own line. The `backends` output key is retained for compatibility.