diff --git a/cargo/private/cargo_build_script_wrapper.bzl b/cargo/private/cargo_build_script_wrapper.bzl index bc9c4058a8..7d498a6293 100644 --- a/cargo/private/cargo_build_script_wrapper.bzl +++ b/cargo/private/cargo_build_script_wrapper.bzl @@ -122,6 +122,9 @@ def cargo_build_script( build_script_kwargs["compatible_with"] = kwargs["compatible_with"] binary_kwargs.pop("compatible_with") + if "target_compatible_with" in kwargs: + build_script_kwargs["target_compatible_with"] = kwargs["target_compatible_with"] + if "toolchains" in kwargs: build_script_kwargs["toolchains"] = kwargs["toolchains"]