diff --git a/shim_et/xplat/executorch/build/runtime_wrapper.bzl b/shim_et/xplat/executorch/build/runtime_wrapper.bzl index 79bc6c7e699..4060746426f 100644 --- a/shim_et/xplat/executorch/build/runtime_wrapper.bzl +++ b/shim_et/xplat/executorch/build/runtime_wrapper.bzl @@ -187,6 +187,9 @@ def _patch_kwargs_common(kwargs): for dep_type in ("deps", "exported_deps"): env.patch_deps(kwargs, dep_type) + if "visibility" not in kwargs: + kwargs["visibility"] = ["//executorch/..."] + # Patch up references to "//executorch/..." in lists of build targets, # if necessary. use_static_deps = kwargs.pop("use_static_deps", False) @@ -202,10 +205,6 @@ def _patch_kwargs_common(kwargs): function = native.partial(_patch_executorch_references, use_static_deps = use_static_deps), ) - # Make all targets private by default, like in xplat. - if "visibility" not in kwargs: - kwargs["visibility"] = [] - # If we see certain strings in the "visibility" list, expand them. if "@EXECUTORCH_CLIENTS" in kwargs["visibility"]: # See env.executorch_clients for this list.