Skip to content

rename pure-boilerplate fbcode-only TARGETS to BUCK (#20406)#20406

Merged
meta-codesync[bot] merged 1 commit into
mainfrom
export-D109082059
Jul 2, 2026
Merged

rename pure-boilerplate fbcode-only TARGETS to BUCK (#20406)#20406
meta-codesync[bot] merged 1 commit into
mainfrom
export-D109082059

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jun 18, 2026

Copy link
Copy Markdown
Member

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 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

@pytorch-bot

pytorch-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🔗 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 Failures

As of commit fa736d1 with merge base 3bd4748 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 18, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109082059.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the fbcode TARGETSBUCK 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 TARGETS files that only delegated to define_common_targets().
  • Add new BUCK files in directories that previously had only TARGETS.
  • Update a few existing BUCK files to pass is_fbcode = is_fbcode() into define_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.

Comment thread kernels/optimized/BUCK
Comment on lines 1 to 3
# 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
@bigfootjon bigfootjon force-pushed the export-D109082059 branch from b0a41f6 to fa736d1 Compare July 2, 2026 16:51
@meta-codesync meta-codesync Bot changed the title rename pure-boilerplate fbcode-only TARGETS to BUCK rename pure-boilerplate fbcode-only TARGETS to BUCK (#20406) Jul 2, 2026
@meta-codesync meta-codesync Bot merged commit 40f6d18 into main Jul 2, 2026
281 of 282 checks passed
@meta-codesync meta-codesync Bot deleted the export-D109082059 branch July 2, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants