From 1320071df1f5ec3f7266fdde4fb4e57c4cc0ad30 Mon Sep 17 00:00:00 2001 From: Brian Granaghan Date: Fri, 25 Aug 2023 02:19:43 -0700 Subject: [PATCH] Add TemplateVariableInfo for build script toolchains attribute. (#2123) --- cargo/private/cargo_build_script.bzl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_script.bzl index d68c9f5b62..005b508e1e 100644 --- a/cargo/private/cargo_build_script.bzl +++ b/cargo/private/cargo_build_script.bzl @@ -188,6 +188,9 @@ def _cargo_build_script_impl(ctx): if type(all_files) == "list": all_files = depset(all_files) toolchain_tools.append(all_files) + if platform_common.TemplateVariableInfo in target: + variables = getattr(target[platform_common.TemplateVariableInfo], "variables", depset([])) + env.update(variables) _merge_env_dict(env, expand_dict_value_locations( ctx,