Skip to content

Commit

Permalink
Remove unnecessary use of ctx.resolve_tools. (pytorch#120493)
Browse files Browse the repository at this point in the history
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: pytorch#120493
Approved by: https://github.com/ezyang
  • Loading branch information
tjgq authored and pytorchmergebot committed Mar 7, 2024
1 parent d14d62b commit 26740f8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions aten.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,17 @@ 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",
"--per-operator-headers",
"--install_dir",
install_dir,
],
tools = tool_inputs,
input_manifests = tool_inputs_manifest,
use_default_shell_env = True,
mnemonic = "GenerateAten",
)
Expand Down

0 comments on commit 26740f8

Please sign in to comment.