From 2aa5d3b5193bbff336f82b0daa52a0315f6ab52d Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 10 Jul 2023 18:12:50 +0200 Subject: [PATCH] backport patch to disable useless pkgconfig search At the time, I only backported the fix for https://github.com/apache/arrow/issues/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. --- recipe/meta.yaml | 2 + ...-Use-Visual-Studio-2019-on-AppVeyor-.patch | 5 +- ...elocatable-CMAKE_INSTALL_FULL_LIBDIR.patch | 5 +- ...-find-.pc-files-with-ARROW_BUILD_STA.patch | 119 ++++++++++++++++++ 4 files changed, 123 insertions(+), 8 deletions(-) create mode 100644 recipe/patches/0003-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 0f910c72e..9625c5bf3 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -25,6 +25,8 @@ source: # with the usual relocation treatement and leads to other issues, see #935; # replace with placeholder that allows interested users to fix the file path - patches/0002-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch + # backport apache/arrow#34019 to disable useless pkgconfig search that takes ~15-60min + - patches/0003-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch # ensure cuda_compiler_version_min gets picked up by conda-smithy # [cuda_compiler_version_min == "something"] diff --git a/recipe/patches/0001-ARROW-17433-CI-C-Use-Visual-Studio-2019-on-AppVeyor-.patch b/recipe/patches/0001-ARROW-17433-CI-C-Use-Visual-Studio-2019-on-AppVeyor-.patch index bb68bcb65..e2ab2a125 100644 --- a/recipe/patches/0001-ARROW-17433-CI-C-Use-Visual-Studio-2019-on-AppVeyor-.patch +++ b/recipe/patches/0001-ARROW-17433-CI-C-Use-Visual-Studio-2019-on-AppVeyor-.patch @@ -1,7 +1,7 @@ From b5c94f653d8a80eb4bd5ff41bb1b8d5f230d1ee8 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 25 Aug 2022 15:08:39 +0900 -Subject: [PATCH 1/2] ARROW-17433: [CI][C++] Use Visual Studio 2019 on AppVeyor +Subject: [PATCH 1/3] ARROW-17433: [CI][C++] Use Visual Studio 2019 on AppVeyor (#13903) We can use /external:I for Boost to suppress warnings from Boost @@ -300,6 +300,3 @@ index 650b80f6b..fefabf883 100644 set(FMS_COMPATIBILITY 19.10) else() message(FATAL_ERROR "Unsupported MSVC_VERSION=${MSVC_VERSION}") --- -2.38.1.windows.1 - diff --git a/recipe/patches/0002-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch b/recipe/patches/0002-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch index bee80b9a0..8de8d3d23 100644 --- a/recipe/patches/0002-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch +++ b/recipe/patches/0002-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch @@ -1,7 +1,7 @@ From 58071a1965294d9e1a56cfd9d33b7204cb31d842 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 26 Jan 2023 12:37:02 +1100 -Subject: [PATCH 2/2] don't bake non-relocatable CMAKE_INSTALL_FULL_LIBDIR into +Subject: [PATCH 2/3] don't bake non-relocatable CMAKE_INSTALL_FULL_LIBDIR into gdb-integration --- @@ -21,6 +21,3 @@ index 93dd1297b..b4786e044 100644 set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL TRUE) endif() if(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL) --- -2.38.1.windows.1 - diff --git a/recipe/patches/0003-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch b/recipe/patches/0003-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch new file mode 100644 index 000000000..765718daa --- /dev/null +++ b/recipe/patches/0003-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch @@ -0,0 +1,119 @@ +From 7b511bc64c4b3f9688d710cab3668ff9b9a71eff Mon Sep 17 00:00:00 2001 +From: Sutou Kouhei +Date: Sat, 4 Feb 2023 22:08:54 +0900 +Subject: [PATCH 3/3] GH-33882: [C++] Don't find .pc files with + ARROW_BUILD_STATIC=OFF (#34019) + +Because they are needless and `pkg-config grpc++` is slow. + +Don't find .pc files with `ARROW_BUILD_STATIC=OFF`. + +Yes. + +No. +* Closes: #33882 + +Authored-by: Sutou Kouhei +Signed-off-by: Sutou Kouhei +--- + cpp/cmake_modules/ThirdpartyToolchain.cmake | 62 +++++++++++---------- + 1 file changed, 32 insertions(+), 30 deletions(-) + +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index 5d1da18b7..be9961fc0 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -269,17 +269,19 @@ macro(resolve_dependency DEPENDENCY_NAME) + if(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM" AND ARG_IS_RUNTIME_DEPENDENCY) + provide_find_module(${PACKAGE_NAME}) + list(APPEND ARROW_SYSTEM_DEPENDENCIES ${PACKAGE_NAME}) +- find_package(PkgConfig QUIET) +- 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) +- if(${${ARG_PC_PACKAGE_NAME}_PC_FOUND}) +- string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${ARG_PC_PACKAGE_NAME}") +- endif() +- endforeach() ++ if(ARROW_BUILD_STATIC) ++ find_package(PkgConfig QUIET) ++ 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) ++ if(${${ARG_PC_PACKAGE_NAME}_PC_FOUND}) ++ string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${ARG_PC_PACKAGE_NAME}") ++ endif() ++ endforeach() ++ endif() + endif() + endmacro() + +@@ -1138,18 +1140,12 @@ if(ARROW_WITH_SNAPPY) + TRUE + PC_PACKAGE_NAMES + snappy) +- if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) ++ if(${Snappy_SOURCE} STREQUAL "SYSTEM" ++ AND NOT snappy_PC_FOUND ++ AND ARROW_BUILD_STATIC) + get_target_property(SNAPPY_TYPE ${Snappy_TARGET} TYPE) + if(NOT SNAPPY_TYPE STREQUAL "INTERFACE_LIBRARY") +- get_target_property(SNAPPY_LIB ${Snappy_TARGET} +- IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE}) +- if(NOT SNAPPY_LIB) +- get_target_property(SNAPPY_LIB ${Snappy_TARGET} IMPORTED_LOCATION_RELEASE) +- endif() +- if(NOT SNAPPY_LIB) +- get_target_property(SNAPPY_LIB ${Snappy_TARGET} IMPORTED_LOCATION) +- endif() +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${SNAPPY_LIB}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " $") + endif() + endif() + endif() +@@ -2480,17 +2476,10 @@ if(ARROW_WITH_RE2) + # include -std=c++11. It's not compatible with C source and C++ + # source not uses C++ 11. + resolve_dependency(re2 HAVE_ALT TRUE) +- if(${re2_SOURCE} STREQUAL "SYSTEM") ++ if(${re2_SOURCE} STREQUAL "SYSTEM" AND ARROW_BUILD_STATIC) + get_target_property(RE2_TYPE re2::re2 TYPE) + if(NOT RE2_TYPE STREQUAL "INTERFACE_LIBRARY") +- get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE}) +- if(NOT RE2_LIB) +- get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION_RELEASE) +- endif() +- if(NOT RE2_LIB) +- get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION) +- endif() +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${RE2_LIB}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " $") + endif() + endif() + add_definitions(-DARROW_WITH_RE2) +@@ -2556,6 +2545,19 @@ if(ARROW_WITH_BZ2) + PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") + endif() ++ ++ if(${BZip2_SOURCE} STREQUAL "SYSTEM" ++ AND NOT bzip2_PC_FOUND ++ AND ARROW_BUILD_STATIC) ++ get_target_property(BZIP2_TYPE BZip2::BZip2 TYPE) ++ if(BZIP2_TYPE STREQUAL "INTERFACE_LIBRARY") ++ # Conan ++ string(APPEND ARROW_PC_LIBS_PRIVATE ++ " $>") ++ else() ++ string(APPEND ARROW_PC_LIBS_PRIVATE " $") ++ endif() ++ endif() + endif() + + macro(build_utf8proc)