Update docs and example BUILD files to reflect the switch from zig_cc_binary to zig_binary.

This commit is contained in:
Foke Singh 2025-07-04 15:10:46 +00:00
parent cf00506dbb
commit a512b9c8a2
8 changed files with 22 additions and 22 deletions

View File

@ -41,9 +41,9 @@ use their rules to define our 5 additional targets:
load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar") load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar")
load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push")
load("@zml//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "simple_layer", name = "simple_layer",
main = "main.zig", main = "main.zig",
deps = [ deps = [
@ -248,10 +248,10 @@ load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar") load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar")
load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push")
load("@zml//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
# The executable # The executable
zig_cc_binary( zig_binary(
name = "mnist", name = "mnist",
args = [ args = [
"$(location @com_github_ggerganov_ggml_mnist//file)", "$(location @com_github_ggerganov_ggml_mnist//file)",

View File

@ -150,9 +150,9 @@ pub fn asyncMain() !void {
And add a `zig_cc_binary` target in `my_project/BUILD.bazel`: And add a `zig_cc_binary` target in `my_project/BUILD.bazel`:
```python ```python
load("@zml//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "torch2zml", name = "torch2zml",
main = "torch2zml.zig", main = "torch2zml.zig",
deps = [ deps = [

View File

@ -352,9 +352,9 @@ As mentioned already, ZML uses Bazel; so to build our model, we just need to
create a simple `BUILD.bazel` file, next to the `main.zig` file, like this: create a simple `BUILD.bazel` file, next to the `main.zig` file, like this:
```python ```python
load("@zml//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "simple_layer", name = "simple_layer",
main = "main.zig", main = "main.zig",
deps = [ deps = [

View File

@ -1,7 +1,7 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "benchmark", name = "benchmark",
main = "main.zig", main = "main.zig",
deps = [ deps = [

View File

@ -2,9 +2,9 @@ load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar")
load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup")
load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push")
load("//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "llama", name = "llama",
srcs = [ srcs = [
"llama.zig", "llama.zig",
@ -18,9 +18,9 @@ zig_cc_binary(
], ],
) )
# TODO(steeve): Re-enable when rules_zig linkmode is fixed. # TODO(steeve): Re-enable with a small, tokenless huggingface model.
# #
# zig_cc_binary( # zig_test(
# name = "test-implementation", # name = "test-implementation",
# srcs = ["llama.zig"], # srcs = ["llama.zig"],
# args = [ # args = [

View File

@ -1,7 +1,7 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "mnist", name = "mnist",
args = [ args = [
"$(location @mnist//:mnist.pt)", "$(location @mnist//:mnist.pt)",

View File

@ -1,7 +1,7 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "modernbert", name = "modernbert",
srcs = ["modernbert.zig"], srcs = ["modernbert.zig"],
args = [ args = [

View File

@ -2,9 +2,9 @@ load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar")
load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup")
load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push")
load("//bazel:zig.bzl", "zig_cc_binary") load("@rules_zig//zig:defs.bzl", "zig_binary")
zig_cc_binary( zig_binary(
name = "simple_layer", name = "simple_layer",
main = "main.zig", main = "main.zig",
deps = [ deps = [