From 569379966ace40dfe612b7766ee3a18bac89b545 Mon Sep 17 00:00:00 2001 From: TARGETS Exterminator Date: Thu, 29 Jan 2026 20:26:04 -0800 Subject: [PATCH] Rename build files from TARGETS to BUCK (group ID: 2031500409156131485) (#17052) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/17052 Reviewed By: bigfootjon Differential Revision: D91837560 --- exir/emit/test/BUCK | 35 ++++++++++++++++- exir/emit/test/TARGETS | 30 --------------- exir/operator/{TARGETS => BUCK} | 9 +++-- exir/passes/{TARGETS => BUCK} | 67 +++++++++++++++++---------------- 4 files changed, 73 insertions(+), 68 deletions(-) delete mode 100644 exir/emit/test/TARGETS rename exir/operator/{TARGETS => BUCK} (74%) rename exir/passes/{TARGETS => BUCK} (84%) diff --git a/exir/emit/test/BUCK b/exir/emit/test/BUCK index 213d4c228d1..71a9619a0bc 100644 --- a/exir/emit/test/BUCK +++ b/exir/emit/test/BUCK @@ -1,4 +1,37 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/tests/BUCK when resolving target fbsource//xplat/executorch/exir/tests:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/emit/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + + +fbcode_target(_kind = python_unittest, + # @autodeps-skip pybindings don't work well with autodeps + name = "emit", + srcs = [ + "test_emit.py", + ], + deps = [ + "fbsource//third-party/pypi/pytest:pytest", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/exir:error", + "//executorch/exir:lib", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/exir/backend/test/demos/rpc:executor_backend_partitioner", + "//executorch/exir/backend:backend_api", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:const_prop_pass", + "//executorch/exir/passes:constant_prop_pass", + "//executorch/exir/passes:init_mutable_pass", + "//executorch/exir/tests:lib", + "//executorch/exir/tests:models", + "//executorch/extension/pybindings:portable_lib", + "//executorch/runtime:runtime", + ], +) diff --git a/exir/emit/test/TARGETS b/exir/emit/test/TARGETS deleted file mode 100644 index 153843d45ea..00000000000 --- a/exir/emit/test/TARGETS +++ /dev/null @@ -1,30 +0,0 @@ -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") - -oncall("executorch") - -python_unittest( - # @autodeps-skip pybindings don't work well with autodeps - name = "emit", - srcs = [ - "test_emit.py", - ], - deps = [ - "fbsource//third-party/pypi/pytest:pytest", - "//caffe2:torch", - "//caffe2/functorch:functorch_src", - "//executorch/exir:error", - "//executorch/exir:lib", - "//executorch/exir:print_program", - "//executorch/exir:schema", - "//executorch/exir/backend/test/demos/rpc:executor_backend_partitioner", - "//executorch/exir/backend:backend_api", - "//executorch/exir/emit:lib", - "//executorch/exir/passes:const_prop_pass", - "//executorch/exir/passes:constant_prop_pass", - "//executorch/exir/passes:init_mutable_pass", - "//executorch/exir/tests:lib", - "//executorch/exir/tests:models", - "//executorch/extension/pybindings:portable_lib", - "//executorch/runtime:runtime", - ], -) diff --git a/exir/operator/TARGETS b/exir/operator/BUCK similarity index 74% rename from exir/operator/TARGETS rename to exir/operator/BUCK index 1a8f82a495a..0a3aa845fc2 100644 --- a/exir/operator/TARGETS +++ b/exir/operator/BUCK @@ -1,9 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "convert", srcs = [ "convert.py", @@ -14,7 +15,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "manip", srcs = [ "manip.py", @@ -25,7 +26,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "util", srcs = [ "util.py", @@ -37,7 +38,7 @@ runtime.python_library( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_operator", srcs = [ "test/test_operator.py", diff --git a/exir/passes/TARGETS b/exir/passes/BUCK similarity index 84% rename from exir/passes/TARGETS rename to exir/passes/BUCK index c05ac52dfb9..9a387e9f96f 100644 --- a/exir/passes/TARGETS +++ b/exir/passes/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, name = "lib", srcs = [ "__init__.py", @@ -49,7 +50,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "pass_registry", srcs = [ "pass_registry.py", @@ -60,7 +61,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "external_constants_pass", srcs = [ "external_constants_pass.py", @@ -70,7 +71,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "reinplace_pass", srcs = [ "reinplace.py", @@ -81,7 +82,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "insert_write_back_for_buffers_pass", srcs = [ "insert_write_back_for_buffers_pass.py", @@ -91,7 +92,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "weights_to_outputs_pass", srcs = [ "weights_to_outputs_pass.py", @@ -101,7 +102,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "const_prop_pass", srcs = [ "const_prop_pass.py", @@ -113,7 +114,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "scalar_to_tensor_pass", srcs = [ "scalar_to_tensor_pass.py", @@ -124,7 +125,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "constant_prop_pass", srcs = [ "constant_prop_pass.py", @@ -138,7 +139,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_graph_asserts_pass", srcs = [ "remove_graph_asserts_pass.py", @@ -148,7 +149,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "sym_to_tensor_pass", srcs = [ "sym_to_tensor_pass.py", @@ -159,7 +160,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "quant_fusion_pass", srcs = [ "_quant_patterns_and_replacements.py", @@ -175,7 +176,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "quantize_io_pass", srcs = [ "quantize_io_pass.py", @@ -188,7 +189,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "memory_planning_pass", srcs = [ "memory_planning_pass.py", @@ -204,7 +205,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_noop_pass", srcs = [ "remove_noop_pass.py", @@ -216,7 +217,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "prune_empty_tensor_pass", srcs = [ "prune_empty_tensors_pass.py", @@ -228,7 +229,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_mixed_type_operators", srcs = [ "remove_mixed_type_operators.py", @@ -239,7 +240,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "spec_prop_pass", srcs = [ "spec_prop_pass.py", @@ -252,7 +253,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "init_mutable_pass", srcs = [ "init_mutable_pass.py", @@ -262,7 +263,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "sym_shape_eval_pass", srcs = [ "sym_shape_eval_pass.py", @@ -277,7 +278,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_broken_ops_with_function_ops_pass", srcs = [ "replace_broken_ops_with_function_ops_pass.py", @@ -288,7 +289,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_sym_size_op_pass", srcs = [ "replace_sym_size_op_pass.py", @@ -299,7 +300,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_edge_with_backend_pass", srcs = [ "replace_edge_with_backend_pass.py", @@ -311,7 +312,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "normalize_transpose_pass", srcs = [ "normalize_transpose_pass.py", @@ -322,7 +323,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_aten_with_edge_pass", srcs = [ "replace_aten_with_edge_pass.py", @@ -336,7 +337,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "debug_handle_generator_pass", srcs = [ "debug_handle_generator_pass.py", @@ -349,7 +350,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "prim_ops_py_registry", srcs = ["executorch_prim_ops_registry.py"], deps = [ @@ -358,7 +359,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "dim_order_ops_registry", srcs = ["dim_order_ops_registry.py"], deps = [ @@ -368,7 +369,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "memory_format_ops_pass", srcs = [ "memory_format_ops_pass.py", @@ -382,7 +383,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "normalize_view_copy_base_pass", srcs = [ "normalize_view_copy_base_pass.py", @@ -393,7 +394,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_view_copy_with_view_pass", srcs = [ "replace_view_copy_with_view_pass.py", @@ -406,7 +407,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_unused_parameters_pass", srcs = [ "remove_unused_parameters_pass.py", @@ -417,7 +418,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "convert_constant_dim_order_pass", srcs = [ "convert_constant_dim_order_pass.py",