-
Notifications
You must be signed in to change notification settings - Fork 440
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
Add target_compatible_with from kwargs to build_script_kwargs #2133
Add target_compatible_with from kwargs to build_script_kwargs #2133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way args are passed here seems backward to me. I think target folks think about when defining cargo_build_script
targets is actually _build_script_run
. Thus we should default to passing all args to that and set the rust_binary
target to manual. You can then constrain the target with both target_compatible_with
which I feel most applies to running the script where exec_compatible_with
would apply to compiling the script as the script is in cfg = "exec"
. How do you feel about passing kwargs to _build_script_run
instead?
cc @scentini
55eaa85
to
3385c97
Compare
@UebelAndre Yes that's an approach I would prefer. Passing PTAL: 3385c97 I also introduced |
20296df
to
7235378
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me! I’ll give @scentini a chance to look since I think they have some more nuanced uses with “compatible_with”.
There's a bug in cargo_build_script rule that does propagate target_compatible_with attr correctly for device build. See bazelbuild/rules_rust#2133 Bug: 297550356 Test: CI Change-Id: Ifbcbdcb85b0c8aa230c2f147bc74a776b1c2d91b
Head branch was pushed to by a user without write access
The top-level _build_script_run target should also have `target_compatible_with` in order to work with platforms compatibility.
61356cc
to
4b52792
Compare
The top-level
_build_script_run
target should also havetarget_compatible_with
in order to work with platforms compatibility.