Skip to content
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

WIP: test upstream patch for disabling pkgconfig search #956

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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/0001-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch
# disable useless pkgconfig search that takes ~15min
- patches/0002-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch
# testing-submodule not part of release tarball
- git_url: https://github.com/apache/arrow-testing.git
git_rev: 00c483283433b4c02cb811f260dbe35414c806a4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7f1350d76bf71a8123cf78abe18ddb5876a7ca80 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Thu, 26 Jan 2023 12:37:02 +1100
Subject: [PATCH] don't bake non-relocatable CMAKE_INSTALL_FULL_LIBDIR into
Subject: [PATCH 1/2] don't bake non-relocatable CMAKE_INSTALL_FULL_LIBDIR into
gdb-integration

---
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
From 010a5584a38fa5b7ea21b504ea644fe2887f784f Mon Sep 17 00:00:00 2001
From: Sutou Kouhei <[email protected]>
Date: Fri, 3 Feb 2023 16:37:18 +0900
Subject: [PATCH 2/2] GH-33882: [C++] Don't find .pc files with
ARROW_BUILD_STATIC=OFF

Because they are needless.
---
cpp/cmake_modules/ThirdpartyToolchain.cmake | 80 +++++++++------------
1 file changed, 34 insertions(+), 46 deletions(-)

diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 3eda538fb..edca08763 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -287,22 +287,24 @@ macro(resolve_dependency DEPENDENCY_NAME)
if(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM" AND ARG_IS_RUNTIME_DEPENDENCY)
provide_find_module(${PACKAGE_NAME} "Arrow")
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})
- message(STATUS "Using pkg-config package for ${ARG_PC_PACKAGE_NAME} for static link"
- )
- string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${ARG_PC_PACKAGE_NAME}")
- else()
- message(STATUS "pkg-config package for ${ARG_PC_PACKAGE_NAME} for static link isn't found"
- )
- 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})
+ message(STATUS "Using pkg-config package for ${ARG_PC_PACKAGE_NAME} for static link"
+ )
+ string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${ARG_PC_PACKAGE_NAME}")
+ else()
+ message(STATUS "pkg-config package for ${ARG_PC_PACKAGE_NAME} for static link isn't found"
+ )
+ endif()
+ endforeach()
+ endif()
endif()
endmacro()

@@ -1189,21 +1191,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_NOCONFIG)
- 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()
@@ -2504,17 +2497,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)
@@ -4765,15 +4751,17 @@ if(ARROW_S3)
message(STATUS "Found AWS SDK headers: ${AWSSDK_INCLUDE_DIR}")
message(STATUS "Found AWS SDK libraries: ${AWSSDK_LINK_LIBRARIES}")

- if(${AWSSDK_SOURCE} STREQUAL "SYSTEM")
- foreach(AWSSDK_LINK_LIBRARY ${AWSSDK_LINK_LIBRARIES})
- string(APPEND ARROW_PC_LIBS_PRIVATE " $<TARGET_FILE:${AWSSDK_LINK_LIBRARY}>")
- endforeach()
- endif()
- if(UNIX)
- string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl")
+ if(ARROW_BUILD_STATIC)
+ if(${AWSSDK_SOURCE} STREQUAL "SYSTEM")
+ foreach(AWSSDK_LINK_LIBRARY ${AWSSDK_LINK_LIBRARIES})
+ string(APPEND ARROW_PC_LIBS_PRIVATE " $<TARGET_FILE:${AWSSDK_LINK_LIBRARY}>")
+ endforeach()
+ endif()
+ if(UNIX)
+ string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl")
+ endif()
+ string(APPEND ARROW_PC_REQUIRES_PRIVATE " openssl")
endif()
- string(APPEND ARROW_PC_REQUIRES_PRIVATE " openssl")

if(APPLE)
# CoreFoundation's path is hardcoded in the CMake files provided by
--
2.38.1.windows.1