diff --git a/cc/toolchains/tool.bzl b/cc/toolchains/tool.bzl index 9a9792f7..f07af324 100644 --- a/cc/toolchains/tool.bzl +++ b/cc/toolchains/tool.bzl @@ -33,7 +33,7 @@ def _cc_tool_impl(ctx): label = ctx.label, exe = exe, runfiles = runfiles, - execution_requirements = tuple(ctx.attr.execution_requirements), + execution_requirements = tuple(ctx.attr.tags), ) link = ctx.actions.declare_file(ctx.label.name) @@ -70,9 +70,6 @@ executable label. allow_files = True, doc = "Additional files that are required for this tool to run.", ), - "execution_requirements": attr.string_list( - doc = "A list of strings that provide hints for execution environment compatibility (e.g. `requires-network`).", - ), }, provides = [ToolInfo], doc = """Declares a tool that can be bound to action configs. @@ -87,6 +84,7 @@ cc_tool( executable = "@llvm_toolchain//:bin/clang", # Suppose clang needs libc to run. data = ["@llvm_toolchain//:lib/x86_64-linux-gnu/libc.so.6"] + tags = ["requires-network"], ) ``` """, diff --git a/tests/rule_based_toolchain/tool/BUILD b/tests/rule_based_toolchain/tool/BUILD index d9574e8f..2d588523 100644 --- a/tests/rule_based_toolchain/tool/BUILD +++ b/tests/rule_based_toolchain/tool/BUILD @@ -1,19 +1,16 @@ -load("@rules_testing//lib:util.bzl", "util") load("//cc/toolchains:directory_tool.bzl", "cc_directory_tool") load("//cc/toolchains:tool.bzl", "cc_tool") load("//tests/rule_based_toolchain:analysis_test_suite.bzl", "analysis_test_suite") load(":tool_test.bzl", "TARGETS", "TESTS") -util.helper_target( - cc_tool, +cc_tool( name = "tool", src = "//tests/rule_based_toolchain/testdata:bin_wrapper.sh", data = ["//tests/rule_based_toolchain/testdata:bin"], - execution_requirements = ["requires-network"], + tags = ["requires-network"], ) -util.helper_target( - cc_tool, +cc_tool( name = "wrapped_tool", src = "//tests/rule_based_toolchain/testdata:bin_wrapper", visibility = ["//tests/rule_based_toolchain:__subpackages__"], @@ -24,7 +21,7 @@ cc_directory_tool( data = ["bin"], directory = "//tests/rule_based_toolchain/testdata:directory", executable = "bin_wrapper.sh", - execution_requirements = ["requires-network"], + tags = ["requires-network"], ) analysis_test_suite(