Skip to content

Rust: automatically source the matching protoc-prebuilt in build.rs (at least opt-in behavior). #26271

@HellButcher

Description

@HellButcher

Hi,
the version-check in the rust protobuf_codegen crate seams very strict (Equality).

if protoc_version != expected_protoc_version {

The static assertion inserted into the generated code seams more reasonable:

const fn are_versions_compatible(gencode: &str, runtime: &str) -> bool {

The strict version check enforces a tight coupling between the versions used inside the crate, and the version of protoc on the system.

maybe also provide a way to automaticaly download the right protoc version. for example using the protoc-prebuilt crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions