From 2293e09e299dc28f9f45c666441b639b170aef22 Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Thu, 6 Feb 2025 22:37:30 +0100 Subject: [PATCH 1/6] [rule-based toolchains] Add `cc_coverage_config` rule --- cc/coverage/type/BUILD | 6 ++ cc/toolchains/cc_coverage_config.bzl | 101 ++++++++++++++++++++++++ cc/toolchains/cc_toolchain_info.bzl | 20 +++++ cc/toolchains/impl/cc_coverage_type.bzl | 40 ++++++++++ 4 files changed, 167 insertions(+) create mode 100644 cc/coverage/type/BUILD create mode 100644 cc/toolchains/cc_coverage_config.bzl create mode 100644 cc/toolchains/impl/cc_coverage_type.bzl diff --git a/cc/coverage/type/BUILD b/cc/coverage/type/BUILD new file mode 100644 index 000000000..3985b7a8f --- /dev/null +++ b/cc/coverage/type/BUILD @@ -0,0 +1,6 @@ +load("//cc/toolchains/impl:cc_coverage_type.bzl", "cc_coverage_type") + +cc_coverage_type( + name = "gcov", + visibility = ["//visibility:public"], +) diff --git a/cc/toolchains/cc_coverage_config.bzl b/cc/toolchains/cc_coverage_config.bzl new file mode 100644 index 000000000..fa22af312 --- /dev/null +++ b/cc/toolchains/cc_coverage_config.bzl @@ -0,0 +1,101 @@ +# Copyright 2025 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Rules to configure cc coverage collection.""" + +load("//cc/toolchains/impl:collect.bzl", "collect_data") +load(":cc_toolchain_info.bzl", "CoverageTypeInfo", "CoverageConfigInfo") + +def _cc_coverage_config_impl(ctx): + exe_info = ctx.attr.src[DefaultInfo] + if exe_info.files_to_run != None and exe_info.files_to_run.executable != None: + exe = exe_info.files_to_run.executable + elif len(exe_info.files.to_list()) == 1: + exe = exe_info.files.to_list()[0] + else: + fail("Expected cc_coverage_config's src attribute to be either an executable or a single file") + + runfiles = collect_data(ctx, ctx.attr.data + [ctx.attr.src]) + config = CoverageConfigInfo( + label = ctx.label, + type = ctx.attr.type[CoverageTypeInfo], + exe = exe, + runfiles = runfiles, + ) + + link = ctx.actions.declare_file(ctx.label.name) + ctx.actions.symlink( + output = link, + target_file = exe, + is_executable = True, + ) + return [ + config, + # This isn't required, but now we can do "bazel run ", which can + # be very helpful when debugging toolchains. + DefaultInfo( + files = depset([link]), + runfiles = runfiles, + executable = link, + ), + ] + +cc_coverage_config = rule( + implementation = _cc_coverage_config_impl, + attrs = { + "type": attr.label( + mandatory = True, + providers = [ + CoverageTypeInfo, + ], + doc = """ +The type of coverage this config is for (e.g., gcov). + +See `@rules_cc//cc/coverage/type` for a list of supported types. +""" + ), + "src": attr.label( + mandatory = True, + allow_files = True, + cfg = "exec", + doc = """ +The tool to collect coverage with. +""" + ), + "data": attr.label_list( + mandatory = False, + allow_files = True, + doc = """ +Additional files that are required for this coverage config to run. +""", + ), + }, + doc = """ +Defines the configuration to collect CC coverage. + +Example: +``` +load("//cc/toolchains:cc_coverage_config.bzl", "cc_coverage_config") + +cc_coverage_config( + name = "gcov", + type = "//cc/coverage/type:gcov", + src = "bin/gcov", +) +``` +""", + provides = [ + CoverageConfigInfo, + ], +) diff --git a/cc/toolchains/cc_toolchain_info.bzl b/cc/toolchains/cc_toolchain_info.bzl index 17881a8d8..80ed59ba2 100644 --- a/cc/toolchains/cc_toolchain_info.bzl +++ b/cc/toolchains/cc_toolchain_info.bzl @@ -191,3 +191,23 @@ ToolchainConfigInfo = provider( "allowlist_include_directories": "(depset[DirectoryInfo]) Built-in include directories implied by this toolchain's args and tools that should be allowlisted in Bazel's include checker", }, ) + +CoverageTypeInfo = provider( + doc = "A type of coverage (eg. gcov)", + # @unsorted-dict-items + fields = { + "label": "(Label) The label defining this provider. Place in error messages to simplify debugging", + "name": "(str) The name of the coverage type", + }, +) + +CoverageConfigInfo = provider( + doc = "A type of coverage (eg. gcov)", + # @unsorted-dict-items + fields = { + "label": "(Label) The label defining this provider. Place in error messages to simplify debugging", + "type": "(CoverageTypeInfo) A provider defining the type of coverage config", + "exe": "(File) The file corresponding to the coverage tool", + "runfiles": "(runfiles) The files required to run the coverage tool", + }, +) diff --git a/cc/toolchains/impl/cc_coverage_type.bzl b/cc/toolchains/impl/cc_coverage_type.bzl new file mode 100644 index 000000000..ad8ad9936 --- /dev/null +++ b/cc/toolchains/impl/cc_coverage_type.bzl @@ -0,0 +1,40 @@ +# Copyright 2025 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Rules to configure cc coverage types.""" + +load("//cc/toolchains:cc_toolchain_info.bzl", "CoverageTypeInfo") + +# Users may not define their own types. +visibility([ + "//cc/coverage/type", +]) + +def _cc_coverage_type_impl(ctx): + return [ + CoverageTypeInfo( + label = ctx.label, + name = ctx.attr.name, + ), + ] + +cc_coverage_type = rule( + implementation = _cc_coverage_type_impl, + doc = """ +Defines the a type for `cc_coverage_type`. +""", + provides = [ + CoverageTypeInfo, + ], +) From cbdb13a8d2a6dd51c4ff8566dcf5015c7e056f89 Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Fri, 7 Feb 2025 14:26:13 +0100 Subject: [PATCH 2/6] library_search_directories --- cc/toolchains/variables/BUILD | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cc/toolchains/variables/BUILD b/cc/toolchains/variables/BUILD index 496cfbbfd..1811d2a9b 100644 --- a/cc/toolchains/variables/BUILD +++ b/cc/toolchains/variables/BUILD @@ -8,7 +8,7 @@ cc_variable( "//cc/toolchains/actions:link_actions", "//cc/toolchains/actions:compile_actions", ], - type = types.directory, + type = types.option(types.directory), ) cc_variable( @@ -20,7 +20,7 @@ cc_variable( cc_variable( name = "dependency_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -41,19 +41,19 @@ cc_variable( "//cc/toolchains/actions:link_actions", "//cc/toolchains/actions:compile_actions", ], - type = types.directory, + type = types.option(types.directory), ) cc_variable( name = "fdo_prefetch_hints_path", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( name = "fdo_profile_path", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -103,7 +103,7 @@ cc_variable( cc_variable( name = "input_file", actions = ["//cc/toolchains/actions:strip"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -151,7 +151,7 @@ cc_variable( cc_variable( name = "legacy_link_flags", actions = ["//cc/toolchains/actions:link_actions"], - type = types.list(types.string), + type = types.option(types.list(types.string)), ) cc_variable( @@ -262,7 +262,7 @@ cc_variable( cc_variable( name = "library_search_directories", actions = ["//cc/toolchains/actions:link_actions"], - type = types.list(types.directory), + type = types.option(types.list(types.directory)), ) cc_variable( @@ -277,7 +277,7 @@ cc_variable( cc_variable( name = "linkstamp_paths", actions = ["//cc/toolchains/actions:link_actions"], - type = types.list(types.directory), + type = types.option(types.list(types.directory)), ) cc_variable( @@ -319,7 +319,7 @@ cc_variable( cc_variable( name = "output_assembly_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -343,13 +343,13 @@ cc_variable( cc_variable( name = "output_preprocess_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( name = "per_object_debug_info_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -397,7 +397,7 @@ cc_variable( cc_variable( name = "source_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -484,7 +484,7 @@ cc_variable( cc_variable( name = "user_link_flags", actions = ["//cc/toolchains/actions:link_actions"], - type = types.list(types.string), + type = types.option(types.list(types.string)), ) cc_builtin_variables( From 9ad7a310a027e01b0a920c2ef4b13520c4175900 Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Fri, 7 Feb 2025 14:39:25 +0100 Subject: [PATCH 3/6] more --- cc/toolchains/variables/BUILD | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cc/toolchains/variables/BUILD b/cc/toolchains/variables/BUILD index 1811d2a9b..7d9e69d03 100644 --- a/cc/toolchains/variables/BUILD +++ b/cc/toolchains/variables/BUILD @@ -72,7 +72,7 @@ cc_variable( cc_variable( name = "gcov_gcno_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.file, + type = types.option(types.file), ) cc_variable( @@ -85,13 +85,13 @@ cc_variable( cc_variable( name = "include", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.list(types.file), + type = types.option(types.list(types.file)), ) cc_variable( name = "include_paths", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.list(types.directory), + type = types.option(types.list(types.directory)), ) cc_variable( @@ -361,7 +361,7 @@ cc_variable( cc_variable( name = "preprocessor_defines", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.list(types.string), + type = types.option(types.list(types.string)), ) cc_variable( @@ -373,7 +373,7 @@ cc_variable( cc_variable( name = "quote_include_paths", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.list(types.directory), + type = types.option(types.list(types.directory)), ) cc_variable( @@ -409,7 +409,7 @@ cc_variable( cc_variable( name = "stripopts", actions = ["//cc/toolchains/actions:strip"], - type = types.list(types.string), + type = types.option(types.list(types.string)), ) # Instead of the "sysroot" variable, use the cc_sysroot macro in @@ -418,7 +418,7 @@ cc_variable( cc_variable( name = "system_include_paths", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.list(types.directory), + type = types.option(types.list(types.directory)), ) cc_variable( From 30ba1730eaf79ddee34adc329d5ba25df486fe3a Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Thu, 24 Jul 2025 13:53:08 +0200 Subject: [PATCH 4/6] fix --- cc/toolchains/variables/BUILD | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cc/toolchains/variables/BUILD b/cc/toolchains/variables/BUILD index 30cc06c6c..be65c5086 100644 --- a/cc/toolchains/variables/BUILD +++ b/cc/toolchains/variables/BUILD @@ -72,7 +72,7 @@ cc_variable( cc_variable( name = "gcov_gcno_file", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.option(types.file), + type = types.file, ) cc_variable( @@ -85,13 +85,13 @@ cc_variable( cc_variable( name = "include", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.option(types.list(types.file)), + type = types.list(types.file), ) cc_variable( name = "include_paths", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.option(types.list(types.directory)), + type = types.list(types.directory), ) cc_variable( @@ -361,7 +361,7 @@ cc_variable( cc_variable( name = "preprocessor_defines", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.option(types.list(types.string)), + type = types.list(types.string), ) cc_variable( @@ -373,7 +373,7 @@ cc_variable( cc_variable( name = "quote_include_paths", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.option(types.list(types.directory)), + type = types.list(types.directory), ) cc_variable( @@ -409,7 +409,7 @@ cc_variable( cc_variable( name = "stripopts", actions = ["//cc/toolchains/actions:strip"], - type = types.option(types.list(types.string)), + type = types.list(types.string), ) # Instead of the "sysroot" variable, use the cc_sysroot macro in @@ -418,7 +418,7 @@ cc_variable( cc_variable( name = "system_include_paths", actions = ["//cc/toolchains/actions:compile_actions"], - type = types.option(types.list(types.directory)), + type = types.list(types.directory), ) cc_variable( From 0e3e1528295512492e84039465868d844f2ac01c Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Thu, 24 Jul 2025 13:57:14 +0200 Subject: [PATCH 5/6] CR --- cc/coverage/type/BUILD | 6 ---- cc/toolchains/cc_coverage_config.bzl | 17 ++++++----- cc/toolchains/cc_toolchain_info.bzl | 9 ------ cc/toolchains/impl/cc_coverage_type.bzl | 40 ------------------------- 4 files changed, 9 insertions(+), 63 deletions(-) delete mode 100644 cc/coverage/type/BUILD delete mode 100644 cc/toolchains/impl/cc_coverage_type.bzl diff --git a/cc/coverage/type/BUILD b/cc/coverage/type/BUILD deleted file mode 100644 index 3985b7a8f..000000000 --- a/cc/coverage/type/BUILD +++ /dev/null @@ -1,6 +0,0 @@ -load("//cc/toolchains/impl:cc_coverage_type.bzl", "cc_coverage_type") - -cc_coverage_type( - name = "gcov", - visibility = ["//visibility:public"], -) diff --git a/cc/toolchains/cc_coverage_config.bzl b/cc/toolchains/cc_coverage_config.bzl index fa22af312..f86805760 100644 --- a/cc/toolchains/cc_coverage_config.bzl +++ b/cc/toolchains/cc_coverage_config.bzl @@ -15,7 +15,9 @@ """Rules to configure cc coverage collection.""" load("//cc/toolchains/impl:collect.bzl", "collect_data") -load(":cc_toolchain_info.bzl", "CoverageTypeInfo", "CoverageConfigInfo") +load(":cc_toolchain_info.bzl", "CoverageConfigInfo") + +visibility("public") def _cc_coverage_config_impl(ctx): exe_info = ctx.attr.src[DefaultInfo] @@ -29,7 +31,7 @@ def _cc_coverage_config_impl(ctx): runfiles = collect_data(ctx, ctx.attr.data + [ctx.attr.src]) config = CoverageConfigInfo( label = ctx.label, - type = ctx.attr.type[CoverageTypeInfo], + type = ctx.attr.type, exe = exe, runfiles = runfiles, ) @@ -54,15 +56,14 @@ def _cc_coverage_config_impl(ctx): cc_coverage_config = rule( implementation = _cc_coverage_config_impl, attrs = { - "type": attr.label( + "type": attr.string( mandatory = True, - providers = [ - CoverageTypeInfo, + values = [ + "gcov", + "llvm-cov", ], doc = """ The type of coverage this config is for (e.g., gcov). - -See `@rules_cc//cc/coverage/type` for a list of supported types. """ ), "src": attr.label( @@ -90,7 +91,7 @@ load("//cc/toolchains:cc_coverage_config.bzl", "cc_coverage_config") cc_coverage_config( name = "gcov", - type = "//cc/coverage/type:gcov", + type = "gcov", src = "bin/gcov", ) ``` diff --git a/cc/toolchains/cc_toolchain_info.bzl b/cc/toolchains/cc_toolchain_info.bzl index 82d6a434d..ffaff99b2 100644 --- a/cc/toolchains/cc_toolchain_info.bzl +++ b/cc/toolchains/cc_toolchain_info.bzl @@ -224,15 +224,6 @@ ToolchainConfigInfo = provider( }, ) -CoverageTypeInfo = provider( - doc = "A type of coverage (eg. gcov)", - # @unsorted-dict-items - fields = { - "label": "(Label) The label defining this provider. Place in error messages to simplify debugging", - "name": "(str) The name of the coverage type", - }, -) - CoverageConfigInfo = provider( doc = "A type of coverage (eg. gcov)", # @unsorted-dict-items diff --git a/cc/toolchains/impl/cc_coverage_type.bzl b/cc/toolchains/impl/cc_coverage_type.bzl deleted file mode 100644 index ad8ad9936..000000000 --- a/cc/toolchains/impl/cc_coverage_type.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2025 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Rules to configure cc coverage types.""" - -load("//cc/toolchains:cc_toolchain_info.bzl", "CoverageTypeInfo") - -# Users may not define their own types. -visibility([ - "//cc/coverage/type", -]) - -def _cc_coverage_type_impl(ctx): - return [ - CoverageTypeInfo( - label = ctx.label, - name = ctx.attr.name, - ), - ] - -cc_coverage_type = rule( - implementation = _cc_coverage_type_impl, - doc = """ -Defines the a type for `cc_coverage_type`. -""", - provides = [ - CoverageTypeInfo, - ], -) From 3169b19ea1046ba053ce2559c087e7370e7129c3 Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Thu, 24 Jul 2025 14:06:36 +0200 Subject: [PATCH 6/6] more --- cc/toolchains/cc_toolchain_info.bzl | 3 ++- cc/toolchains/impl/toolchain_config.bzl | 3 +++ cc/toolchains/impl/toolchain_config_info.bzl | 5 +++-- cc/toolchains/toolchain.bzl | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cc/toolchains/cc_toolchain_info.bzl b/cc/toolchains/cc_toolchain_info.bzl index ffaff99b2..4da3aecd5 100644 --- a/cc/toolchains/cc_toolchain_info.bzl +++ b/cc/toolchains/cc_toolchain_info.bzl @@ -217,7 +217,8 @@ ToolchainConfigInfo = provider( "enabled_features": "(Sequence[FeatureInfo]) The features That are enabled by default for this toolchain", "tool_map": "(ToolConfigInfo) A provider mapping toolchain action types to tools.", "args": "(Sequence[ArgsInfo]) A list of arguments to be unconditionally applied to the toolchain.", - "artifact_name_patterns": "Sequence[ArtifactNamePatternInfo] A artifact name patterns for this toolchain", + "artifact_name_patterns": "Sequence[ArtifactNamePatternInfo] The artifact name patterns for this toolchain", + "coverage_config": "(CoverageConfigInfo) The coverage configuration for this toolchain.", "make_variables": "Sequence[MakeVariableInfo] Make variable substitutions for this toolchain", "files": "(dict[ActionTypeInfo, depset[File]]) Files required for the toolchain, keyed by the action type.", "allowlist_include_directories": "(depset[DirectoryInfo]) Built-in include directories implied by this toolchain's args and tools that should be allowlisted in Bazel's include checker", diff --git a/cc/toolchains/impl/toolchain_config.bzl b/cc/toolchains/impl/toolchain_config.bzl index 1f6efefe5..9f5849393 100644 --- a/cc/toolchains/impl/toolchain_config.bzl +++ b/cc/toolchains/impl/toolchain_config.bzl @@ -19,6 +19,7 @@ load( "ActionTypeSetInfo", "ArgsListInfo", "ArtifactNamePatternInfo", + "CoverageConfigInfo", "FeatureSetInfo", "MakeVariableInfo", "ToolConfigInfo", @@ -61,6 +62,7 @@ def _cc_toolchain_config_impl(ctx): tool_map = ctx.attr.tool_map, args = ctx.attr.args, artifact_name_patterns = ctx.attr.artifact_name_patterns, + coverage_config = ctx.attr.coverage_config, make_variables = ctx.attr.make_variables, ) @@ -110,6 +112,7 @@ cc_toolchain_config = rule( "known_features": attr.label_list(providers = [FeatureSetInfo]), "enabled_features": attr.label_list(providers = [FeatureSetInfo]), "artifact_name_patterns": attr.label_list(providers = [ArtifactNamePatternInfo]), + "coverage_config": attr.label_list(providers = [CoverageConfigInfo]), "make_variables": attr.label_list(providers = [MakeVariableInfo]), "_builtin_features": attr.label(default = "//cc/toolchains/features:all_builtin_features"), }, diff --git a/cc/toolchains/impl/toolchain_config_info.bzl b/cc/toolchains/impl/toolchain_config_info.bzl index 06a2c8f47..f1d057467 100644 --- a/cc/toolchains/impl/toolchain_config_info.bzl +++ b/cc/toolchains/impl/toolchain_config_info.bzl @@ -13,7 +13,7 @@ # limitations under the License. """Helper functions to create and validate a ToolchainConfigInfo.""" -load("//cc/toolchains:cc_toolchain_info.bzl", "ArtifactNamePatternInfo", "MakeVariableInfo", "ToolConfigInfo", "ToolchainConfigInfo") +load("//cc/toolchains:cc_toolchain_info.bzl", "ArtifactNamePatternInfo", "CoverageConfigInfo", "MakeVariableInfo", "ToolConfigInfo", "ToolchainConfigInfo") load(":args_utils.bzl", "get_action_type") load(":collect.bzl", "collect_args_lists", "collect_features") @@ -162,7 +162,7 @@ def _collect_make_variables(targets, fail): return make_variables.values() -def toolchain_config_info(label, known_features = [], enabled_features = [], args = [], artifact_name_patterns = [], make_variables = [], tool_map = None, fail = fail): +def toolchain_config_info(label, known_features = [], enabled_features = [], args = [], artifact_name_patterns = [], coverage_config = None, make_variables = [], tool_map = None, fail = fail): """Generates and validates a ToolchainConfigInfo from lists of labels. Args: @@ -214,6 +214,7 @@ def toolchain_config_info(label, known_features = [], enabled_features = [], arg files = files, allowlist_include_directories = allowlist_include_directories, artifact_name_patterns = _collect_artifact_name_patterns(artifact_name_patterns, fail), + coverage_config = coverage_config[CoverageConfigInfo] if coverage_config else None, make_variables = _collect_make_variables(make_variables, fail), ) _validate_toolchain(toolchain_config, fail = fail) diff --git a/cc/toolchains/toolchain.bzl b/cc/toolchains/toolchain.bzl index af8d5229d..c06e9fc71 100644 --- a/cc/toolchains/toolchain.bzl +++ b/cc/toolchains/toolchain.bzl @@ -58,6 +58,7 @@ def cc_toolchain( tool_map = None, args = [], artifact_name_patterns = [], + coverage_config = None, make_variables = [], known_features = [], enabled_features = [], @@ -171,6 +172,7 @@ def cc_toolchain( tool_map = tool_map, args = args, artifact_name_patterns = artifact_name_patterns, + coverage_config = coverage_config, make_variables = make_variables, known_features = known_features, enabled_features = enabled_features,