-
Notifications
You must be signed in to change notification settings - Fork 3
/
MODULE.bazel
64 lines (51 loc) · 1.82 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
bazel_dep(name = "rules_rust", version = "0.55.6")
bazel_dep(name = "rules_rust_prost", version = "0.55.6")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
versions = ["1.83.0"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
rust_host_tools = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")
use_repo(rust_host_tools, "rust_host_tools")
crate = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
isolate=True
)
crate.from_cargo(
name = "crates",
cargo_lockfile = "Cargo.lock",
manifests = ["Cargo.toml"],
)
use_repo(crate, "crates")
crate.annotation(
crate = "protoc-gen-prost",
gen_binaries = ["protoc-gen-prost"],
)
crate.annotation(
crate = "protoc-gen-tonic",
gen_binaries = ["protoc-gen-tonic"],
)
bazel_dep(
name = "rules_bazel_integration_test",
version = "0.23.0",
dev_dependency = True,
)
bazel_dep(name = "protobuf", version = "28.3")
register_toolchains("//prost:prost_toolchain")
bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.1")
zig_toolchains = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")
use_repo(zig_toolchains, "zig_sdk")
# TODO:
# - Add support for hermetic Windows toolchains after fix in zig around pthread.h support:
# https://github.com/ziglang/zig/issues/10989
# - Add support for hermetic Mac OS toolchain after hermetic_cc_toolchain fixes support:
# https://github.com/uber/hermetic_cc_toolchain/issues/10
register_toolchains(
# Use oldest Rust supported version of GLIBC to be as compatible as possible,
# see https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html
"@zig_sdk//toolchain:x86_64-linux-gnu.2.17",
"@zig_sdk//toolchain:linux_arm64_gnu.2.17",
)