Skip to content

Commit

Permalink
[AutoAccept][Codemod][FBSourceBuckFormatLinter] Daily `arc lint --tak…
Browse files Browse the repository at this point in the history
…e BUCKFORMAT`

Reviewed By: zertosh

Differential Revision: D33119794

fbshipit-source-id: ca327caf34560c0bba32511e57d5dc18b71bdfe1
  • Loading branch information
CodemodService FBSourceBuckFormatLinterBot authored and facebook-github-bot committed Dec 15, 2021
1 parent 59000cf commit 7a12b50
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions aten.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_cc//cc:defs.bzl", "cc_library")

CPU_CAPABILITY_NAMES = ["DEFAULT", "AVX2"]
CAPABILITY_COMPILER_FLAGS = {
Expand Down Expand Up @@ -47,34 +47,37 @@ def intern_build_aten_ops(copts, deps):
def generate_aten_impl(ctx):
# Declare the entire ATen/ops/ directory as an output
ops_dir = ctx.actions.declare_directory("aten/src/ATen/ops")
outputs=[ops_dir] + ctx.outputs.outs
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])
tool_inputs, tool_inputs_manifest = ctx.resolve_tools(tools = [ctx.attr.generator])
ctx.actions.run_shell(
outputs=outputs,
inputs=ctx.files.srcs,
command=ctx.executable.generator.path + " $@",
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,
outputs = outputs,
inputs = ctx.files.srcs,
command = ctx.executable.generator.path + " $@",
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,
)
return [DefaultInfo(files=depset(outputs))]

return [DefaultInfo(files = depset(outputs))]

generate_aten = rule(
implementation = generate_aten_impl,
attrs = {
"outs": attr.output_list(),
"srcs": attr.label_list(allow_files=True),
"generator": attr.label(
executable=True,
allow_files=True,
mandatory=True,
cfg="exec",
executable = True,
allow_files = True,
mandatory = True,
cfg = "exec",
),
}
"outs": attr.output_list(),
"srcs": attr.label_list(allow_files = True),
},
)

0 comments on commit 7a12b50

Please sign in to comment.