From d3274a0f705e22eae592ecb40cb687791562ddd2 Mon Sep 17 00:00:00 2001 From: Mark Reuter <13319190+reutermj@users.noreply.github.com> Date: Tue, 9 Sep 2025 03:33:19 +0000 Subject: [PATCH] Fix target naming to follow symbolic macro namming requirements Any target produced by a symbolic macro must start with the name of the macro. cc_toolchain produces two sets of targets prefixed with `_` instead of the name. This change drops the `_` prefix from the targets produced by cc_toolchain to enable its use in symbolic macros. --- cc/toolchains/toolchain.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc/toolchains/toolchain.bzl b/cc/toolchains/toolchain.bzl index fa41163a..3933a904 100644 --- a/cc/toolchains/toolchain.bzl +++ b/cc/toolchains/toolchain.bzl @@ -167,7 +167,7 @@ def cc_toolchain( if group in kwargs: fail("Don't use legacy file groups such as %s. Instead, associate files with `cc_tool` or `cc_args` rules." % group) - config_name = "_{}_config".format(name) + config_name = "{}_config".format(name) cc_toolchain_config( name = config_name, tool_map = tool_map, @@ -193,7 +193,7 @@ def cc_toolchain( # Provides ar_files, compiler_files, linker_files, ... legacy_file_groups = {} for group, actions in _LEGACY_FILE_GROUPS.items(): - group_name = "_{}_{}".format(name, group) + group_name = "{}_{}".format(name, group) cc_legacy_file_group( name = group_name, config = config_name,