Skip to content

Commit b3f97aa

Browse files
authored
Default ExecuTorch targets to ExecuTorch-wide Buck visibility (#8969)
IMO, Buck visibility is just inverse deps. We should trust that people have a good reason to add deps rather than attempt to police them and require double entry in both deps and visibility, especially since we seem to be committed to APIs by default in OSS anyway. Specific motivation is that #8712 would otherwise have to ad-hoc slap ExecuTorch-wide visibility on a lot of targets, but I've held this view for a long time. Differential Revision: D70647462
1 parent bb5d21c commit b3f97aa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

shim_et/xplat/executorch/build/runtime_wrapper.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ def _patch_kwargs_common(kwargs):
187187
for dep_type in ("deps", "exported_deps"):
188188
env.patch_deps(kwargs, dep_type)
189189

190+
if "visibility" not in kwargs:
191+
kwargs["visibility"] = ["//executorch/..."]
192+
190193
# Patch up references to "//executorch/..." in lists of build targets,
191194
# if necessary.
192195
use_static_deps = kwargs.pop("use_static_deps", False)
@@ -202,10 +205,6 @@ def _patch_kwargs_common(kwargs):
202205
function = native.partial(_patch_executorch_references, use_static_deps = use_static_deps),
203206
)
204207

205-
# Make all targets private by default, like in xplat.
206-
if "visibility" not in kwargs:
207-
kwargs["visibility"] = []
208-
209208
# If we see certain strings in the "visibility" list, expand them.
210209
if "@EXECUTORCH_CLIENTS" in kwargs["visibility"]:
211210
# See env.executorch_clients for this list.

0 commit comments

Comments
 (0)