Skip to content

Remove dependency to @com_google_protobuf//src/google/protobuf/compiler:retention without visibility #37669

@mering

Description

@mering

Description:

Envoy API depends on the target @com_google_protobuf//src/google/protobuf/compiler:retention which does not grant visibility outside of Protobuf itself:

"@com_google_protobuf//src/google/protobuf/compiler:retention",

In the WORKSPACE model, this is patched out via

envoy/bazel/protobuf.patch

Lines 116 to 128 in d1f6f3c

diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel
index 3f5624d5f..e194b172f 100644
--- a/src/google/protobuf/compiler/BUILD.bazel
+++ b/src/google/protobuf/compiler/BUILD.bazel
@@ -517,7 +517,7 @@ cc_library(
srcs = ["retention.cc"],
hdrs = ["retention.h"],
strip_include_prefix = "/src",
- visibility = ["//src/google/protobuf:__subpackages__"],
+ visibility = ["//visibility:public"],
deps = [
"//src/google/protobuf",
"//src/google/protobuf:port",

Downstream patches are not allowed with Bzlmod as this breaks automatic dependency resolution (see #34355 for a WIP PR adding Bzlmod support). We need to find a way to make envoy compatible with upstream Protobuf without patches or upstream necessary patches.

This is blocking addition of Bzlmod support. Bzlmod support was introduced as experimental in Bazel 5, fully introduced in Bazel 6, defaulted in Bazel 7, WORKSPACE support is disabled by default in Bazel 8 and will be removed in Bazel 9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bazelbugstalestalebot believes this issue/PR has not been touched recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions