-
Notifications
You must be signed in to change notification settings - Fork 374
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
Upgrading to grpc 1.39.0 makes our cmake-install
build too slow
#7052
Comments
@veblush FYI |
We see this in a docker image w/ the following info:
|
I just discovered that fedora uses |
I suspect the reason for the slowness is that grpc moved a bunch of linker flags from the pkg-config grpc 1.38.1 $ cat /usr/local/lib/pkgconfig/grpc++.pc
prefix=/usr/local
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: gRPC++
Description: C++ wrapper for gRPC
Version: 1.35.0
Cflags: -I${includedir}
Requires: grpc
Libs: -L${libdir} -lgrpc++ -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_exponential_biased -labsl_hash -labsl_city -labsl_statusor -labsl_bad_variant_access -labsl_status -labsl_cord -labsl_str_format_internal -labsl_synchronization -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_stacktrace -labsl_debugging_internal -labsl_malloc_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_bad_optional_access -labsl_raw_logging_internal -labsl_log_severity
Libs.private: grpc 1.39.0 $ cat /usr/local/lib/pkgconfig/grpc++.pc
prefix=/usr/local
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: gRPC++
Description: C++ wrapper for gRPC
Version: 1.39.0
Cflags: -I${includedir}
Requires: grpc absl_base absl_bind_front absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time
Libs: -L${libdir} -lgrpc++
Libs.private: NOTE: I do not think that this is a gRPC bug. But it may have exposed a bug, or inefficiency, in the pkg-config implementation where it's just slow on packages with lots of "requires" libraries. |
FWIW, here's the gRPC PR that introduced this change: grpc/grpc#25840 AFAICT, gRPC seems to be using pkg-config correctly. I don't see anything wrong that gRPC is doing wrt pkg-config. This just may be a bug or limitation of pkg-config itself.
At this point, I'm suspecting that pkg-config simply does not scale well. |
@derekmauro and @dinor7c JFYI Summary: Cloud C++ upgraded to grpc 1.39.0 and our builds that use |
Fedora 34 by default uses docker:fedora-34$ time pkgconf google_cloud_cpp_grpc_utils --libs-only-l --static
...
real 0m5.019s I compiled docker:fedora-34$ time ./pkg-config google_cloud_cpp_grpc_utils --libs-only-l --static
...
real 0m0.226s |
Fixes: googleapis#7052 This avoids Fedora's `pkgconf` (a drop-in replacement for `pkg-config`) because it's too slow when dealing with `.pc` files with lots of `Requires:` deps, which we have with Abseil. Instead, we use the normal `pkg-config` binary, which seems to work better. After this PR, we should be able to upgrade to gRPC 1.39.0 (`git revert ba41d5a`)
Fixes: #7052 This avoids Fedora's `pkgconf` (a drop-in replacement for `pkg-config`) because it's too slow when dealing with `.pc` files with lots of `Requires:` deps, which we have with Abseil. Instead, we use the normal `pkg-config` binary, which seems to work better. After this PR, we should be able to upgrade to gRPC 1.39.0 (`git revert ba41d5a`)
Step #3: GCB: https://console.cloud.google.com/cloud-build/builds;region=us-east1/16a86463-87c8-4b20-ae98-bc8913b3de7a;tab=detail?project=cloud-cpp-testing-resources
Step #3: Raw: https://storage.googleapis.com/cloud-cpp-community-publiclogs/logs/google-cloud-cpp/7046/2fcd9ef25cf6c6221ea8af73def9e9d0ebe05ea5/fedora-34-cmake-install/log-16a86463-87c8-4b20-ae98-bc8913b3de7a.txt
We upgraded grpc from 1.38.1 to 1.39.0 and our
cmake-install
build became unusably slow, so we rolled it back. To roll this change forwardgit revert ba41d5a99818922b09eee5da148786c1d68c17f5
(ba41d5a)The slow line is:
google-cloud-cpp/ci/verify_deprecated_targets/CMakeLists.txt
Line 79 in 727bc4f
The line is slow when checking a module that links with grpc, like
google_cloud_cpp_grpc_utils
I suspect there may be some change in this version of grpc to its pkg-config files. Maybe it's also exposing a bug in
pkg-config
itself, maybe similar to #6846NOTE: We need to figure this out because we need to be able to upgrade gRPC
The text was updated successfully, but these errors were encountered: