Skip to content

Custom proto toolchain ignored #395

Description

@epigramengineer

I'm trying to write a custom protobuf toolchain to use prost instead of grpc-rust.

I've followed the guide and it seems like this should work:

load("@io_bazel_rules_rust//proto:toolchain.bzl", "rust_proto_toolchain")
rust_proto_toolchain(
    name = "proto-toolchain-impl",
    protoc = "@com_google_protobuf//:protoc",
    grpc_plugin = "//3rdparty/cargo:prost",
    proto_plugin = "//3rdparty/cargo:prost",
)
toolchain(
    name = "proto-toolchain",
    toolchain = ":proto-toolchain-impl",
    toolchain_type = "@io_bazel_rules_rust//proto:toolchain",
)
# WORKSPACE
register_toolchains("//src:proto-toolchain")

but building my rust_proto_library produces the same binary output as without the toolchain definition; it doesn't even error or produce a message. Is there a step I'm missing?

proto_library(
    name = "echo_pb",
    srcs = ["echo.proto"]
)

rust_proto_library(
    name = "echo_pb_rs",
    deps = [":echo_pb"],
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions