tree: 4ef3756587b4ac072064c8f8b3e7d7edd245313a
  1. example/
  2. raze/
  3. BUILD.bazel
  4. defs.bzl
  5. deps.bzl
  6. README.md
  7. repositories.bzl
  8. rust_grpc_compile.bzl
  9. rust_grpc_library.bzl
  10. rust_proto_compile.bzl
  11. rust_proto_lib.bzl
  12. rust_proto_library.bzl
rust/README.md

Rust rules

Rules for generating Rust protobuf and gRPC .rs files and libraries using rust-protobuf and grpc-rs. Libraries are created with rust_library from rules_rust. Due to upstream requirements, these rules require that the system has a valid GOPATH set.

RuleDescription
rust_proto_compileGenerates Rust protobuf .rs artifacts
rust_grpc_compileGenerates Rust protobuf+gRPC .rs artifacts
rust_proto_libraryGenerates a Rust protobuf library using rust_library from rules_rust
rust_grpc_libraryGenerates a Rust protobuf+gRPC library using rust_library from rules_rust

rust_proto_compile

Generates Rust protobuf .rs artifacts

WORKSPACE

load("@rules_proto_grpc//rust:repositories.bzl", rules_proto_grpc_rust_repos="rust_repos")

rules_proto_grpc_rust_repos()

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories()

load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")

bazel_version(name = "bazel_version")

load("@io_bazel_rules_rust//proto:repositories.bzl", "rust_proto_repositories")

rust_proto_repositories()

BUILD.bazel

load("@rules_proto_grpc//rust:defs.bzl", "rust_proto_compile")

rust_proto_compile(
    name = "person_rust_proto",
    deps = ["@rules_proto_grpc//example/proto:person_proto"],
)

Attributes

NameTypeMandatoryDefaultDescription
depslist<ProtoInfo>true[]List of labels that provide a ProtoInfo (such as native.proto_library)
verboseintfalse0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc

rust_grpc_compile

Generates Rust protobuf+gRPC .rs artifacts

WORKSPACE

load("@rules_proto_grpc//rust:repositories.bzl", rules_proto_grpc_rust_repos="rust_repos")

rules_proto_grpc_rust_repos()

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories()

load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")

bazel_version(name = "bazel_version")

load("@io_bazel_rules_rust//proto:repositories.bzl", "rust_proto_repositories")

rust_proto_repositories()

BUILD.bazel

load("@rules_proto_grpc//rust:defs.bzl", "rust_grpc_compile")

rust_grpc_compile(
    name = "greeter_rust_grpc",
    deps = ["@rules_proto_grpc//example/proto:greeter_grpc"],
)

Attributes

NameTypeMandatoryDefaultDescription
depslist<ProtoInfo>true[]List of labels that provide a ProtoInfo (such as native.proto_library)
verboseintfalse0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc

rust_proto_library

Generates a Rust protobuf library using rust_library from rules_rust

WORKSPACE

load("@rules_proto_grpc//rust:repositories.bzl", rules_proto_grpc_rust_repos="rust_repos")

rules_proto_grpc_rust_repos()

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories()

load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")

bazel_version(name = "bazel_version")

load("@io_bazel_rules_rust//proto:repositories.bzl", "rust_proto_repositories")

rust_proto_repositories()

BUILD.bazel

load("@rules_proto_grpc//rust:defs.bzl", "rust_proto_library")

rust_proto_library(
    name = "person_rust_library",
    deps = ["@rules_proto_grpc//example/proto:person_proto"],
)

Attributes

NameTypeMandatoryDefaultDescription
depslist<ProtoInfo>true[]List of labels that provide a ProtoInfo (such as native.proto_library)
verboseintfalse0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc

rust_grpc_library

Generates a Rust protobuf+gRPC library using rust_library from rules_rust

WORKSPACE

load("@rules_proto_grpc//rust:repositories.bzl", rules_proto_grpc_rust_repos="rust_repos")

rules_proto_grpc_rust_repos()

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories()

load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")

bazel_version(name = "bazel_version")

load("@io_bazel_rules_rust//proto:repositories.bzl", "rust_proto_repositories")

rust_proto_repositories()

BUILD.bazel

load("@rules_proto_grpc//rust:defs.bzl", "rust_grpc_library")

rust_grpc_library(
    name = "greeter_rust_library",
    deps = ["@rules_proto_grpc//example/proto:greeter_grpc"],
)

Attributes

NameTypeMandatoryDefaultDescription
depslist<ProtoInfo>true[]List of labels that provide a ProtoInfo (such as native.proto_library)
verboseintfalse0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc