Skip to content

promote TARGETS content into placeholder BUCK files (#20407)#20407

Open
bigfootjon wants to merge 1 commit into
mainfrom
export-D109082058
Open

promote TARGETS content into placeholder BUCK files (#20407)#20407
bigfootjon wants to merge 1 commit into
mainfrom
export-D109082058

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary:

Chunk 4 of fbcode/executorch TARGETS->BUCK migration. 9 directories where
TARGETS contained the real fbcode-side build rules and BUCK was a tiny
placeholder (most were 4-8 lines like 'empty BUCK file to unblock landing').
Each TARGETS was scanned for fbcode-only constructs (fbcode_macros,
fbcode_target(, cpp_unittest(, cpp_library(, cpp_binary(,
re_test_utils, keep_gpu_sections, buck_genrule, //tools/build/buck/)
and only those without any of those flags are migrated here.

The TARGETS content is copied into BUCK (overwriting the placeholder) and
the TARGETS file is deleted. fbcode now resolves these dirs via BUCK
instead of TARGETS; the rules also become visible to xplat for the first
time via dirsync.

Directories migrated:

  • backends/apple/mps
  • backends/xnnpack/serialization
  • devtools/bundled_program
  • devtools/bundled_program/schema
  • devtools/etdump/fb
  • exir/emit
  • extension/pytree
  • extension/training
  • kernels/portable/test

8 PROMOTE candidates remain on TARGETS for follow-up: backends/cortex_m/test,
examples/models/llama/fb, examples/qualcomm/oss_scripts/{llama,whisper},
exir/dialects/edge/test, exir/tests, kernels/fb/custom_ops, test/end2end.
They have fbcode-only loads (fbcode_macros) or kwargs and need
is_fbcode() gating.

Reviewed By: mzlee

Differential Revision: D109082058

@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/20407

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 4f6b142 with merge base 40f6d18 (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
@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 D109082058.

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

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

Migrates additional directories in the fbcode ExecuTorch TARGETS→BUCK transition by deleting TARGETS files (previously the source of truth) and promoting their contents into BUCK files so fbcode resolves these packages via BUCK and the rules become visible to xplat via dirsync.

Changes:

  • Deleted placeholder (or now-redundant) TARGETS files across multiple directories.
  • Promoted real build rules from TARGETS into BUCK for several packages (e.g., MPS, XNNPACK serialization, bundled_program, pytree, portable test).
  • Updated some BUCK entrypoints to pass is_fbcode() into define_common_targets where the corresponding targets.bzl supports fbcode/xplat divergence.

Reviewed changes

Copilot reviewed 64 out of 72 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/TARGETS Delete TARGETS entrypoint
schema/test/TARGETS Delete TARGETS entrypoint
schema/TARGETS Delete TARGETS entrypoint
runtime/platform/test/TARGETS Delete TARGETS entrypoint
runtime/platform/TARGETS Delete TARGETS entrypoint
runtime/core/TARGETS Delete TARGETS entrypoint
runtime/core/exec_aten/util/TARGETS Delete TARGETS entrypoint
runtime/core/exec_aten/testing_util/test/TARGETS Delete TARGETS entrypoint
runtime/core/exec_aten/testing_util/TARGETS Delete TARGETS entrypoint
runtime/core/exec_aten/TARGETS Delete TARGETS entrypoint
runtime/backend/test/TARGETS Delete TARGETS entrypoint
runtime/backend/TARGETS Delete TARGETS entrypoint
kernels/prim_ops/TARGETS Delete TARGETS entrypoint
kernels/portable/test/TARGETS Delete TARGETS build rules
kernels/portable/test/BUCK Promote TARGETS rules into BUCK
kernels/portable/cpu/util/test/TARGETS Delete TARGETS entrypoint
kernels/portable/cpu/util/TARGETS Delete TARGETS entrypoint
kernels/optimized/test/TARGETS Delete TARGETS entrypoint
kernels/optimized/TARGETS Delete TARGETS entrypoint
kernels/optimized/cpu/TARGETS Delete TARGETS entrypoint
kernels/optimized/BUCK Use is_fbcode() in BUCK
extension/training/TARGETS Delete TARGETS build rules
extension/training/BUCK Promote TARGETS rules into BUCK
extension/threadpool/test/TARGETS Delete TARGETS entrypoint
extension/threadpool/TARGETS Delete TARGETS entrypoint
extension/testing_util/test/TARGETS Delete TARGETS entrypoint
extension/testing_util/TARGETS Delete TARGETS entrypoint
extension/tensor/test/TARGETS Delete TARGETS entrypoint
extension/tensor/TARGETS Delete TARGETS entrypoint
extension/runner_util/test/TARGETS Delete TARGETS entrypoint
extension/runner_util/test/BUCK Use is_fbcode() in BUCK
extension/runner_util/TARGETS Delete TARGETS entrypoint
extension/pytree/TARGETS Delete TARGETS build rules
extension/pytree/BUCK Promote TARGETS rules into BUCK
extension/pytree/aten_util/test/TARGETS Delete TARGETS entrypoint
extension/pytree/aten_util/TARGETS Delete TARGETS entrypoint
extension/kernel_util/test/TARGETS Delete TARGETS entrypoint
extension/kernel_util/test/BUCK Add BUCK entrypoint wrapper
extension/image/test/TARGETS Delete TARGETS entrypoint
extension/image/TARGETS Delete TARGETS entrypoint
extension/image/benchmark/TARGETS Delete TARGETS entrypoint
extension/cuda/TARGETS Delete TARGETS entrypoint
extension/aten_util/test/TARGETS Delete TARGETS entrypoint
extension/aten_util/TARGETS Delete TARGETS entrypoint
exir/emit/TARGETS Delete TARGETS build rules
exir/emit/BUCK Promote TARGETS rules into BUCK
examples/qualcomm/executor_runner/TARGETS Delete TARGETS entrypoint
examples/models/llama/experimental/TARGETS Delete TARGETS entrypoint
examples/models/llama/experimental/BUCK Add BUCK entrypoint wrapper
devtools/etdump/data_sinks/tests/TARGETS Delete TARGETS entrypoint
devtools/etdump/data_sinks/tests/BUCK Add BUCK entrypoint wrapper
devtools/bundled_program/TARGETS Delete TARGETS build rules
devtools/bundled_program/schema/TARGETS Delete TARGETS build rules
devtools/bundled_program/schema/BUCK Promote TARGETS rules into BUCK
devtools/bundled_program/BUCK Promote TARGETS rules into BUCK
codegen/tools/TARGETS Delete TARGETS entrypoint
codegen/tools/BUCK Use is_fbcode() in BUCK
codegen/test/TARGETS Delete TARGETS entrypoint
backends/xnnpack/serialization/TARGETS Delete TARGETS build rules
backends/xnnpack/serialization/BUCK Promote TARGETS rules into BUCK
backends/vulkan/test/op_tests/TARGETS Delete TARGETS entrypoint
backends/vulkan/test/op_tests/BUCK Use is_fbcode() in BUCK
backends/vulkan/test/custom_ops/TARGETS Delete TARGETS entrypoint
backends/vulkan/test/custom_ops/BUCK Use is_fbcode() in BUCK
backends/qualcomm/partition/TARGETS Delete TARGETS entrypoint
backends/qualcomm/partition/BUCK Add BUCK entrypoint wrapper
backends/apple/mps/TARGETS Delete TARGETS build rules
backends/apple/mps/BUCK Promote TARGETS rules into BUCK
backends/aoti/slim/util/test/BUCK Add BUCK entrypoint wrapper
backends/aoti/slim/util/BUCK Add BUCK entrypoint wrapper
backends/aoti/slim/c10/core/BUCK Add BUCK entrypoint wrapper
backends/aoti/BUCK Add BUCK entrypoint wrapper

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backends/apple/mps/BUCK Outdated
Comment on lines +9 to +14
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets(
is_xplat = True,
platforms = [APPLE],
define_common_targets()
@meta-codesync meta-codesync Bot changed the title promote TARGETS content into placeholder BUCK files promote TARGETS content into placeholder BUCK files (#20407) Jul 2, 2026
meta-codesync Bot pushed a commit that referenced this pull request Jul 2, 2026
Summary:

Chunk 4 of fbcode/executorch TARGETS->BUCK migration. 9 directories where
TARGETS contained the real fbcode-side build rules and BUCK was a tiny
placeholder (most were 4-8 lines like 'empty BUCK file to unblock landing').
Each TARGETS was scanned for fbcode-only constructs (`fbcode_macros`,
`fbcode_target(`, `cpp_unittest(`, `cpp_library(`, `cpp_binary(`,
`re_test_utils`, `keep_gpu_sections`, `buck_genrule`, `//tools/build/buck/`)
and only those without any of those flags are migrated here.

The TARGETS content is copied into BUCK (overwriting the placeholder) and
the TARGETS file is deleted. fbcode now resolves these dirs via BUCK
instead of TARGETS; the rules also become visible to xplat for the first
time via dirsync.

Directories migrated:
  - backends/apple/mps
  - backends/xnnpack/serialization
  - devtools/bundled_program
  - devtools/bundled_program/schema
  - devtools/etdump/fb
  - exir/emit
  - extension/pytree
  - extension/training
  - kernels/portable/test

8 PROMOTE candidates remain on TARGETS for follow-up: backends/cortex_m/test,
examples/models/llama/fb, examples/qualcomm/oss_scripts/{llama,whisper},
exir/dialects/edge/test, exir/tests, kernels/fb/custom_ops, test/end2end.
They have fbcode-only loads (`fbcode_macros`) or kwargs and need
`is_fbcode()` gating.

Reviewed By: mzlee

Differential Revision: D109082058
@meta-codesync meta-codesync Bot force-pushed the export-D109082058 branch from 6655b42 to 583c9c8 Compare July 2, 2026 19:32
bigfootjon added a commit that referenced this pull request Jul 2, 2026
Summary:
Pull Request resolved: #20407

Chunk 4 of fbcode/executorch TARGETS->BUCK migration. 9 directories where
TARGETS contained the real fbcode-side build rules and BUCK was a tiny
placeholder (most were 4-8 lines like 'empty BUCK file to unblock landing').
Each TARGETS was scanned for fbcode-only constructs (`fbcode_macros`,
`fbcode_target(`, `cpp_unittest(`, `cpp_library(`, `cpp_binary(`,
`re_test_utils`, `keep_gpu_sections`, `buck_genrule`, `//tools/build/buck/`)
and only those without any of those flags are migrated here.

The TARGETS content is copied into BUCK (overwriting the placeholder) and
the TARGETS file is deleted. fbcode now resolves these dirs via BUCK
instead of TARGETS; the rules also become visible to xplat for the first
time via dirsync.

Directories migrated:
  - backends/apple/mps
  - backends/xnnpack/serialization
  - devtools/bundled_program
  - devtools/bundled_program/schema
  - devtools/etdump/fb
  - exir/emit
  - extension/pytree
  - extension/training
  - kernels/portable/test

8 PROMOTE candidates remain on TARGETS for follow-up: backends/cortex_m/test,
examples/models/llama/fb, examples/qualcomm/oss_scripts/{llama,whisper},
exir/dialects/edge/test, exir/tests, kernels/fb/custom_ops, test/end2end.
They have fbcode-only loads (`fbcode_macros`) or kwargs and need
`is_fbcode()` gating.

Reviewed By: mzlee

Differential Revision: D109082058
@bigfootjon bigfootjon force-pushed the export-D109082058 branch from 583c9c8 to a23f524 Compare July 2, 2026 19:34
meta-codesync Bot pushed a commit that referenced this pull request Jul 2, 2026
Summary:

Chunk 4 of fbcode/executorch TARGETS->BUCK migration. 9 directories where
TARGETS contained the real fbcode-side build rules and BUCK was a tiny
placeholder (most were 4-8 lines like 'empty BUCK file to unblock landing').
Each TARGETS was scanned for fbcode-only constructs (`fbcode_macros`,
`fbcode_target(`, `cpp_unittest(`, `cpp_library(`, `cpp_binary(`,
`re_test_utils`, `keep_gpu_sections`, `buck_genrule`, `//tools/build/buck/`)
and only those without any of those flags are migrated here.

The TARGETS content is copied into BUCK (overwriting the placeholder) and
the TARGETS file is deleted. fbcode now resolves these dirs via BUCK
instead of TARGETS; the rules also become visible to xplat for the first
time via dirsync.

Directories migrated:
  - backends/apple/mps
  - backends/xnnpack/serialization
  - devtools/bundled_program
  - devtools/bundled_program/schema
  - devtools/etdump/fb
  - exir/emit
  - extension/pytree
  - extension/training
  - kernels/portable/test

8 PROMOTE candidates remain on TARGETS for follow-up: backends/cortex_m/test,
examples/models/llama/fb, examples/qualcomm/oss_scripts/{llama,whisper},
exir/dialects/edge/test, exir/tests, kernels/fb/custom_ops, test/end2end.
They have fbcode-only loads (`fbcode_macros`) or kwargs and need
`is_fbcode()` gating.

Reviewed By: mzlee

Differential Revision: D109082058
@meta-codesync meta-codesync Bot force-pushed the export-D109082058 branch from a23f524 to 2b6150b Compare July 2, 2026 21:28
Copilot AI review requested due to automatic review settings July 2, 2026 21:28
@bigfootjon bigfootjon removed the request for review from Copilot July 2, 2026 21:28
Summary:
Pull Request resolved: #20407

Chunk 4 of fbcode/executorch TARGETS->BUCK migration. 9 directories where
TARGETS contained the real fbcode-side build rules and BUCK was a tiny
placeholder (most were 4-8 lines like 'empty BUCK file to unblock landing').
Each TARGETS was scanned for fbcode-only constructs (`fbcode_macros`,
`fbcode_target(`, `cpp_unittest(`, `cpp_library(`, `cpp_binary(`,
`re_test_utils`, `keep_gpu_sections`, `buck_genrule`, `//tools/build/buck/`)
and only those without any of those flags are migrated here.

The TARGETS content is copied into BUCK (overwriting the placeholder) and
the TARGETS file is deleted. fbcode now resolves these dirs via BUCK
instead of TARGETS; the rules also become visible to xplat for the first
time via dirsync.

Directories migrated:
  - backends/apple/mps
  - backends/xnnpack/serialization
  - devtools/bundled_program
  - devtools/bundled_program/schema
  - devtools/etdump/fb
  - exir/emit
  - extension/pytree
  - extension/training
  - kernels/portable/test

8 PROMOTE candidates remain on TARGETS for follow-up: backends/cortex_m/test,
examples/models/llama/fb, examples/qualcomm/oss_scripts/{llama,whisper},
exir/dialects/edge/test, exir/tests, kernels/fb/custom_ops, test/end2end.
They have fbcode-only loads (`fbcode_macros`) or kwargs and need
`is_fbcode()` gating.

Reviewed By: mzlee

Differential Revision: D109082058
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