Skip to content

rename TARGETS-only fbcode dirs with rules to BUCK (xplat-safe)#20793

Open
bigfootjon wants to merge 1 commit into
pytorch:mainfrom
bigfootjon:export-D109082056
Open

rename TARGETS-only fbcode dirs with rules to BUCK (xplat-safe)#20793
bigfootjon wants to merge 1 commit into
pytorch:mainfrom
bigfootjon:export-D109082056

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary:
Chunk 5 of fbcode/executorch TARGETS->BUCK migration. 26 directories that
had only a TARGETS file (no sister BUCK) and define real top-level rules.
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 are migrated here. The runtime.* macros they
use are routed by runtime_wrapper.bzl to the right cell-native rule.

Renaming TARGETS -> BUCK exposes these directories to xplat via dirsync.

4 dirs were attempted but reverted because their runtime.python_binary
kwargs (e.g. main_src) are accepted by fbcode_macros' python_binary but
not by xplat's. They need a small targets.bzl tweak before they can land:

  • devtools/inspector
  • examples/devtools/scripts
  • extension/pybindings/fb/test
  • runtime/test

Reviewed By: mzlee

Differential Revision: D109082056

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

Summary:
Chunk 5 of fbcode/executorch TARGETS->BUCK migration. 26 directories that
had only a TARGETS file (no sister BUCK) and define real top-level rules.
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 are migrated here. The `runtime.*` macros they
use are routed by runtime_wrapper.bzl to the right cell-native rule.

Renaming TARGETS -> BUCK exposes these directories to xplat via dirsync.

4 dirs were attempted but reverted because their `runtime.python_binary`
kwargs (e.g. `main_src`) are accepted by fbcode_macros' python_binary but
not by xplat's. They need a small targets.bzl tweak before they can land:
  - devtools/inspector
  - examples/devtools/scripts
  - extension/pybindings/fb/test
  - runtime/test

Reviewed By: mzlee

Differential Revision: D109082056
Copilot AI review requested due to automatic review settings July 8, 2026 20:03
@pytorch-bot

pytorch-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20793

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

❌ 1 New Failure, 1 Unclassified Failure

As of commit 08a7749 with merge base ff927c8 (image):

NEW FAILURE - The following job has failed:

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

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 Jul 8, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Jul 8, 2026
@meta-codesync

meta-codesync Bot commented Jul 8, 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 D109082056.

@github-actions

github-actions Bot commented Jul 8, 2026

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

Continues the fbcode/executorch TARGETS→BUCK migration by converting additional directories’ build definitions to BUCK files that route through the runtime_wrapper.bzl “runtime” macros, using fbcode_target to keep the same rule semantics across fbcode vs xplat.

Changes:

  • Wrap existing runtime.* rule invocations with fbcode_target(_kind = runtime.<rule>) in a set of BUCK files.
  • Add fbcode_target loads where needed to support the migration pattern consistently.
  • Introduce new BUCK definitions for the Gemma/Gemma2 example model Python libraries.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runtime/BUCK Wrap runtime.python_library with fbcode_target for migration consistency.
extension/pybindings/test/BUCK Wrap python library/tests with fbcode_target while preserving target attributes.
export/tests/BUCK Wrap python tests with fbcode_target (including env/labels passthrough).
export/BUCK Wrap export-related python libraries with fbcode_target.
examples/models/llama/params/BUCK Wrap runtime.filegroup with fbcode_target.
examples/models/gemma2/BUCK Add new BUCK target for the Gemma2 example python library via fbcode_target.
examples/models/gemma/BUCK Add new BUCK target for the Gemma example python library via fbcode_target.
devtools/visualization/BUCK Wrap devtools visualization python libraries with fbcode_target.
devtools/intermediate_output_tap/BUCK Wrap intermediate-output-tap python libraries with fbcode_target.
devtools/inspector/numerical_comparator/BUCK Wrap numerical comparator python libraries with fbcode_target.
devtools/BUCK Wrap devtools package python library with fbcode_target.
devtools/backend_debug/BUCK Wrap backend-debug python library with fbcode_target.
backends/xnnpack/recipes/BUCK Wrap XNNPACK recipe python libraries with fbcode_target.
backends/xnnpack/quantizer/BUCK Wrap XNNPACK quantizer python libraries with fbcode_target.
backends/xnnpack/partition/config/BUCK Wrap XNNPACK partition config python library with fbcode_target.
backends/qualcomm/debugger/BUCK Wrap Qualcomm debugger python libraries with fbcode_target.
backends/mediatek/quantizer/BUCK Wrap MediaTek quantizer python library with fbcode_target.
backends/cuda/BUCK Wrap CUDA backend-related python libraries with fbcode_target.
backends/arm/quantizer/BUCK Wrap Arm quantizer python libraries with fbcode_target.
backends/arm/operators/BUCK Wrap Arm operators python libraries with fbcode_target.
backends/arm/operator_support/BUCK Wrap Arm operator support python library with fbcode_target.
backends/arm/debug/BUCK Wrap Arm debug python library with fbcode_target.
backends/arm/BUCK Wrap Arm backend python libraries with fbcode_target.
backends/arm/_passes/BUCK Wrap Arm passes python libraries with fbcode_target.
backends/aoti/passes/BUCK Wrap AOTI passes python library with fbcode_target.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants