Skip to content

migrate is_fbcode-flagged TARGETS files to BUCK with runtime detection (#20404)#20404

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

migrate is_fbcode-flagged TARGETS files to BUCK with runtime detection (#20404)#20404
meta-codesync[bot] merged 1 commit into
mainfrom
export-D109082061

Conversation

@bigfootjon

@bigfootjon bigfootjon commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary:

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called define_common_targets(is_fbcode = True) and the sister
BUCK called define_common_targets(). The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with define_common_targets(is_fbcode = is_fbcode())
using fbsource_utils.is_fbcode() for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:

  • backends/vulkan/test/custom_ops
  • backends/vulkan/test/op_tests
  • codegen/tools
  • extension/runner_util/test
  • kernels/optimized

Reviewed By: ndmitchell, mzlee

Differential Revision: D109082061

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

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

❌ 1 New Failure

As of commit 4e249e7 with merge base 7b6d3bf (image):

NEW FAILURE - The following job has failed:

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

@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

This PR continues the fbcode/xplat Buck buildfile migration by removing redundant TARGETS files and ensuring BUCK-based entrypoints preserve is_fbcode-gated behavior via runtime cell detection.

Changes:

  • Delete a large set of TARGETS files that only delegated to define_common_targets() in targets.bzl.
  • Update selected BUCK files to call define_common_targets(is_fbcode = is_fbcode()) (via @fbsource//tools/build_defs:fbsource_utils.bzl) to preserve fbcode-only branching behavior when TARGETS is removed.
  • Keep targets.bzl as the single source of truth for shared target definitions.

Reviewed changes

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

Show a summary per file
File Description
test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
schema/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
schema/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/platform/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/platform/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/core/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/core/exec_aten/util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/core/exec_aten/testing_util/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/core/exec_aten/testing_util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/core/exec_aten/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/backend/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
runtime/backend/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
kernels/prim_ops/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
kernels/portable/cpu/util/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
kernels/portable/cpu/util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
kernels/optimized/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
kernels/optimized/TARGETS Removed delegating TARGETS file; previously passed fbcode flag positionally.
kernels/optimized/cpu/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
kernels/optimized/BUCK Pass is_fbcode = is_fbcode() into define_common_targets for correct fbcode/xplat branching.
extension/threadpool/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/threadpool/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/testing_util/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/testing_util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/tensor/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/tensor/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/runner_util/test/TARGETS Removed delegating TARGETS file that explicitly set is_fbcode = True.
extension/runner_util/test/BUCK Pass is_fbcode = is_fbcode() into define_common_targets for correct fbcode/xplat behavior.
extension/runner_util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/pytree/aten_util/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/pytree/aten_util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/image/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/image/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/image/benchmark/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/cuda/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/aten_util/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
extension/aten_util/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
examples/qualcomm/executor_runner/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
examples/devtools/example_runner/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
configurations/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
codegen/tools/TARGETS Removed delegating TARGETS file that explicitly set is_fbcode = True.
codegen/tools/BUCK Pass is_fbcode = is_fbcode() into define_common_targets for correct fbcode/xplat branching.
codegen/test/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
backends/vulkan/test/op_tests/TARGETS Removed delegating TARGETS file that explicitly set is_fbcode = True.
backends/vulkan/test/op_tests/BUCK Pass is_fbcode = is_fbcode() into define_common_targets for correct fbcode/xplat branching.
backends/vulkan/test/custom_ops/TARGETS Removed delegating TARGETS file that explicitly set is_fbcode = True.
backends/vulkan/test/custom_ops/BUCK Pass is_fbcode = is_fbcode() into define_common_targets for correct fbcode/xplat branching.
backends/qualcomm/builders/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.
backends/qualcomm/aot/wrappers/TARGETS Removed delegating TARGETS file in favor of BUCK-based evaluation.

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

bigfootjon added a commit that referenced this pull request Jun 22, 2026
#20404)

Summary:
Pull Request resolved: #20404

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: mzlee

Differential Revision: D109082061
@meta-codesync meta-codesync Bot changed the title migrate is_fbcode-flagged TARGETS files to BUCK with runtime detection migrate is_fbcode-flagged TARGETS files to BUCK with runtime detection (#20404) Jun 22, 2026
meta-codesync Bot pushed a commit that referenced this pull request Jun 26, 2026
#20404)

Summary:

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: mzlee

Differential Revision: D109082061
@meta-codesync meta-codesync Bot force-pushed the export-D109082061 branch from f116133 to b4dc58e Compare June 26, 2026 17:33
Copilot AI review requested due to automatic review settings June 26, 2026 17:33
@bigfootjon bigfootjon removed the request for review from Copilot June 26, 2026 17:33
meta-codesync Bot pushed a commit that referenced this pull request Jun 29, 2026
#20404)

Summary:

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: mzlee

Differential Revision: D109082061
Copilot AI review requested due to automatic review settings June 29, 2026 20:27
@meta-codesync meta-codesync Bot force-pushed the export-D109082061 branch from e38aa4f to efa09b5 Compare June 29, 2026 20:27
@bigfootjon bigfootjon removed the request for review from Copilot June 29, 2026 20:27
bigfootjon added a commit that referenced this pull request Jun 29, 2026
#20404)

Summary:
Pull Request resolved: #20404

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: mzlee

Differential Revision: D109082061
bigfootjon added a commit that referenced this pull request Jun 30, 2026
#20404)

Summary:
Pull Request resolved: #20404

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: mzlee

Differential Revision: D109082061
Copilot AI review requested due to automatic review settings June 30, 2026 16:36
@bigfootjon bigfootjon requested a review from GregoryComer as a code owner June 30, 2026 16:36

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

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

bigfootjon added a commit that referenced this pull request Jun 30, 2026
#20404)

Summary:
Pull Request resolved: #20404

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: mzlee

Differential Revision: D109082061

@ndmitchell ndmitchell left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

meta-codesync Bot pushed a commit that referenced this pull request Jul 1, 2026
#20404)

Summary:

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: ndmitchell, mzlee

Differential Revision: D109082061
Copilot AI review requested due to automatic review settings July 1, 2026 16:01
@meta-codesync meta-codesync Bot force-pushed the export-D109082061 branch from bfe5281 to 3596494 Compare July 1, 2026 16:01
@bigfootjon bigfootjon removed the request for review from Copilot July 1, 2026 16:01
#20404)

Summary:
Pull Request resolved: #20404

Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where
TARGETS called `define_common_targets(is_fbcode = True)` and the sister
BUCK called `define_common_targets()`. The shared targets.bzl actually
branches on is_fbcode, so the flag must be preserved.

Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())`
using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes
TARGETS. fbcode falls through to BUCK and gets the True branch as before;
xplat keeps getting the False branch.

Directories migrated:
  - backends/vulkan/test/custom_ops
  - backends/vulkan/test/op_tests
  - codegen/tools
  - extension/runner_util/test
  - kernels/optimized

Reviewed By: ndmitchell, mzlee

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants