-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[C++][CMake] gRPCAlt takes 15 minutes on linux #33882
Comments
Hmm. It's strange. It's happen in https://github.com/apache/arrow/blob/master/cpp/cmake_modules/ThirdpartyToolchain.cmake#L288-L305 . Can we add debug logs ( |
That code is really hard to understand (for me). I'm happy to try with a patch, but not sure what/where. Just now I got worried because on linux, pkg-config claims to find a static grpc++ somehwere, though the build coming in through conda-forge definitely does not contain any static libs. However, it looks like that's just the log-message being unaware of which flavour of dynamic/static is actually being found by pkg-config. Can we just disable the whole pkg-config search completely? Our builds have CMake metadata, and |
Could you try this? diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 4310d6018b..5a88900fe9 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -286,14 +286,17 @@ macro(resolve_dependency DEPENDENCY_NAME)
endif()
if(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM" AND ARG_IS_RUNTIME_DEPENDENCY)
provide_find_module(${PACKAGE_NAME} "Arrow")
+ message(STATUS "Before find_package(PkgConfig)")
list(APPEND ARROW_SYSTEM_DEPENDENCIES ${PACKAGE_NAME})
find_package(PkgConfig QUIET)
+ message(STATUS "After find_package(PkgConfig)")
foreach(ARG_PC_PACKAGE_NAME ${ARG_PC_PACKAGE_NAMES})
pkg_check_modules(${ARG_PC_PACKAGE_NAME}_PC
${ARG_PC_PACKAGE_NAME}
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
QUIET)
+ message(STATUS "After pkg_check_modules(${ARG_PC_PACKAGE_NAME})")
if(${${ARG_PC_PACKAGE_NAME}_PC_FOUND})
message(STATUS "Using pkg-config package for ${ARG_PC_PACKAGE_NAME} for static link"
)
We can add an option to disable pkg-config support. But if we disable pkg-config support, conda users can't find Apache Arrow C++ by pkg-config. I'm not familiar with conda but I think that there are users who use pkg-config to find external packages. |
Done in conda-forge/arrow-cpp-feedstock#941; I'll get back with timing infos as soon as the CI completes.
AFAIU there's a difference between looking for pkgconfig metadata of other packages (not necessary for us) and producing it for arrow's consumers (that would still be possible). It might be all bundled up in the |
Here are the timings including the debug statements from the faster agent:
|
Thanks. I noticed that OK. We can disable pkg-config search only with |
Yes, it does (and has for a long time, so all the recent runs I looked at would have had it). |
So the results from #34019 look great, now takes <1 sec rather than 15min - thanks a lot! :)
PS: The hunk for the changes around |
) ### Rationale for this change Because they are needless and `pkg-config grpc++` is slow. ### What changes are included in this PR? Don't find .pc files with `ARROW_BUILD_STATIC=OFF`. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: #33882 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Thanks. I've merged it. |
apache#34019) ### Rationale for this change Because they are needless and `pkg-config grpc++` is slow. ### What changes are included in this PR? Don't find .pc files with `ARROW_BUILD_STATIC=OFF`. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#33882 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
apache#34019) ### Rationale for this change Because they are needless and `pkg-config grpc++` is slow. ### What changes are included in this PR? Don't find .pc files with `ARROW_BUILD_STATIC=OFF`. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#33882 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
apache#34019) ### Rationale for this change Because they are needless and `pkg-config grpc++` is slow. ### What changes are included in this PR? Don't find .pc files with `ARROW_BUILD_STATIC=OFF`. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#33882 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
At the time, I only backported the fix for apache/arrow#33882 to 11.0.x (because it didn't apply cleanly to 10.0.x or earlier), but now that the time spent for that has ballooned to almost an hour, fix the conflicts, to avoid wasting massive amounts of CI time on this branch.
Describe the bug, including details regarding any error messages, version, and platform.
In conda-forge, running the code related to (or around)
gRPCAlt
is near-instantaneous on osx & windows,while on linux it takes 15 minutes
This flew under the radar a bit because the linux builds are generally the fastest of the bunch, but it still looks like a massive waste of time (almost a third of the build time).
It happens on all versions 7-10; I didn't test earlier versions, and haven't tested 11 yet.
Component(s)
Continuous Integration
The text was updated successfully, but these errors were encountered: