Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

rules_proto is broken with grpc 1.55+ #178

@jasonqsong

Description

@jasonqsong

Error

ERROR: /home/nagi/.cache/bazel/_bazel_nagi/aa4b8136c93fe278edb3dd1fe70e4b47/external/upb/BUILD:517:28: no such target '@com_google_protobuf//:descriptor_proto_srcs': target 'descriptor_proto_srcs' not declared in package '' defined by /home/nagi/.cache/bazel/_bazel_nagi/aa4b8136c93fe278edb3dd1fe70e4b47/external/com_google_protobuf/BUILD (Tip: use query "@com_google_protobuf//:*" to see all the targets in that package) and referenced by '@upb//:gen_descriptor_upb_proto_stage1'

Root cause

grpc 1.55+ uses protobuf 22+, which brings incompatible changes.

rules_proto is still stick to protobuf 21

Verified

Start with https://github.com/arcticmatt/grpc_getting_started

Test with

$ bazel build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //:greeter_server

WORKSPACE (failed)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_proto",
    strip_prefix = "rules_proto-5.3.0-21.7",
    urls = [
        "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
    ],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()

http_archive(
    name = "com_github_grpc_grpc",
    urls = [
        "https://github.com/grpc/grpc/archive/v1.55.3.tar.gz",
    ],
    strip_prefix = "grpc-1.55.3",
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

WORKSPACE (success)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_proto",
    strip_prefix = "rules_proto-5.3.0-21.7",
    urls = [
        "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
    ],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()

http_archive(
    name = "com_github_grpc_grpc",
    urls = [
        "https://github.com/grpc/grpc/archive/v1.54.3.tar.gz",
    ],
    strip_prefix = "grpc-1.54.3",
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering to work on this, but happy to review a PR. (No assignee)help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions