fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
69ddb09d
main
1module ( 2name = "grpc-client-server" , 3version = "0.0.0" , 4) 5 6############################################################################### 7# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/ 8############################################################################### 9# https://github.com/bazelbuild/rules_rust/releases 10bazel_dep ( name = "rules_rust" , version = "0.54.1" ) 11local_path_override ( 12module_name = "rules_rust" , 13path = "../../.." , 14) 15 16bazel_dep ( name = "rules_rust_prost" , version = "0.54.1" ) 17local_path_override ( 18module_name = "rules_rust_prost" , 19path = "../../../extensions/prost" , 20) 21 22# 23# Rules for protobuf / gRPC 24# https://github.com/bazelbuild/rules_proto/releases 25bazel_dep ( name = "rules_proto" , version = "6.0.2" ) 26 27# https://github.com/aspect-build/toolchains_protoc/releases 28bazel_dep ( name = "toolchains_protoc" , version = "0.3.1" ) 29 30# https://registry.bazel.build/modules/protobuf 31bazel_dep ( name = "protobuf" , version = "27.1" ) 32 33# https://github.com/bazel-contrib/toolchains_llvm 34bazel_dep ( name = "toolchains_llvm" , version = "1.0.0" ) 35 36############################################################################### 37# L L V M 38# https://github.com/bazel-contrib/toolchains_llvm/blob/master/tests/MODULE.bazel 39############################################################################### 40llvm = use_extension ( "@toolchains_llvm//toolchain/extensions:llvm.bzl" , "llvm" ) 41 42# LLVM Versions and platforms 43# https://github.com/bazel-contrib/toolchains_llvm/blob/master/toolchain/internal/llvm_distributions.bzl 44LLVM_VERSIONS = { 45"" : "16.0.0" , 46"darwin-aarch64" : "16.0.3" , 47"darwin-x86_64" : "15.0.7" , 48} 49 50# Host LLVM toolchain. 51llvm . toolchain ( 52name = "llvm_toolchain" , 53llvm_versions = LLVM_VERSIONS , 54) 55use_repo ( llvm , "llvm_toolchain" , "llvm_toolchain_llvm" ) 56 57register_toolchains ( "@llvm_toolchain//:all" ) 58 59############################################################################### 60# T O O L C H A I N S 61############################################################################### 62 63# Rust toolchain 64RUST_EDITION = "2021" 65 66RUST_VERSION = "1.79.0" 67 68rust = use_extension ( "@rules_rust//rust:extensions.bzl" , "rust" ) 69rust . toolchain ( 70edition = RUST_EDITION , 71versions = [ RUST_VERSION ], 72) 73use_repo ( rust , "rust_toolchains" ) 74 75register_toolchains ( "@rust_toolchains//:all" ) 76 77# Custom Prost toolchain 78register_toolchains ( "@//build/prost_toolchain" ) 79 80############################################################################### 81# R U S T C R A T E S 82############################################################################### 83crate = use_extension ( "@rules_rust//crate_universe:extensions.bzl" , "crate" ) 84 85# 86# protobuf / gRPC dependencies 87crate . spec ( 88package = "prost" , 89version = "0.13.1" , 90) 91crate . spec ( 92default_features = False , 93package = "prost-types" , 94version = "0.13.1" , 95) 96crate . spec ( 97features = [ "transport" ], 98package = "tonic" , 99version = "0.12.1" , 100) 101crate . spec ( 102package = "tonic-build" , 103version = "0.12.1" , 104) 105crate . spec ( 106package = "protoc-gen-prost" , 107version = "0.4.0" , 108) 109crate . annotation ( 110crate = "protoc-gen-prost" , 111gen_binaries = [ "protoc-gen-prost" ], 112) 113crate . spec ( 114package = "protoc-gen-tonic" , 115version = "0.4.0" , 116) 117crate . annotation ( 118crate = "protoc-gen-tonic" , 119gen_binaries = [ "protoc-gen-tonic" ], 120) 121 122# 123# External crates 124crate . spec ( 125default_features = False , 126features = [ 127"macros" , 128"net" , 129"rt-multi-thread" , 130"signal" , 131], 132package = "tokio" , 133version = "1.38" , 134) 135crate . from_specs () 136use_repo ( crate , "crates" )