Skip to content

Commit

Permalink
Remove unnecessary ctx.resolve_tools.
Browse files Browse the repository at this point in the history
`ctx.actions.run(executable = ...)` is sufficient to include the runfiles in the action inputs. (More generally, ctx.resolve_tools is discouraged in favor of `ctx.actions.run(tools = ...)`.)
  • Loading branch information
tjgq authored and jbedard committed Feb 26, 2024
1 parent 6414c88 commit e514283
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/private/run_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ load(":expand_locations.bzl", "expand_locations")
load(":expand_variables.bzl", "expand_variables")

def _run_binary_impl(ctx):
tool_as_list = [ctx.attr.tool]
tool_inputs, tool_input_mfs = ctx.resolve_tools(tools = tool_as_list)
args = ctx.actions.args()

outputs = []
Expand Down Expand Up @@ -70,15 +68,13 @@ Possible fixes:
ctx.actions.run(
outputs = outputs,
inputs = inputs,
tools = tool_inputs,
executable = ctx.executable.tool,
arguments = [args],
mnemonic = ctx.attr.mnemonic if ctx.attr.mnemonic else None,
progress_message = ctx.attr.progress_message if ctx.attr.progress_message else None,
execution_requirements = ctx.attr.execution_requirements if ctx.attr.execution_requirements else None,
use_default_shell_env = ctx.attr.use_default_shell_env,
env = dicts.add(ctx.configuration.default_shell_env, envs),
input_manifests = tool_input_mfs,
)
return DefaultInfo(
files = depset(outputs),
Expand Down

0 comments on commit e514283

Please sign in to comment.