bazelbuild / rules_rust

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

feat: add an attr to rust_binary for customization of the binary name #2970

Closed mattem closed 3 weeks ago

mattem commented 3 weeks ago

It's often desirable to set the name of the resulting binary to something else other than the target name (attr.name), perhaps when the rust_binary target is wrapped in a macro, and not considered the "main" target of that macro.

This diff adds a new binary_name attribute to rust_binary, which when set will be used as the resulting binaries prefix instead of the targets name. The default is to still use the target name.