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
grpc fails to build #4508
Comments
I can't reproduce this on my Linux machine (KDE Neon 5.19.4 - based on Ubuntu 20.04). I am building against libgrpc++-dev 1.16.1-1ubuntu5, which I strongly assume to be grpc 1.16.1 However according to gRPC's README we have to link against it in a different way... 👀 |
The way to link against gRPC seems to have changed with v1.27: grpc/grpc@48fa247#diff-d4f971a0f0d8b1c128417b6a51c7f6cc The commit message indicates though that this behavior should have been used before as well but only since 1.28 it seems to be a problem 🤔 |
There seem to be issues with newer versions of gRPC with the way we used to link against it. Therefore this commit adapts the link behavior to how it is suggested in the gRPC's README. Fixes mumble-voip#4508
There seem to be issues with newer versions of gRPC with the way we used to link against it. Therefore this commit adapts the link behavior to how it is suggested in the gRPC's README. Fixes mumble-voip#4508
@Lartza: Please try the patch below, I assume it will fix this issue. diff --git a/src/murmur/CMakeLists.txt b/src/murmur/CMakeLists.txt
index 4401bbb5a..babf967d8 100644
--- a/src/murmur/CMakeLists.txt
+++ b/src/murmur/CMakeLists.txt
@@ -190,7 +190,7 @@ if(dbus AND NOT WIN32 AND NOT APPLE)
endif()
if(grpc)
- find_pkg(GRPC REQUIRED)
+ find_pkg(gRPC REQUIRED)
protobuf_generate(LANGUAGE cpp TARGET murmur PROTOS ${GRPC_FILE} OUT_VAR BUILT_GRPC_FILES)
|
For me at least this does indeed fix the issue. |
That's very interesting. But I guess the solution then is to simply pass multiple name variants to |
I did notice with GRPC it says "GRPC found" and gRPC it says "gRPC found | Version: 1.30.2" |
On my system if I use Maybe this is due to the different versions. @Lartza do you happen to have another version of gRPC installed on your system? |
Don't believe I do, "grpc" is the only distro package installed and this is everything relevant mlocate finds https://gist.github.com/Lartza/d59c1c360898a03c7e9f4f7a1b769436 |
According to the gRPC Hello world example "gRPC" should be the correct spelling, for both versions. 1.16.1: https://github.com/grpc/grpc/blob/v1.16.1/examples/cpp/helloworld/CMakeLists.txt#L73 @Krzmbrzl: Please check if the patch below works on your system. Feel free to add it to #4509 if you give credits in the commit message. diff --git a/src/murmur/CMakeLists.txt b/src/murmur/CMakeLists.txt
index 4401bbb5..139e46eb 100644
--- a/src/murmur/CMakeLists.txt
+++ b/src/murmur/CMakeLists.txt
@@ -190,7 +190,7 @@ if(dbus AND NOT WIN32 AND NOT APPLE)
endif()
if(grpc)
- find_pkg(GRPC REQUIRED)
+ find_pkg("gRPC;GRPC" REQUIRED)
protobuf_generate(LANGUAGE cpp TARGET murmur PROTOS ${GRPC_FILE} OUT_VAR BUILT_GRPC_FILES)
@@ -228,6 +228,11 @@ if(grpc)
VERBATIM
)
+ # Disable warnings for the generated source files
+ foreach(CURRENT_FILE IN LISTS GRPC_GENERATED_FILES)
+ set_source_files_properties("${CURRENT_FILE}" PROPERTIES COMPILE_FLAGS "-w")
+ endforeach()
+
add_custom_target(generate-grpc-files
DEPENDS
"MurmurRPC.proto.Wrapper.cpp"
|
https://github.com/mumble-voip/mumble/blob/master/cmake/FindModules/FindGRPC.cmake was added because some packages currently don't provide the CMake module. Debian: https://packages.debian.org/bullseye/amd64/libgrpc-dev/filelist However, the module we have in the repository appears to cause issues on certain distributions. @radioactiveman I confirm your patch works on Debian. |
@radioactiveman yep this also works on my system - thank you very much!
Ah yes - that was why we use I will update the respective PR accordingly 👍 |
There seem to be issues with newer versions of gRPC with the way we used to link against it. Therefore this commit adapts the link behavior to how it is suggested in the gRPC's README. Fixes mumble-voip#4508
There seem to be issues with newer versions of gRPC with the way we used to link against it. Therefore this commit adapts the link behavior to how it is suggested in the gRPC's README. Fixes mumble-voip#4508
We are using a custom FindGRPC.cmake script in order to locate the gRPC targets as not all distribution variants of gRPC include the respective cmake support. Those that do however will use "gRPC" (note the lowercase "g") as the target's name and therefore our current way of searching for it via find_pkg won't find them. The solution is to first look for "gRPC" and only if that fails, check for "GRPC". This way the official target "gRPC" should be found and preferred if present. Fixes mumble-voip#4508 Co-Authored-By: Thomas Lange <thomas-lange2@gmx.de>
We are using a custom FindGRPC.cmake script in order to locate the gRPC targets as not all distribution variants of gRPC include the respective cmake support. Those that do however will use "gRPC" (note the lowercase "g") as the target's name and therefore our current way of searching for it via find_pkg won't find them. The solution is to first look for "gRPC" and only if that fails, check for "GRPC". This way the official target "gRPC" should be found and preferred if present. Fixes #4508
Describe the bug
Building with grpc fails with linking errors
Steps to Reproduce
Steps to reproduce the behavior:
Expected behavior
Murmur builds successfully
Additional context
Arch Linux, grpc 1.30.2
The text was updated successfully, but these errors were encountered: