diff --git a/aten.bzl b/aten.bzl index 0fce7068ec0..6bce36ca904 100644 --- a/aten.bzl +++ b/aten.bzl @@ -16,7 +16,8 @@ def intern_build_aten_ops(copts, deps): [ PREFIX + "cpu/*.cpp", PREFIX + "quantized/cpu/kernels/*.cpp", - ]): + ], + ): name = impl.replace(PREFIX, "") out = PREFIX + name + "." + cpu_capability + ".cpp" native.genrule( diff --git a/tools/rules/cu.bzl b/tools/rules/cu.bzl index fa4b80db01c..726fadfe98b 100644 --- a/tools/rules/cu.bzl +++ b/tools/rules/cu.bzl @@ -1,3 +1,3 @@ # gpu support is not available def cu_library(**kwargs): - pass + pass diff --git a/tools/rules/workspace.bzl b/tools/rules/workspace.bzl index b519ae925b4..59e12e8d92d 100644 --- a/tools/rules/workspace.bzl +++ b/tools/rules/workspace.bzl @@ -1,13 +1,13 @@ def _impl(repository_ctx): - archive = repository_ctx.attr.name + ".tar" - reference = Label("@%s_unpatched//:README" % repository_ctx.attr.name) - dirname = repository_ctx.path(reference).dirname - repository_ctx.execute(["tar", "hcf", archive, "-C", dirname, "."]) - repository_ctx.extract(archive) - for patch in repository_ctx.attr.patches: - repository_ctx.patch(repository_ctx.path(patch), repository_ctx.attr.patch_strip) - build_file = repository_ctx.path(repository_ctx.attr.build_file) - repository_ctx.execute(["cp", build_file, "BUILD.bazel"]) + archive = repository_ctx.attr.name + ".tar" + reference = Label("@%s_unpatched//:README" % repository_ctx.attr.name) + dirname = repository_ctx.path(reference).dirname + repository_ctx.execute(["tar", "hcf", archive, "-C", dirname, "."]) + repository_ctx.extract(archive) + for patch in repository_ctx.attr.patches: + repository_ctx.patch(repository_ctx.path(patch), repository_ctx.attr.patch_strip) + build_file = repository_ctx.path(repository_ctx.attr.build_file) + repository_ctx.execute(["cp", build_file, "BUILD.bazel"]) _patched_rule = repository_rule( implementation = _impl, @@ -19,11 +19,11 @@ _patched_rule = repository_rule( ) def new_patched_local_repository(name, path, **kwargs): - native.new_local_repository( - name = name + "_unpatched", - build_file_content = """ + native.new_local_repository( + name = name + "_unpatched", + build_file_content = """ pkg_tar(name = "content", srcs = glob(["**"])) """, - path = path, - ) - _patched_rule(name = name, **kwargs) + path = path, + ) + _patched_rule(name = name, **kwargs)