Extensions for bzlmod.
zig = use_extension("@rules_zig//zig:extensions.bzl", "zig")
zig.toolchain(default, zig_version)
zig.index(file)
zig.mirrors(urls)
Installs a Zig toolchain.
Every module can define multiple toolchain versions. All these versions will be
registered as toolchains and you can select the toolchain using the
@zig_toolchains//:version build flag.
The latest version will be the default unless the root module explicitly declares one as the default.
TAG CLASSES
Fetch and define toolchain targets for the given Zig SDK version.
Defaults to the latest known version.
Attributes
Extend the set of known Zig SDK versions based on a Zig version index.
The provided index must use a schema that is compatible with the upstream index.
Attributes
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| file | The Zig version index JSON file. | Label | required |
Attributes
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| urls | The mirrors base URLs. | List of strings | required |