From 26740f853e10e34a7e8d2b72b950875796350418 Mon Sep 17 00:00:00 2001 From: Tiago Quelhas Date: Thu, 7 Mar 2024 22:33:17 +0000 Subject: [PATCH] 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 --- aten.bzl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/aten.bzl b/aten.bzl index 9c6325d16abfb..6d8cff6d1ae7d 100644 --- a/aten.bzl +++ b/aten.bzl @@ -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", )