rename pure-boilerplate fbcode-only TARGETS to BUCK (#20406)#20406
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20406
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit fa736d1 with merge base 3bd4748 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109082059. |
There was a problem hiding this comment.
Pull request overview
This PR continues the fbcode TARGETS → BUCK migration by removing boilerplate TARGETS wrappers and (where needed) adding/adjusting BUCK files so define_common_targets() in targets.bzl becomes the single canonical entrypoint for builds (including newly dirsynced xplat exposure).
Changes:
- Remove many boilerplate
TARGETSfiles that only delegated todefine_common_targets(). - Add new
BUCKfiles in directories that previously had onlyTARGETS. - Update a few existing
BUCKfiles to passis_fbcode = is_fbcode()intodefine_common_targets()so fbcode-vs-xplat conditional target materialization remains correct.
Reviewed changes
Copilot reviewed 48 out of 56 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| schema/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| schema/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/platform/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/platform/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/core/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/core/exec_aten/util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/core/exec_aten/testing_util/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/core/exec_aten/testing_util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/core/exec_aten/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/backend/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| runtime/backend/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| kernels/prim_ops/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| kernels/portable/cpu/util/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| kernels/portable/cpu/util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| kernels/optimized/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| kernels/optimized/TARGETS | Remove boilerplate wrapper; BUCK updated to handle fbcode/xplat gating. |
| kernels/optimized/cpu/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| kernels/optimized/BUCK | Pass is_fbcode() into define_common_targets() to preserve conditional behavior. |
| extension/threadpool/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/threadpool/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/testing_util/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/testing_util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/tensor/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/tensor/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/runner_util/test/TARGETS | Remove boilerplate wrapper; BUCK updated to handle fbcode/xplat gating. |
| extension/runner_util/test/BUCK | Pass is_fbcode() into define_common_targets() to preserve conditional behavior. |
| extension/runner_util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/pytree/aten_util/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/pytree/aten_util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/kernel_util/test/TARGETS | Remove boilerplate wrapper; replace with BUCK. |
| extension/kernel_util/test/BUCK | Add BUCK wrapper calling define_common_targets(). |
| extension/image/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/image/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/image/benchmark/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/cuda/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/aten_util/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| extension/aten_util/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| examples/qualcomm/executor_runner/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| examples/models/llama/experimental/TARGETS | Remove boilerplate wrapper; replace with BUCK. |
| examples/models/llama/experimental/BUCK | Add BUCK wrapper calling define_common_targets(). |
| devtools/etdump/data_sinks/tests/TARGETS | Remove boilerplate wrapper; replace with BUCK. |
| devtools/etdump/data_sinks/tests/BUCK | Add BUCK wrapper calling define_common_targets(). |
| codegen/tools/TARGETS | Remove boilerplate wrapper; BUCK updated to handle fbcode/xplat gating consistently. |
| codegen/tools/BUCK | Pass is_fbcode() into define_common_targets(). |
| codegen/test/TARGETS | Remove boilerplate wrapper (BUCK already present). |
| backends/vulkan/test/op_tests/TARGETS | Remove boilerplate wrapper; BUCK updated to handle fbcode/xplat gating. |
| backends/vulkan/test/op_tests/BUCK | Pass is_fbcode() into define_common_targets() to preserve conditional behavior. |
| backends/vulkan/test/custom_ops/TARGETS | Remove boilerplate wrapper; BUCK updated to handle fbcode/xplat gating. |
| backends/vulkan/test/custom_ops/BUCK | Pass is_fbcode() into define_common_targets() to preserve conditional behavior. |
| backends/qualcomm/partition/TARGETS | Remove boilerplate wrapper; replace with BUCK. |
| backends/qualcomm/partition/BUCK | Add BUCK wrapper calling define_common_targets(). |
| backends/aoti/slim/util/test/BUCK | Add BUCK wrapper calling define_common_targets(). |
| backends/aoti/slim/util/BUCK | Add BUCK wrapper calling define_common_targets(). |
| backends/aoti/slim/c10/core/BUCK | Add BUCK wrapper calling define_common_targets(). |
| backends/aoti/BUCK | Add BUCK wrapper calling define_common_targets(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Any targets that should be shared between fbcode and xplat must be defined in | ||
| # targets.bzl. This file can contain xplat-only targets. | ||
| # targets.bzl. | ||
|
|
Summary: Pull Request resolved: #20406 Chunk 3 of fbcode/executorch TARGETS->BUCK migration. 8 directories where only a TARGETS file existed (no sister BUCK). Each TARGETS is a no-arg `define_common_targets()` call, and each shared `targets.bzl` was verified to be xplat-compatible (no fbcode_macros loads, no fbcode-only kwargs like keep_gpu_sections or re_test_utils). Renaming TARGETS -> BUCK exposes these directories to xplat via dirsync. Because the targets.bzl is xplat-compatible, the rules will materialize in xplat for the first time — that is a deliberate side effect of the migration to a single canonical build file per directory. Directories migrated: - backends/aoti - backends/aoti/slim/c10/core - backends/aoti/slim/util - backends/aoti/slim/util/test - backends/qualcomm/partition - devtools/etdump/data_sinks/tests - examples/models/llama/experimental - extension/kernel_util/test extension/training/examples/CIFAR was excluded after a trial run — its targets.bzl uses a runtime.python_binary srcs attribute that the xplat python_binary macro rejects ("default_only is not allowed to be specified, but got [data_utils.py]"). It needs a manual fix to the targets.bzl before it can be migrated. Reviewed By: mzlee Differential Revision: D109082059
b0a41f6 to
fa736d1
Compare
Summary:
Chunk 3 of fbcode/executorch TARGETS->BUCK migration. 8 directories where
only a TARGETS file existed (no sister BUCK). Each TARGETS is a no-arg
define_common_targets()call, and each sharedtargets.bzlwasverified to be xplat-compatible (no fbcode_macros loads, no fbcode-only
kwargs like keep_gpu_sections or re_test_utils).
Renaming TARGETS -> BUCK exposes these directories to xplat via dirsync.
Because the targets.bzl is xplat-compatible, the rules will materialize
in xplat for the first time — that is a deliberate side effect of the
migration to a single canonical build file per directory.
Directories migrated:
extension/training/examples/CIFAR was excluded after a trial run —
its targets.bzl uses a runtime.python_binary srcs attribute that the
xplat python_binary macro rejects ("default_only is not allowed to be
specified, but got [data_utils.py]"). It needs a manual fix to the
targets.bzl before it can be migrated.
Reviewed By: mzlee
Differential Revision: D109082059