Skip to content

Erro when build with build Bazel 4.0.0: "ERROR: cc_toolchain does not have mandatory provider 'ProtoInfo'. " #665

@owent

Description

@owent

Describe your environment

OS: Windows
Bazel version: 4.0.0
Branch: main/85d306f124b95c6935ecbd7c0f9e5662f76b9c21

Steps to reproduce

bazel build -- //... //api/test/... //sdk/test/...

What is the expected behavior?

Build completed successfully

What is the actual behavior?

ERROR: C:/users/owent/_bazel_owent/dldhg2d7/external/com_google_protobuf/BUILD:1006:21: in proto_lang_toolchain rule @com_google_protobuf//:cc_toolchain: '@com_google_protobuf//:cc_toolchain' does not have mandatory provider 'ProtoInfo'.
ERROR: Analysis of target '//exporters/otlp:recordable_test' failed; build aborted: Analysis of target '@com_google_protobuf//:cc_toolchain' failed
INFO: Elapsed time: 26.557s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (12 packages loaded, 1930 targets configured)
    Fetching @zlib; fetching
    Fetching C:/users/owent/_bazel_owent/dldhg2d7/external/zlib; Extracting C:/users/owent/_bazel_owent/dldhg2d7/external/zlib/temp6152700889165709447/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz
    Fetching @com_github_cares_cares; fetching
    Fetching C:/users/owent/_bazel_owent/dldhg2d7/external/com_github_cares_cares; Extracting C:/users/owent/_bazel_owent/dldhg2d7/external/com_github_cares_cares/temp2392465294235958141/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz
    Fetching @com_google_absl; fetching
    Fetching @boringssl; fetching

Additional context

bazelbuild/bazel#12887 and bazelbuild/bazel#11694 may be helpful for this problem.
It works again after I upgrade gRPC to 1.36.4(gRPC 1.32.0 is the first version to use protobuf 3.13.0 or upper) and remove load("@upb//bazel:build_defs.bzl", "bazel_version_repository") and bazel_version_repository(name = "upb_bazel_version") from the WORKSPACE .
I'm not sure if I should create a PR to update gRPC and remove upb?

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions