Skip to content

Commit afe45ac

Browse files
[executorch] Remove EXECUTORCH_CLIENTS visibility gating - Core (#16521)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #16474 by @GregoryComer ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/GregoryComer/167/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/GregoryComer/167/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/GregoryComer/167/orig Differential Revision: [D89902032](https://our.internmc.facebook.com/intern/diff/D89902032/) @diff-train-skip-merge Co-authored-by: Gregory Comer <[email protected]>
1 parent 236f847 commit afe45ac

File tree

8 files changed

+20
-104
lines changed

8 files changed

+20
-104
lines changed

runtime/core/exec_aten/targets.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ def define_common_targets():
1515
name = "lib" + aten_suffix,
1616
exported_headers = ["exec_aten.h"],
1717
exported_preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [],
18-
visibility = [
19-
"//executorch/...",
20-
"@EXECUTORCH_CLIENTS",
21-
],
18+
visibility = ["PUBLIC"],
2219
exported_deps = ["//executorch/runtime/core:tensor_shape_dynamism"] + ([] if aten_mode else ["//executorch/runtime/core/portable_type:portable_type"]),
2320
exported_external_deps = ["libtorch"] if aten_mode else [],
2421
)

runtime/core/exec_aten/testing_util/targets.bzl

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,7 @@ def define_common_targets():
1616
"tensor_util.h",
1717
"tensor_factory.h",
1818
],
19-
visibility = [
20-
# Be strict with the visibility so that operator implementations
21-
# under //executorch/kernels/... can't depend on this test-only
22-
# target. It's ok to add any //executorch/*/test/... path to this
23-
# list.
24-
"//executorch/runtime/core/exec_aten/util/test/...",
25-
"//executorch/runtime/core/exec_aten/testing_util/test/...",
26-
"//executorch/runtime/core/portable_type/test/...",
27-
"//executorch/kernels/prim_ops/test/...",
28-
"//executorch/kernels/portable/test/...",
29-
"//executorch/kernels/portable/cpu/util/test/...",
30-
"//executorch/kernels/quantized/test/...",
31-
"//executorch/kernels/optimized/test/...",
32-
"//executorch/kernels/test/...",
33-
"//executorch/kernels/fb/custom_ops/...",
34-
"//executorch/runtime/core/test/...",
35-
"//executorch/test/...",
36-
"//executorch/extension/kernel_util/test/...",
37-
"@EXECUTORCH_CLIENTS",
38-
],
19+
visibility = ["PUBLIC"],
3920
compiler_flags = ["-Wno-unneeded-internal-declaration"],
4021
exported_preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [],
4122
exported_deps = [

runtime/core/exec_aten/util/targets.bzl

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ def define_common_targets():
2323
exported_headers = [
2424
"scalar_type_util.h",
2525
],
26-
visibility = [
27-
"//executorch/...",
28-
"@EXECUTORCH_CLIENTS",
29-
],
26+
visibility = ["PUBLIC"],
3027
exported_preprocessor_flags = exported_preprocessor_flags_,
3128
exported_deps = exported_deps_,
3229
exported_external_deps = ["libtorch"] if aten_mode else [],
@@ -42,10 +39,7 @@ def define_common_targets():
4239
"//executorch/runtime/core:core",
4340
"//executorch/runtime/core/portable_type/c10/c10:c10",
4441
],
45-
visibility = [
46-
"//executorch/...",
47-
"@EXECUTORCH_CLIENTS",
48-
],
42+
visibility = ["PUBLIC"],
4943
exported_preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [],
5044
)
5145

@@ -55,10 +49,7 @@ def define_common_targets():
5549
exported_headers = [
5650
"tensor_util.h",
5751
],
58-
visibility = [
59-
"//executorch/...",
60-
"@EXECUTORCH_CLIENTS",
61-
],
52+
visibility = ["PUBLIC"],
6253
exported_preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [],
6354
exported_deps = [
6455
":tensor_dimension_limit",
@@ -84,17 +75,11 @@ def define_common_targets():
8475
"//executorch/runtime/core/exec_aten/util:tensor_dimension_limit",
8576
],
8677
exported_headers = ["tensor_shape_to_c_string.h"],
87-
visibility = [
88-
"//executorch/...",
89-
"@EXECUTORCH_CLIENTS",
90-
],
78+
visibility = ["PUBLIC"],
9179
)
9280

9381
runtime.cxx_library(
9482
name = "tensor_dimension_limit",
9583
exported_headers = ["tensor_dimension_limit.h"],
96-
visibility = [
97-
"//executorch/...",
98-
"@EXECUTORCH_CLIENTS",
99-
],
84+
visibility = ["PUBLIC"],
10085
)

runtime/core/portable_type/c10/c10/targets.bzl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ def define_common_targets():
6161
runtime.cxx_library(
6262
name = "aten_headers_for_executorch",
6363
srcs = [],
64-
visibility = [
65-
"//executorch/kernels/optimized/...",
66-
"//executorch/kernels/portable/cpu/util/...",
67-
"@EXECUTORCH_CLIENTS",
68-
],
64+
visibility = ["PUBLIC"],
6965
# select() on ovr_config//runtime:fbcode does not work
7066
# properly in all cases. I have seen
7167
# //xplat/executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch
@@ -124,10 +120,7 @@ def define_common_targets():
124120
"-DC10_USE_GLOG",
125121
"-DC10_USE_MINIMAL_GLOG",
126122
]),
127-
visibility = [
128-
"//executorch/...",
129-
"@EXECUTORCH_CLIENTS",
130-
],
123+
visibility = ["PUBLIC"],
131124
exported_deps = [
132125
"//executorch/runtime/core/portable_type/c10/torch/headeronly:torch_headeronly",
133126
] + select({
@@ -142,8 +135,5 @@ def define_common_targets():
142135
runtime.cxx_library(
143136
name = "c10",
144137
exported_deps = [":aten_headers_for_executorch"],
145-
visibility = [
146-
"//executorch/...",
147-
"@EXECUTORCH_CLIENTS",
148-
],
138+
visibility = ["PUBLIC"],
149139
)

runtime/core/targets.bzl

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ def define_common_targets():
5050
"result.h",
5151
"span.h",
5252
],
53-
visibility = [
54-
"//executorch/...",
55-
"@EXECUTORCH_CLIENTS",
56-
],
53+
visibility = ["PUBLIC"],
5754
exported_preprocessor_flags = get_core_flags(),
5855
exported_deps = [
5956
"//executorch/runtime/core/portable_type/c10/c10:c10",
@@ -82,10 +79,7 @@ def define_common_targets():
8279
":core",
8380
"//executorch/runtime/core/portable_type/c10/c10:c10",
8481
],
85-
visibility = [
86-
"//executorch/...",
87-
"@EXECUTORCH_CLIENTS",
88-
],
82+
visibility = ["PUBLIC"],
8983
)
9084

9185
for aten_mode in get_aten_mode_options():
@@ -96,10 +90,7 @@ def define_common_targets():
9690
"evalue.h",
9791
],
9892
srcs = ["evalue.cpp"],
99-
visibility = [
100-
"//executorch/...",
101-
"@EXECUTORCH_CLIENTS",
102-
],
93+
visibility = ["PUBLIC"],
10394
exported_deps = [
10495
":core",
10596
":tag",
@@ -114,10 +105,7 @@ def define_common_targets():
114105
"event_tracer_hooks.h",
115106
"event_tracer_hooks_delegate.h",
116107
],
117-
visibility = [
118-
"//executorch/...",
119-
"@EXECUTORCH_CLIENTS",
120-
],
108+
visibility = ["PUBLIC"],
121109
exported_preprocessor_flags = get_event_tracer_flags() + get_sdk_flags(),
122110
exported_deps = [
123111
"//executorch/runtime/platform:platform",
@@ -130,10 +118,7 @@ def define_common_targets():
130118
exported_headers = [
131119
"named_data_map.h",
132120
],
133-
visibility = [
134-
"//executorch/...",
135-
"@EXECUTORCH_CLIENTS",
136-
],
121+
visibility = ["PUBLIC"],
137122
exported_deps = [
138123
":tensor_layout" + aten_suffix,
139124
"//executorch/runtime/core/exec_aten:lib" + aten_suffix,

runtime/core/testing_util/targets.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ def define_common_targets():
1515
exported_headers = [
1616
"error_matchers.h",
1717
],
18-
visibility = [
19-
"//executorch/runtime/core/testing_util/test/...",
20-
"@EXECUTORCH_CLIENTS",
21-
],
18+
visibility = ["PUBLIC"],
2219
exported_external_deps = [
2320
"gmock",
2421
],

runtime/platform/targets.bzl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ def define_common_targets():
8181
":compiler",
8282
":platform_private",
8383
],
84-
visibility = [
85-
"//executorch/...",
86-
"@EXECUTORCH_CLIENTS",
87-
],
84+
visibility = ["PUBLIC"],
8885
# WARNING: using a deprecated API to avoid being built into a shared
8986
# library. In the case of dynamically loading so library we don't want
9087
# it to depend on other so libraries because that way we have to
@@ -110,10 +107,7 @@ def define_common_targets():
110107
"ovr_config//os:macos": ["-DET_USE_LIBDL"],
111108
},
112109
),
113-
visibility = [
114-
"//executorch/...",
115-
"@EXECUTORCH_CLIENTS",
116-
],
110+
visibility = ["PUBLIC"],
117111
)
118112

119113
# Common compiler directives such as 'unlikely' or 'deprecated'
@@ -122,8 +116,5 @@ def define_common_targets():
122116
exported_headers = [
123117
"compiler.h",
124118
],
125-
visibility = [
126-
"//executorch/...",
127-
"@EXECUTORCH_CLIENTS",
128-
],
119+
visibility = ["PUBLIC"],
129120
)

shim_et/xplat/executorch/build/runtime_wrapper.bzl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,7 @@ def _patch_kwargs_common(kwargs):
184184
"""
185185
env.remove_unsupported_kwargs(kwargs)
186186

187-
# Be careful about dependencies on executorch targets for now, so that we
188-
# don't pick up unexpected clients while things are still in flux.
189-
if not kwargs.pop("_is_external_target", False):
190-
for target in kwargs.get("visibility", []):
191-
if not (target == "PUBLIC" or target.startswith("//executorch") or target.startswith("//pytorch/tokenizers") or target.startswith("@")):
192-
fail("Please manage all external visibility using the " +
193-
"EXECUTORCH_CLIENTS list in " +
194-
"//executorch/build/fb/clients.bzl. " +
195-
"Found external visibility target \"{}\".".format(target))
196-
else:
197-
kwargs.pop("_is_external_target", None)
187+
kwargs.pop("_is_external_target", False)
198188

199189
# Convert `[exported_]external_deps` entries into real deps if necessary.
200190
_resolve_external_deps(kwargs)

0 commit comments

Comments
 (0)