bazelbuild / rules_rust

Rust rules for Bazel
https://bazelbuild.github.io/rules_rust/
Apache License 2.0
671 stars 434 forks source link

protobuf-codegen 3.x.x does not appear in binary_crates #2990

Open cpederkoff-carbon opened 2 weeks ago

cpederkoff-carbon commented 2 weeks ago

When I add the following to my workspace file:

crates_repository(
    name = "crate_index",
    annotations = {
        "protobuf-codegen": [crate.annotation(
            gen_binaries = ["protoc-gen-rust"],
        )],
    },
    cargo_lockfile = "//:cargo.lock",
    lockfile = "//:cargo.Bazel.lock",
    packages = {
        "protobuf-codegen": crate.spec(
            version = "3.7.1",
        ),
    },
    render_config = render_config(
        default_package_name = "",
    ),
)

the cargo.Bazel.lock shows

"binary_crates": [],

But when I drop the protobuf-codegen version to 2.28.0 the cargo.Bazel.lock shows

"binary_crates": [
    "protobuf-codegen 2.28.0"
  ],

This is unexpected because the protobuf-codegen 3.x.x appears to me to be a binary crate just like 2.x.x