Remove unnecessary use of ctx.resolve_tools. (#120493)

In this case, it's simpler to use ctx.actions.run(executable = ...), which already ensures that the runfiles associated with the executable are present.

(It's also possible to use ctx.actions.run_shell(tools = ...) with a custom command line, but it's unclear to me that indirecting through the shell is needed here.)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/120493
Approved by: https://github.com/ezyang
This commit is contained in:
Tiago Quelhas
2024-03-07 22:33:17 +00:00
committed by PyTorch MergeBot
parent d14d62b7aa
commit 26740f853e

View File

@ -62,11 +62,10 @@ def generate_aten_impl(ctx):
outputs = [ops_dir] + ctx.outputs.outs
install_dir = paths.dirname(ops_dir.path)
tool_inputs, tool_inputs_manifest = ctx.resolve_tools(tools = [ctx.attr.generator])
ctx.actions.run_shell(
ctx.actions.run(
outputs = outputs,
inputs = ctx.files.srcs,
command = ctx.executable.generator.path + " $@",
executable = ctx.executable.generator,
arguments = [
"--source-path",
"aten/src/ATen",
@ -74,8 +73,6 @@ def generate_aten_impl(ctx):
"--install_dir",
install_dir,
],
tools = tool_inputs,
input_manifests = tool_inputs_manifest,
use_default_shell_env = True,
mnemonic = "GenerateAten",
)