diff options
Diffstat (limited to 'rules/run_binary.bzl')
-rw-r--r-- | rules/run_binary.bzl | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/rules/run_binary.bzl b/rules/run_binary.bzl index c251019..7701fa0 100644 --- a/rules/run_binary.bzl +++ b/rules/run_binary.bzl @@ -22,7 +22,6 @@ load("//lib:dicts.bzl", "dicts") def _impl(ctx): tool_as_list = [ctx.attr.tool] - tool_inputs, tool_input_mfs = ctx.resolve_tools(tools = tool_as_list) args = [ # Expand $(location) / $(locations) in args. # @@ -45,13 +44,12 @@ def _impl(ctx): ctx.actions.run( outputs = ctx.outputs.outs, inputs = ctx.files.srcs, - tools = tool_inputs, + tools = [ctx.executable.tool], executable = ctx.executable.tool, arguments = args, mnemonic = "RunBinary", use_default_shell_env = False, env = dicts.add(ctx.configuration.default_shell_env, envs), - input_manifests = tool_input_mfs, ) return DefaultInfo( files = depset(ctx.outputs.outs), @@ -60,38 +58,38 @@ def _impl(ctx): run_binary = rule( implementation = _impl, - doc = "Runs a binary as a build action.<br/><br/>This rule does not require Bash (unlike" + - " <code>native.genrule</code>).", + doc = "Runs a binary as a build action.\n\nThis rule does not require Bash (unlike" + + " `native.genrule`).", attrs = { "tool": attr.label( - doc = "The tool to run in the action.<br/><br/>Must be the label of a *_binary rule," + + doc = "The tool to run in the action.\n\nMust be the label of a *_binary rule," + " of a rule that generates an executable file, or of a file that can be" + " executed as a subprocess (e.g. an .exe or .bat file on Windows or a binary" + " with executable permission on Linux). This label is available for" + - " <code>$(location)</code> expansion in <code>args</code> and <code>env</code>.", + " `$(location)` expansion in `args` and `env`.", executable = True, allow_files = True, mandatory = True, - cfg = "host", + cfg = "exec", ), "env": attr.string_dict( - doc = "Environment variables of the action.<br/><br/>Subject to " + - " <code><a href=\"https://docs.bazel.build/versions/main/be/make-variables.html#location\">$(location)</a></code>" + + doc = "Environment variables of the action.\n\nSubject to " + + " [`$(location)`](https://bazel.build/reference/be/make-variables#predefined_label_variables)" + " expansion.", ), "srcs": attr.label_list( allow_files = True, - doc = "Additional inputs of the action.<br/><br/>These labels are available for" + - " <code>$(location)</code> expansion in <code>args</code> and <code>env</code>.", + doc = "Additional inputs of the action.\n\nThese labels are available for" + + " `$(location)` expansion in `args` and `env`.", ), "outs": attr.output_list( mandatory = True, - doc = "Output files generated by the action.<br/><br/>These labels are available for" + - " <code>$(location)</code> expansion in <code>args</code> and <code>env</code>.", + doc = "Output files generated by the action.\n\nThese labels are available for" + + " `$(location)` expansion in `args` and `env`.", ), "args": attr.string_list( - doc = "Command line arguments of the binary.<br/><br/>Subject to" + - "<code><a href=\"https://docs.bazel.build/versions/main/be/make-variables.html#location\">$(location)</a></code>" + + doc = "Command line arguments of the binary.\n\nSubject to" + + " [`$(location)`](https://bazel.build/reference/be/make-variables#predefined_label_variables)" + " expansion.", ), }, |