Skip to content

Commit f5700d2

Browse files
committed
Try testing selective build in OSS buck
1 parent c9f46e2 commit f5700d2

File tree

1 file changed

+71
-74
lines changed

1 file changed

+71
-74
lines changed

codegen/tools/targets.bzl

Lines changed: 71 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def define_common_targets(is_fbcode = False):
2929
deps = [
3030
":gen_oplist_lib",
3131
],
32-
preload_deps = [] if runtime.is_oss else ["//executorch/codegen/tools:selective_build"], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
32+
preload_deps = ["//executorch/codegen/tools:selective_build"],
3333
package_style = "inplace",
3434
visibility = [
3535
"//executorch/...",
@@ -196,79 +196,76 @@ def define_common_targets(is_fbcode = False):
196196
_is_external_target = True,
197197
)
198198

199-
if not runtime.is_oss:
200-
runtime.cxx_python_extension(
201-
name = "selective_build",
202-
srcs = [
203-
"selective_build.cpp",
204-
],
205-
base_module = "executorch.codegen.tools",
206-
types = ["selective_build.pyi"],
207-
preprocessor_flags = [
208-
"-DEXECUTORCH_PYTHON_MODULE_NAME=selective_build",
209-
],
210-
deps = [
211-
"//executorch/runtime/core:core",
212-
"//executorch/schema:program",
213-
],
214-
external_deps = [
215-
"pybind11",
216-
],
217-
use_static_deps = True,
218-
visibility = ["//executorch/codegen/..."],
219-
)
220-
199+
200+
runtime.cxx_python_extension(
201+
name = "selective_build",
202+
srcs = [
203+
"selective_build.cpp",
204+
],
205+
base_module = "executorch.codegen.tools",
206+
types = ["selective_build.pyi"],
207+
preprocessor_flags = [
208+
"-DEXECUTORCH_PYTHON_MODULE_NAME=selective_build",
209+
],
210+
deps = [
211+
"//executorch/runtime/core:core",
212+
"//executorch/schema:program",
213+
],
214+
external_deps = [
215+
"pybind11",
216+
],
217+
use_static_deps = True,
218+
visibility = ["//executorch/codegen/..."],
219+
)
221220

222-
# TODO(larryliu0820): This is a hack to only run these two on fbcode. These targets depends on exir which is only available in fbcode.
223-
if not runtime.is_oss and is_fbcode:
224-
runtime.python_binary(
225-
name = "gen_functions_yaml",
226-
srcs = ["gen_ops_def.py"],
227-
main_module = "executorch.codegen.tools.gen_ops_def",
228-
package_style = "inplace",
229-
visibility = [
230-
"//executorch/...",
231-
"@EXECUTORCH_CLIENTS",
232-
],
233-
deps = [
234-
"fbsource//third-party/pypi/pyyaml:pyyaml",
235-
":yaml_util",
236-
"//caffe2:torch",
237-
"//executorch/exir:schema",
238-
"//executorch/exir/_serialize:lib",
239-
],
240-
)
221+
runtime.python_binary(
222+
name = "gen_functions_yaml",
223+
srcs = ["gen_ops_def.py"],
224+
main_module = "executorch.codegen.tools.gen_ops_def",
225+
package_style = "inplace",
226+
visibility = [
227+
"//executorch/...",
228+
"@EXECUTORCH_CLIENTS",
229+
],
230+
deps = [
231+
"fbsource//third-party/pypi/pyyaml:pyyaml",
232+
":yaml_util",
233+
"//caffe2:torch",
234+
"//executorch/exir:schema",
235+
"//executorch/exir/_serialize:lib",
236+
],
237+
)
241238

242-
runtime.python_test(
243-
name = "test_gen_oplist_real_model",
244-
srcs = ["test/test_gen_oplist_real_model.py"],
245-
base_module = "",
246-
resources = {
247-
"//executorch/test/models:exported_programs[ModuleAddMul.pte]": "test/ModuleAddMul.pte",
248-
},
249-
visibility = [
250-
"//executorch/...",
251-
],
252-
deps = [
253-
":gen_oplist_lib",
254-
"//libfb/py:parutil",
255-
],
256-
)
239+
runtime.python_test(
240+
name = "test_gen_oplist_real_model",
241+
srcs = ["test/test_gen_oplist_real_model.py"],
242+
base_module = "",
243+
resources = {
244+
"//executorch/test/models:exported_programs[ModuleAddMul.pte]": "test/ModuleAddMul.pte",
245+
},
246+
visibility = [
247+
"//executorch/...",
248+
],
249+
deps = [
250+
":gen_oplist_lib",
251+
"//libfb/py:parutil",
252+
],
253+
)
257254

258-
runtime.python_test(
259-
name = "test_selective_build",
260-
srcs = [
261-
"test/test_selective_build.py",
262-
],
263-
package_style = "inplace",
264-
visibility = [
265-
"PUBLIC",
266-
],
267-
deps = [
268-
":selective_build",
269-
"fbsource//third-party/pypi/expecttest:expecttest",
270-
"//caffe2:torch",
271-
"//executorch/exir:lib",
272-
],
273-
_is_external_target = True,
274-
)
255+
runtime.python_test(
256+
name = "test_selective_build",
257+
srcs = [
258+
"test/test_selective_build.py",
259+
],
260+
package_style = "inplace",
261+
visibility = [
262+
"PUBLIC",
263+
],
264+
deps = [
265+
":selective_build",
266+
"fbsource//third-party/pypi/expecttest:expecttest",
267+
"//caffe2:torch",
268+
"//executorch/exir:lib",
269+
],
270+
_is_external_target = True,
271+
)

0 commit comments

Comments
 (0)