File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ py_binary(
3131 name = "gen" ,
3232 srcs = ["tools/setup_helpers/gen.py" ],
3333 deps = [
34- ":tools_codegen "
34+ "//tools/codegen "
3535 ],
3636)
3737
@@ -105,19 +105,14 @@ generate_aten(
105105 generator = ":gen" ,
106106)
107107
108- py_library (
109- name = "tools_codegen" ,
110- srcs = glob (["tools/codegen/**/*.py" ]),
111- )
112-
113108py_library (
114109 name = "tools_autograd" ,
115110 srcs = glob (["tools/autograd/*.py" ]),
116111 data = glob ([
117112 "tools/autograd/*.yaml" ,
118113 "tools/autograd/templates/*" ,
119114 ]),
120- deps = [":tools_codegen " ],
115+ deps = ["//tools/codegen " ],
121116)
122117
123118py_library (
@@ -1380,7 +1375,7 @@ cc_library(
13801375py_binary (
13811376 name = "gen_op" ,
13821377 srcs = ["caffe2/contrib/aten/gen_op.py" ],
1383- deps = [":tools_codegen " ],
1378+ deps = ["//tools/codegen " ],
13841379)
13851380
13861381genrule (
Original file line number Diff line number Diff line change @@ -3,6 +3,13 @@ load("@rules_cuda//cuda:defs.bzl", "requires_cuda_enabled")
33load ("//c10/macros:cmake_configure_file.bzl" , "cmake_configure_file" )
44load ("//tools/config:defs.bzl" , "if_cuda" )
55
6+ def _py_library (name , ** kwds ):
7+ deps = [dep for dep in kwds .pop ("deps" , []) if dep != None ]
8+ native .py_library (name = name , deps = deps , ** kwds )
9+
10+ def _requirement (_pypi_project ):
11+ return None
12+
613# Rules implementation for the Bazel build system. Since the common
714# build structure aims to replicate Bazel as much as possible, most of
815# the rules simply forward to the Bazel definitions.
@@ -14,6 +21,8 @@ rules = struct(
1421 filegroup = native .filegroup ,
1522 glob = native .glob ,
1623 if_cuda = if_cuda ,
24+ py_library = _py_library ,
25+ requirement = _requirement ,
1726 requires_cuda_enabled = requires_cuda_enabled ,
1827 select = select ,
1928 test_suite = native .test_suite ,
Original file line number Diff line number Diff line change 1+ load ("//:tools/bazel.bzl" , "rules" )
2+ load (":build.bzl" , "define_targets" )
3+
4+ define_targets (rules = rules )
You can’t perform that action at this time.
0 commit comments