Skip to content

Commit ec6798d

Browse files
authored
fix unittest-buck2 -- buck test doesn't imply buck build (#11388)
When I wrote this, I mistakenly thought that `buck test` would build all non-test targets it was passed, but it doesn't. Fix that, and fix a bunch of builds that we weren't guarding so that CI stays green.
1 parent a7a9130 commit ec6798d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.ci/scripts/unittest-buck2.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buck2 query "//backends/apple/... + //backends/example/... + \
1515
//kernels/optimized/... + //kernels/portable/... + //kernels/quantized/... + \
1616
//kernels/test/... + //runtime/... + //schema/... + //test/... + //util/..."
1717

18-
UNBUILDABLE_OPTIMIZED_OPS_REGEX="gelu|fft_r2c|log_softmax"
18+
UNBUILDABLE_OPTIMIZED_OPS_REGEX="_elu|gelu|fft|log_softmax"
1919
BUILDABLE_OPTIMIZED_OPS=$(buck2 query //kernels/optimized/cpu/... | grep -E -v $UNBUILDABLE_OPTIMIZED_OPS_REGEX)
2020

2121
# TODO: build prim_ops_test_cpp again once supported_features works in
@@ -24,6 +24,8 @@ BUILDABLE_KERNELS_PRIM_OPS_TARGETS=$(buck2 query //kernels/prim_ops/... | grep -
2424
# TODO: expand the covered scope of Buck targets.
2525
# //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH.
2626
# //runtime/test/... requires Python torch, which we don't have in our OSS buck setup.
27-
buck2 test $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... \
28-
$BUILDABLE_KERNELS_PRIM_OPS_TARGETS //runtime/backend/... //runtime/core/... \
29-
//runtime/executor: //runtime/kernel/... //runtime/platform/...
27+
for op in "build" "test"; do
28+
buck2 $op $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... \
29+
$BUILDABLE_KERNELS_PRIM_OPS_TARGETS //runtime/backend/... //runtime/core/... \
30+
//runtime/executor: //runtime/kernel/... //runtime/platform/...
31+
done

kernels/portable/cpu/targets.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ def define_common_targets():
7878
"@EXECUTORCH_CLIENTS",
7979
],
8080
deps = [
81-
"//executorch/runtime/core/exec_aten:lib",
8281
"//executorch/runtime/core/exec_aten/util:scalar_type_util",
8382
],
83+
exported_deps = [
84+
"//executorch/runtime/core/exec_aten:lib",
85+
],
8486
)
8587

8688
# Used for dtype selective build. Collect source and header files.

0 commit comments

Comments
 (0)