rename TARGETS-only fbcode dirs with rules to BUCK (xplat-safe)#20793
rename TARGETS-only fbcode dirs with rules to BUCK (xplat-safe)#20793bigfootjon wants to merge 1 commit into
Conversation
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
🔗 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 FailureAs of commit 08a7749 with merge base ff927c8 ( 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. |
|
@bigfootjon has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109082056. |
This PR needs a
|
There was a problem hiding this comment.
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 withfbcode_target(_kind = runtime.<rule>)in a set of BUCK files. - Add
fbcode_targetloads 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.
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 theyuse 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_binarykwargs (e.g.
main_src) are accepted by fbcode_macros' python_binary butnot by xplat's. They need a small targets.bzl tweak before they can land:
Reviewed By: mzlee
Differential Revision: D109082056
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani