Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

mattem
Copy link
Contributor

@mattem mattem commented Oct 29, 2024

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.

@mattem mattem force-pushed the rust_binary_name_attr branch 2 times, most recently from bb7da7e to e527162 Compare October 29, 2024 14:03
@mattem mattem force-pushed the rust_binary_name_attr branch from e527162 to 2607183 Compare October 29, 2024 14:13
Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, thanks!

@illicitonion illicitonion added this pull request to the merge queue Oct 30, 2024
Merged via the queue into bazelbuild:main with commit 9d799b2 Oct 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants