Skip to content

Allow specifying protoc location using an env var for rust codegen #22718

@arjan-bal

Description

@arjan-bal

What language does this apply to?

Rust

Describe the problem you are trying to solve.

Prost allows specifying the location of the protoc binary if it's not in the PATH: https://docs.rs/prost-build/latest/prost_build/index.html#sourcing-protoc

The rust message codegen doesn't support setting the location of the protoc binary using an env var or a config option. It would be good to have this ability.

Describe the solution you'd like

Support optionally specifying an env variable with the path to the protoc binary.

Describe alternatives you've considered

Additional context
In tonic, we would like to support souring protoc from an env var for the service codegen, however the message codegen also needs to support specifying the location of protoc for users to be able to generate service and message using a single build step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustuntriagedauto added to all issues by default when created.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions