load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_zig//zig:defs.bzl", "zig_library") load("//bazel:zig.bzl", "zig_cc_test") load("//bazel:zig_proto_library.bzl", "zig_proto_library") load("//bazel:zig_srcs.bzl", "zig_srcs") cc_library( name = "posix", hdrs = ["posix.h"], ) zig_library( name = "zml", srcs = glob([ "*.zig", "aio/**/*.zig", "nn/**/*.zig", # TODO: test_runner.zig should not be here. # It's here for now because it seems that test_runner property in zig_test is misbehaving. # See https://github.com/zml/rules_zig/issues/2 "test_runner.zig", ]), copts = ["-lc"], main = "zml.zig", visibility = ["//visibility:public"], deps = [ ":posix", ":xla_proto", "//async", "//mlir", "//mlir/dialects", "//pjrt", "//runtimes", "//stdx", "//zml/tokenizer", "//zml/tools", "@rules_zig//zig/runfiles", ], ) zig_proto_library( name = "xla_proto", import_name = "//xla:xla_proto", deps = ["@xla//xla/pjrt/proto:compile_options_proto"], ) # All ZML Tests zig_cc_test( name = "test", data = [ "aio/torch/simple.pt", "aio/torch/simple_test_4.pickle", ], test_runner = ":test_runner", deps = [":zml"], ) filegroup( name = "test_runner", srcs = ["test_runner.zig"], visibility = ["//visibility:public"], ) zig_srcs( name = "sources", zig_bin = ":test_test_lib", )