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

Allow specifying a target for a given rule #489

Closed
duarten opened this issue Nov 11, 2020 · 3 comments
Closed

Allow specifying a target for a given rule #489

duarten opened this issue Nov 11, 2020 · 3 comments

Comments

@duarten
Copy link
Contributor

duarten commented Nov 11, 2020

It should be possible to override the current target on a per-rule basis, as some rules compile binaries to run on specific platforms. For example, I want to compile AWS Lambda functions targeting x86_64-unknown-linux-musl on a Mac. The rust_binary adds a --target=x86_64-apple-darwin arg to rustc, which I can't override.

@duarten
Copy link
Contributor Author

duarten commented Nov 11, 2020

It seems I can't specify target_compatible_with on rust_binary rules, although the Bazel documentation says it should be defined for all build rules.

@UebelAndre
Copy link
Collaborator

I believe this is a Bazel 4.0 feature. That documentation isn't in the 3.7 version, only master.

bazelbuild/bazel#12455

@duarten
Copy link
Contributor Author

duarten commented Nov 19, 2020

Oh :)

@duarten duarten closed this as completed Aug 20, 2021
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

No branches or pull requests

2 participants