diff --git a/extension/pybindings/test/TARGETS b/extension/pybindings/test/BUCK similarity index 84% rename from extension/pybindings/test/TARGETS rename to extension/pybindings/test/BUCK index c6a77c9d64e..b3d0906dfa0 100644 --- a/extension/pybindings/test/TARGETS +++ b/extension/pybindings/test/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, # autodeps has a real hard time tracking the owner of the pybindings # from portable and the suggested fixes I could find didnt work, so # just disabling for now @@ -30,7 +31,7 @@ runtime.python_library( ], ) -runtime.python_test( +fbcode_target(_kind = runtime.python_test, name = "test_pybindings_portable_lib", srcs = ["test_pybindings.py"], preload_deps = ["//executorch/kernels/quantized:aot_lib"], @@ -40,7 +41,7 @@ runtime.python_test( ], ) -runtime.python_test( +fbcode_target(_kind = runtime.python_test, name = "test_pybindings_aten_lib", srcs = ["test_pybindings.py"], preload_deps = ["//executorch/kernels/quantized:aot_lib"], @@ -51,7 +52,7 @@ runtime.python_test( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "test_pybindings_lib", srcs = ["test_pybindings.py"], deps = [ @@ -60,7 +61,7 @@ runtime.python_library( ) -runtime.python_test( +fbcode_target(_kind = runtime.python_test, name = "test_backend_pybinding", srcs = ["test_backend_pybinding.py"], deps = [ diff --git a/extension/pytree/BUCK b/extension/pytree/BUCK index 1e8cc179228..a92ba8a76be 100644 --- a/extension/pytree/BUCK +++ b/extension/pytree/BUCK @@ -1,8 +1,60 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/pytree/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) + +fbcode_target(_kind = runtime.cxx_python_extension, + name = "pybindings", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +fbcode_target(_kind = runtime.cxx_python_extension, + name = "pybindings_debug", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "pylib", + srcs = [ + "__init__.py", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pybindings", + "//caffe2:torch", + ], +) diff --git a/extension/pytree/TARGETS b/extension/pytree/TARGETS deleted file mode 100644 index 79c4d2b8b3f..00000000000 --- a/extension/pytree/TARGETS +++ /dev/null @@ -1,49 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.cxx_python_extension( - name = "pybindings", - srcs = [ - "pybindings.cpp", - ], - base_module = "executorch.extension.pytree", - deps = [ - ":pytree", - ], - external_deps = [ - "pybind11", - ], -) - -runtime.cxx_python_extension( - name = "pybindings_debug", - srcs = [ - "pybindings.cpp", - ], - base_module = "executorch.extension.pytree", - deps = [ - ":pytree", - ], - external_deps = [ - "pybind11", - ], -) - -runtime.python_library( - name = "pylib", - srcs = [ - "__init__.py", - ], - base_module = "executorch.extension.pytree", - deps = [ - ":pybindings", - "//caffe2:torch", - ], -) diff --git a/extension/pytree/aten_util/BUCK b/extension/pytree/aten_util/BUCK index 1e8cc179228..d28062b81f4 100644 --- a/extension/pytree/aten_util/BUCK +++ b/extension/pytree/aten_util/BUCK @@ -1,8 +1,18 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/pytree/aten_util/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) diff --git a/extension/pytree/aten_util/TARGETS b/extension/pytree/aten_util/TARGETS deleted file mode 100644 index 77b38349334..00000000000 --- a/extension/pytree/aten_util/TARGETS +++ /dev/null @@ -1,7 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/pytree/aten_util/test/BUCK b/extension/pytree/aten_util/test/BUCK index 1e8cc179228..08f7bd2032c 100644 --- a/extension/pytree/aten_util/test/BUCK +++ b/extension/pytree/aten_util/test/BUCK @@ -1,8 +1,19 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/pytree/aten_util/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) diff --git a/extension/pytree/aten_util/test/TARGETS b/extension/pytree/aten_util/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/pytree/aten_util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets()