File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,10 @@ def cargo_build_script(
150150 if "CARGO_CRATE_NAME" not in rustc_env :
151151 rustc_env ["CARGO_CRATE_NAME" ] = name_to_crate_name (name_to_pkg_name (name ))
152152
153+ exec_compatible_with = kwargs .pop ("exec_compatible_with" , None )
154+
153155 script_kwargs = {}
154- for arg in ("exec_compatible_with" , " testonly" ):
156+ for arg in ("testonly" , ):
155157 if arg in kwargs :
156158 script_kwargs [arg ] = kwargs [arg ]
157159
@@ -160,6 +162,12 @@ def cargo_build_script(
160162 if arg in kwargs :
161163 wrapper_kwargs [arg ] = kwargs [arg ]
162164
165+ # The script is always run in an `exec` configuration so whenever the
166+ # `cargo_build_script` is given an `exec_compatible_with`, for this target
167+ # it is translated to `target_compatible_with` to match the `cfg = "exec"`
168+ # consumption of the target.
169+ script_kwargs ["target_compatible_with" ] = exec_compatible_with
170+
163171 binary_tags = depset (
164172 (tags if tags else []) + ["manual" ],
165173 ).to_list ()
You can’t perform that action at this time.
0 commit comments