mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
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:
committed by
PyTorch MergeBot
parent
d14d62b7aa
commit
26740f853e
7
aten.bzl
7
aten.bzl
@ -62,11 +62,10 @@ def generate_aten_impl(ctx):
|
|||||||
outputs = [ops_dir] + ctx.outputs.outs
|
outputs = [ops_dir] + ctx.outputs.outs
|
||||||
|
|
||||||
install_dir = paths.dirname(ops_dir.path)
|
install_dir = paths.dirname(ops_dir.path)
|
||||||
tool_inputs, tool_inputs_manifest = ctx.resolve_tools(tools = [ctx.attr.generator])
|
ctx.actions.run(
|
||||||
ctx.actions.run_shell(
|
|
||||||
outputs = outputs,
|
outputs = outputs,
|
||||||
inputs = ctx.files.srcs,
|
inputs = ctx.files.srcs,
|
||||||
command = ctx.executable.generator.path + " $@",
|
executable = ctx.executable.generator,
|
||||||
arguments = [
|
arguments = [
|
||||||
"--source-path",
|
"--source-path",
|
||||||
"aten/src/ATen",
|
"aten/src/ATen",
|
||||||
@ -74,8 +73,6 @@ def generate_aten_impl(ctx):
|
|||||||
"--install_dir",
|
"--install_dir",
|
||||||
install_dir,
|
install_dir,
|
||||||
],
|
],
|
||||||
tools = tool_inputs,
|
|
||||||
input_manifests = tool_inputs_manifest,
|
|
||||||
use_default_shell_env = True,
|
use_default_shell_env = True,
|
||||||
mnemonic = "GenerateAten",
|
mnemonic = "GenerateAten",
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user