Skip to content

Commit

Permalink
backport patch to disable useless pkgconfig search
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
h-vetinari committed Jul 10, 2023
1 parent 4090b86 commit 2aa5d3b
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 8 deletions.
2 changes: 2 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b5c94f653d8a80eb4bd5ff41bb1b8d5f230d1ee8 Mon Sep 17 00:00:00 2001
From: Sutou Kouhei <[email protected]>
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
Expand Down Expand Up @@ -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

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 58071a1965294d9e1a56cfd9d33b7204cb31d842 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
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

---
Expand All @@ -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

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
From 7b511bc64c4b3f9688d710cab3668ff9b9a71eff Mon Sep 17 00:00:00 2001
From: Sutou Kouhei <[email protected]>
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 <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
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 " $<TARGET_FILE:${Snappy_TARGET}>")
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 " $<TARGET_FILE:re2::re2>")
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
+ " $<TARGET_FILE:CONAN_LIB::bzip2_bz2_$<CONFIG>>")
+ else()
+ string(APPEND ARROW_PC_LIBS_PRIVATE " $<TARGET_FILE:BZip2::BZip2>")
+ endif()
+ endif()
endif()

macro(build_utf8proc)

0 comments on commit 2aa5d3b

Please sign in to comment.