Harmont docs
Pipeline SDKReferenceToolchains

Zig

Generated reference for the harmont Zig API.

zig

Callable singleton for the Zig toolchain — access as hm.zig.

Supports three usage forms:

  • Toolchain form: hm.zig(version="0.13.0") returns a ZigToolchain shared across multiple projects.
  • Project form: hm.zig(path=".") returns a ZigProject directly.
  • Bare form: hm.zig.build(), hm.zig.test(), etc. for one-shot leaves.
zig(*, path=None, version='0.13.0', image=None, base=None) -> ZigToolchain | ZigProject
ParameterTypeDefaultDescription
pathstr | NoneNoneZig project root. Omit to get a reusable ZigToolchain
from which multiple projects can be spawned.
versionstr'0.13.0'Zig release version (e.g. "0.13.0"). Must be a
full MAJOR.MINOR.PATCH string.
imagestr | NoneNoneLocal-mode Docker base image override.
baseStep | NoneNoneExisting Step to attach to instead of emitting a fresh
apt-base step.

Returns ZigToolchain | ZigProject — A ZigToolchain when path is omitted, or a ZigProject

zig.build()

build(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

zig.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

zig.test()

test(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigEntry

Callable singleton for the Zig toolchain — access as hm.zig.

Supports three usage forms:

  • Toolchain form: hm.zig(version="0.13.0") returns a ZigToolchain shared across multiple projects.
  • Project form: hm.zig(path=".") returns a ZigProject directly.
  • Bare form: hm.zig.build(), hm.zig.test(), etc. for one-shot leaves.

ZigEntry.build()

build(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigEntry.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigEntry.test()

test(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigProject

Zig project rooted on a specific path — constructed via hm.zig(path=...).

installed is the zig-install step. Action methods (build, test, fmt) attach leaves to installed.

Fields

FieldTypeDefault
pathstrrequired
installedSteprequired

ZigProject.build()

build(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigProject.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigProject.test()

test(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

ZigToolchain

Zig toolchain install chain — constructed via hm.zig() with no path.

Holds the shared zig-install step. Spawn one ZigProject per subdirectory via .project(path); all projects from one toolchain share the same install step, so the emitted IR contains a single :zig: install node fanned out to N project chains.

Fields

FieldTypeDefault
versionstrrequired
installedSteprequired

ZigToolchain.project()

project(path='.') -> ZigProject

Create a ZigProject rooted at path from this toolchain.

ParameterTypeDefaultDescription
pathstr'.'Path to the Zig project root relative to the workspace.

Returns ZigProject — A ZigProject whose installed step is shared with this

Examples

>>> import harmont as hm
>>> tc = hm.zig(version="0.13.0")
>>> lib = tc.project("lib-a")
>>> app = tc.project("app")
>>> hm.pipeline(lib.test(), app.test())

On this page