Schema Reference

The authoritative type definitions are in ../schema.cue. A feature is considered implemented only when it survives schema validation, CUE export, generated spec, and Zig execution.

Module fields

FieldPurposeDefault
kindexe, static, shared, or modulerequired
rootroot Zig sourcerequired
artifact_nameproduced name independent of graph/import keymodule key
depsinternal module dependencies[]
profiledebug or releasedebug
linkabi or import consumptionabi
pre, postexplicit argv build commands[]
install_dirsinstall/resource directory staging[]
pkg_library_pathspackage-provided library search paths[]
pkg_importsimported Zig package modules[]
pkg_artifactslinked package artifacts[]
build_optionsnamed user-selectable typed options[]
option_valuesfixed typed values injected into options[]
gen_importsZig modules generated by host tools[]
build_options_importoptions-module import namebuild-options
nativeC/C++ sources, includes, objects, libs, frameworks{}

A shared target is always ABI-linked. A module target is always import-only and produces no standalone artifact.

Import and ABI edges

link: "import" uses Zig module import semantics and avoids a separate artifact for that dependency. link: "abi" keeps an independent compile artifact and links it. Large projects can combine the two into clusters: import-connected internals with ABI boundaries between clusters.

Toolchains and profiles

Projects can declare accepted Zig minor-version lanes and a preferred lane. The generated build rejects a compiler outside the declared set before doing real work. debug resolves to Zig Debug; release resolves to ReleaseFast.

Native build metadata

native can describe C sources, include/system-include directories, library paths, object files, system libraries, pkg-config libraries, Apple frameworks, and libc/libc++ linkage. System availability is still external; richer first-class prerequisite diagnostics are on the roadmap.

Options, packages, and generated modules

Top-level options currently support bool, string, and u32 values. Modules can also receive fixed typed option_values, including optional 40-character commit values.

pkg_imports, pkg_artifacts, and pkg_library_paths model real build.zig.zon dependency surfaces. The current corpus-proven package-option forms include backend enums and string-list fields; replacing those special cases with a generic typed dependency-argument representation is a production follow-up rather than an invitation to add more one-off fields.

gen_imports models the common pattern of compiling a host tool, running it, and importing the emitted Zig file through the build graph.

export.cue

project.cue contains declarations; export.cue chooses which declarations become the resolved build graph and projects every field the generator consumes. The _modules map is the explicit export list. The canonical CLI verifies that the complete module contract survived this stage, preventing schema features from being silently dropped downstream.