Skip to content

Commit 68dfcc3

Browse files
bigfootjonmeta-codesync[bot]
authored andcommitted
migrate 3 fbcode-only TARGETS dirs with placeholder BUCK siblings (#21066)
Summary: Pull Request resolved: #21066 Chunk 7A of fbcode/executorch TARGETS->BUCK migration. 3 directories where: - TARGETS contained substantial fbcode-only build rules (`fbcode_macros`, `cpp_library`, `cpp_unittest`, etc.) - BUCK was a 4-5-line placeholder (e.g. "empty BUCK file to unblock landing") - No targets.bzl existed yet Same transform as chunk 6: created a new `targets.bzl` with the original loads and a `define_common_targets(is_fbcode = False)` function whose body opens with `if not is_fbcode: return`. Overwrote the placeholder BUCK with a thin caller that loads `fbsource_utils.is_fbcode()` and calls `define_common_targets(is_fbcode = is_fbcode())`. Directories migrated: - exir/dialects/edge/test - exir/tests - test/end2end Differential Revision: D109082045
1 parent 7628aa6 commit 68dfcc3

9 files changed

Lines changed: 675 additions & 653 deletions

File tree

exir/dialects/edge/test/BUCK

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# add this empty BUCK file to unblock landing. Without this, we get land error:
2-
# "No build file at xplat/executorch/exir/dialects/edge/test/BUCK when resolving target fbsource//xplat/executorch/exir/dialects/edge/test:."
1+
# Any targets that should be shared between fbcode and xplat must be defined in
2+
# targets.bzl.
3+
4+
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
5+
load(":targets.bzl", "define_common_targets")
36

47
oncall("executorch")
8+
9+
define_common_targets(is_fbcode = is_fbcode())

exir/dialects/edge/test/TARGETS

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest")
2+
3+
def define_common_targets(is_fbcode = False):
4+
if not is_fbcode:
5+
return
6+
7+
python_unittest(
8+
name = "test_edge_yaml",
9+
srcs = [
10+
"test_edge_yaml.py",
11+
],
12+
resources = {
13+
"//executorch/exir/dialects/edge:edge_yaml": "edge.yaml",
14+
},
15+
labels = ["long_running"],
16+
deps = [
17+
"fbsource//third-party/pypi/expecttest:expecttest", # @manual
18+
"//caffe2:torch",
19+
"//executorch/exir/dialects/edge/dtype:lib",
20+
"//executorch/exir/dialects/edge/spec:lib",
21+
],
22+
)
23+
24+
python_unittest(
25+
name = "test_edge_ops",
26+
srcs = [
27+
"test_edge_ops.py",
28+
],
29+
deps = [
30+
"//caffe2:torch",
31+
"//executorch/exir/dialects:lib",
32+
"//executorch/exir/dialects/edge:lib",
33+
],
34+
)

exir/tests/BUCK

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# add this empty BUCK file to unblock landing. Without this, we get land error:
2-
# "No build file at xplat/executorch/exir/tests/BUCK when resolving target fbsource//xplat/executorch/exir/tests:."
1+
# Any targets that should be shared between fbcode and xplat must be defined in
2+
# targets.bzl.
3+
4+
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
5+
load(":targets.bzl", "define_common_targets")
36

47
oncall("executorch")
8+
9+
define_common_targets(is_fbcode = is_fbcode())

0 commit comments

Comments
 (0)