Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] grpc/1.67.1: Protobuf dependency doesn't match GRPC expected version numbers #26238

Open
pandorazboxx opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pandorazboxx
Copy link

Description

I'm using a separate container in my build process to auto-generate the proto and rpc headers. GRPC is installed exactly as it's described on the grpc getting started page for c++. I matched the version of GRPC to run the header generation, to the version of GRPC I'm pulling from conancenter for my project's use of grpc as a library dependency. But when I try to build with the latest version of GRPC (v1.67.1 at this time) I get the following errors in my build process:

 Protobuf C++ gencode is built with an incompatible version of
 Protobuf C++ headers/runtime. See
 https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp

So, then that site says that you cannot generate headers and have your build use a different version, even if the Major.Minor are matching. It has to be the exact same version.

Then I looked into the version that is built into the install from grpc and it is protoc v27.2, which looks like it is commit 63def39. Which translates to v5.27.2. When I checked the GRPC recipe on conancenter the dependency is on protobuf/5.27.0.

It looks like protobuf doesn't have a library newer than 5.27.0 in their recipes. So I may be putting this bug in the wrong location, but I think if GRPC's stance is that the cpp runtime must match between systems, then when the version of the grpc library in conan is updated, we should ensure that the protobuf library matches the version being installed by GRPC.

I have a couple of potential workarounds. I can go back to an older version of GRPC that has been working for me in both my generation of the headers and the conan package that I use to build my project. I can modify the protobuf and grpc recipes to call out specific versions that I need and rebuild those recipes locally or on my own conan repo. Or I can install GRPC into my build environment instead of using conan for GRPC (but I would prefer to keep using conan).

I'm thinking the proper thing here to do is to get the protobuf conan package updated to match the version that's built into the specific version of GRPC.

I also played around a little and tried to match a few different GRPC conan packages to the install from GRPC's github and the same problem exists on grpc/1.65.0. It says that it has a dependency on protobuf/5.27.0, but the install from GRPC's github installs 26.1 (or 5.26.1).

Or maybe my workflow is all kinds of wrong and I'm causing my own problems, but my thought was, we have proto files defined. I use a container with GRPC installed to generate the headers I need to build with cmake. Copy those headers into my project as part of my build script. Then I include GRPC (via conan) in my build environment to use those headers.

Package and Environment Details

  • Package Name/Version: grpc/1.67.1
  • Operating System+version: Linux Ubuntu 22.04
  • Compiler+version: GCC 11
  • Docker image: ubuntu:22.04
  • Conan version: conan 2.8.0
  • Python version: Python 3.10.12

Conan profile

[settings]
arch=armv8
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

Steps to reproduce

conan install --requires grpc/1.67.1 --build=missing

Logs

Click to expand log
 16 | #error "Protobuf C++ gencode is built with an incompatible version of"
      |  ^~~~~
/builds/<filename>.pb.h:17:2: error: #error "Protobuf C++ headers/runtime. See"
   17 | #error "Protobuf C++ headers/runtime. See"
      |  ^~~~~
/builds/<filename>.pb.h:18:2: error: #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
   18 | #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
      |  ^~~~~
@pandorazboxx pandorazboxx added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant