-
Notifications
You must be signed in to change notification settings - Fork 3.9k
protoc-gen-grpc-java can't be built with gradle and protobuf 22+ #11475
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
Comments
After a bit more head scratching, I came across this previous attempt: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/54120
Since Alpine now builds protobuf with cmake instead of make as shown in the compile environment setup steps described here, static linking is not an option any longer. Alpine also won't accept a PR that vendors static protobuf together with grpc-java, so my question is now how can I modify I tried modifying the
Which ultimately results in the error:
Is this an issue with different compiler versions or CXXFLAGS specifying C++ standards being applied at the time Cmake is building protobuf? It is trying to link against protobuf 24.4 which would seem to satisfy the requirement for protobuf 21.7+. The change requiring static linking was made 9 years ago when Gradle 2.3 was in use, is dynamic linking still impossible today? |
You might want to glance at #10048 . We haven't been able to update to any absl-based protobuf release for our official binaries. Our Bazel build is working with the newer protobuf.
Static linking is definitely still an option. But overall absl is the issue and makes our build a PITA. I got Linux building locally by hard-coding the huge list of |
Otherwise libprotoc built by CMake hides symbols needed by grpc-java (grpc/grpc-java#11475)
Was looking at this as trying to build protoc-gen-grpc-java in Homebrew for usage on Apple ARM. The latter part of issue appears to be on Protobuf side due to not exposing symbols. Opened a PR that worked for me protocolbuffers/protobuf#19363
pkgconf/pkg-config is probably simplest way to handle extra flags in current build setup. |
Otherwise libprotoc built by CMake hides symbols needed by grpc-java (grpc/grpc-java#11475) --- I wasn't sure if other functions should be exposed, but just added them based on objectivec/names.h where everything is PROTOC_EXPORT. Can restrict to only minimum if preferred (for grpc-java, this would be `ClassName`) Closes #19363 COPYBARA_INTEGRATE_REVIEW=#19363 from cho-m:java-names-protoc-export 1bf84d4 PiperOrigin-RevId: 700381234
I'm trying to package grpc-java 1.66.0 for Alpine Linux. I have modified
compiler/build.gradle
as follows:I'm using the following steps to run the build:
The build seems to succeed, but linking fails with:
But the libraries installed by
protobuf-dev
exist:Can anyone help me resolve this linking issue?
The text was updated successfully, but these errors were encountered: