From bc526a22bf68afdcc45646bf83e3f97a891cbf93 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 2 Jul 2023 10:54:31 +1100 Subject: [PATCH 1/7] disable pytorch/tensorflow as test-deps If we're ever in a situation where pytorch/tensorflow can be rebuilt for a new migration right away, we should readd these. --- recipe/meta.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8dead6fa8..e644862f7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -362,10 +362,10 @@ outputs: # see https://github.com/conda-forge/arrow-cpp-feedstock/issues/1016 - pandas <2 - scipy - # not all OSes/arches available in conda-forge - - pytorch * # [unix and not ppc64le] - # not yet rebuilt for libabseil 20230125 - # - tensorflow # [unix and x86_64 and py<311] + # these are generally (far) behind on migrating abseil/grpc/protobuf, + # and using them as test dependencies blocks the migrator unnecessarily + # - pytorch + # - tensorflow # we're not building java bindings # - jpype1 # doesn't get picked up correctly From 2332e35c24a38df32bcb499291d9c5bd514dd274 Mon Sep 17 00:00:00 2001 From: regro-cf-autotick-bot <36490558+regro-cf-autotick-bot@users.noreply.github.com> Date: Mon, 3 Jul 2023 11:18:29 +0000 Subject: [PATCH 2/7] Rebuild for libprotobuf4233_libgrpc156 --- .../migrations/libprotobuf4233_libgrpc156.yaml | 11 +++++++++++ recipe/meta.yaml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .ci_support/migrations/libprotobuf4233_libgrpc156.yaml diff --git a/.ci_support/migrations/libprotobuf4233_libgrpc156.yaml b/.ci_support/migrations/libprotobuf4233_libgrpc156.yaml new file mode 100644 index 000000000..5fd03406b --- /dev/null +++ b/.ci_support/migrations/libprotobuf4233_libgrpc156.yaml @@ -0,0 +1,11 @@ +__migrator: + build_number: 1 + kind: version + migration_number: 1 +libgrpc: +- '1.54' +- '1.56' +libprotobuf: +- '3.21' +- '4.23.3' +migrator_ts: 1688154716.9176981 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e644862f7..71e1dcec7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -35,7 +35,7 @@ source: folder: testing build: - number: 32 + number: 33 # for cuda support, building with one version is enough to be compatible with # all later versions, since arrow is only using libcuda, and not libcudart. skip: true # [cuda_compiler_version not in ("None", cuda_compiler_version_min)] From fdf88fd6abef2eadbe36b8d74d733fb2a26e5979 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 10 Jul 2023 11:47:39 +0200 Subject: [PATCH 3/7] ensure pyarrow can depend on libarrow for different protobufs --- recipe/meta.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 71e1dcec7..c77b02b4d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -210,6 +210,8 @@ outputs: requirements: host: - {{ pin_subpackage('libarrow', exact=True) }} + # avoid wrappers for different builds colliding due to identical hashes + - libprotobuf run: - {{ pin_subpackage('libarrow', exact=True) }} test: @@ -245,7 +247,9 @@ outputs: - cmake - ninja host: - - {{ pin_subpackage('libarrow', exact=True) }} + # we're building for two protobuf versions, cannot pin exactly + # - {{ pin_subpackage('libarrow', exact=True) }} + - libarrow ={{ version }}=*_{{ PKG_BUILDNUM }}_{{ build_ext }} - clangdev {{ llvm_version }} - llvmdev {{ llvm_version }} - cython @@ -255,7 +259,8 @@ outputs: - setuptools - setuptools_scm run: - - {{ pin_subpackage('libarrow', exact=True) }} + # - {{ pin_subpackage('libarrow', exact=True) }} + - libarrow ={{ version }}=*_{{ PKG_BUILDNUM }}_{{ build_ext }} - {{ pin_compatible('numpy') }} - python run_constrained: From f8b897249a382e0e484d275ead776c3f1dd9982c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 10 Jul 2023 12:11:10 +0200 Subject: [PATCH 4/7] MNT: Re-rendered with conda-build 3.25.0, conda-smithy 3.24.0, and conda-forge-pinning 2023.07.10.04.32.37 --- .azure-pipelines/azure-pipelines-win.yml | 5 +++- .../linux_64_cuda_compiler_version10.2.yaml | 2 ++ .../linux_64_cuda_compiler_versionNone.yaml | 2 ++ ...nux_aarch64_cuda_compiler_version11.2.yaml | 2 ++ ...nux_aarch64_cuda_compiler_versionNone.yaml | 2 ++ ...nux_ppc64le_cuda_compiler_version11.2.yaml | 2 ++ ...nux_ppc64le_cuda_compiler_versionNone.yaml | 2 ++ .ci_support/osx_64_.yaml | 2 ++ .ci_support/osx_arm64_.yaml | 2 ++ .../win_64_cuda_compiler_version10.2.yaml | 2 ++ .../win_64_cuda_compiler_versionNone.yaml | 2 ++ .scripts/run_osx_build.sh | 10 +++---- README.md | 27 +++++++++++-------- 13 files changed, 45 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 743b4a910..c091f43e9 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -63,7 +63,10 @@ jobs: if EXIST LICENSE.txt ( copy LICENSE.txt "recipe\\recipe-scripts-license.txt" ) - conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables + if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) + conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% displayName: Build recipe env: PYTHONUNBUFFERED: 1 diff --git a/.ci_support/linux_64_cuda_compiler_version10.2.yaml b/.ci_support/linux_64_cuda_compiler_version10.2.yaml index 98f98b20b..4403a295a 100644 --- a/.ci_support/linux_64_cuda_compiler_version10.2.yaml +++ b/.ci_support/linux_64_cuda_compiler_version10.2.yaml @@ -36,8 +36,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/linux_64_cuda_compiler_versionNone.yaml b/.ci_support/linux_64_cuda_compiler_versionNone.yaml index c0e8fc85a..11b231ce6 100644 --- a/.ci_support/linux_64_cuda_compiler_versionNone.yaml +++ b/.ci_support/linux_64_cuda_compiler_versionNone.yaml @@ -36,8 +36,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/linux_aarch64_cuda_compiler_version11.2.yaml b/.ci_support/linux_aarch64_cuda_compiler_version11.2.yaml index 410ba3155..1677b0356 100644 --- a/.ci_support/linux_aarch64_cuda_compiler_version11.2.yaml +++ b/.ci_support/linux_aarch64_cuda_compiler_version11.2.yaml @@ -40,8 +40,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/linux_aarch64_cuda_compiler_versionNone.yaml b/.ci_support/linux_aarch64_cuda_compiler_versionNone.yaml index e02c30bb5..88fdf1254 100644 --- a/.ci_support/linux_aarch64_cuda_compiler_versionNone.yaml +++ b/.ci_support/linux_aarch64_cuda_compiler_versionNone.yaml @@ -40,8 +40,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/linux_ppc64le_cuda_compiler_version11.2.yaml b/.ci_support/linux_ppc64le_cuda_compiler_version11.2.yaml index 6edf9fa18..3585db7b9 100644 --- a/.ci_support/linux_ppc64le_cuda_compiler_version11.2.yaml +++ b/.ci_support/linux_ppc64le_cuda_compiler_version11.2.yaml @@ -36,8 +36,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/linux_ppc64le_cuda_compiler_versionNone.yaml b/.ci_support/linux_ppc64le_cuda_compiler_versionNone.yaml index a94319cf0..c13a52225 100644 --- a/.ci_support/linux_ppc64le_cuda_compiler_versionNone.yaml +++ b/.ci_support/linux_ppc64le_cuda_compiler_versionNone.yaml @@ -36,8 +36,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index 8665ee4ec..684e98c58 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -30,8 +30,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 macos_machine: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index 60da51a71..634e2c6d0 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -30,8 +30,10 @@ libabseil: - '20230125' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 macos_machine: diff --git a/.ci_support/win_64_cuda_compiler_version10.2.yaml b/.ci_support/win_64_cuda_compiler_version10.2.yaml index 7eabf5847..e21fedb45 100644 --- a/.ci_support/win_64_cuda_compiler_version10.2.yaml +++ b/.ci_support/win_64_cuda_compiler_version10.2.yaml @@ -32,8 +32,10 @@ libcurl: - '8' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.ci_support/win_64_cuda_compiler_versionNone.yaml b/.ci_support/win_64_cuda_compiler_versionNone.yaml index 84cefbe0e..ead68c4d7 100644 --- a/.ci_support/win_64_cuda_compiler_versionNone.yaml +++ b/.ci_support/win_64_cuda_compiler_versionNone.yaml @@ -32,8 +32,10 @@ libcurl: - '8' libgrpc: - '1.54' +- '1.56' libprotobuf: - '3.21' +- 4.23.3 lz4_c: - 1.9.3 numpy: diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index bb00584b9..3969edf3a 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -55,11 +55,6 @@ source run_conda_forge_build_setup echo -e "\n\nMaking the build clobber file" make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml -if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" -fi - - if [[ -f LICENSE.txt ]]; then cp LICENSE.txt "recipe/recipe-scripts-license.txt" fi @@ -75,6 +70,11 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else + + if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" + fi + conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file ./.ci_support/clobber_${CONFIG}.yaml diff --git a/README.md b/README.md index 1b36c4bbd..50b525abe 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ About arrow-cpp-feedstock Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/arrow-cpp-feedstock/blob/main/LICENSE.txt) + About arrow-cpp --------------- @@ -11,6 +12,7 @@ Home: http://github.com/apache/arrow Package license: Apache-2.0 Summary: C++ and Python libraries for Apache Arrow + About apache-arrow-proc ----------------------- @@ -19,6 +21,7 @@ Home: http://github.com/apache/arrow Package license: Apache-2.0 Summary: A meta-package to select Arrow build variant + About libarrow -------------- @@ -27,6 +30,7 @@ Home: http://github.com/apache/arrow Package license: Apache-2.0 Summary: C++ libraries for Apache Arrow + About pyarrow ------------- @@ -35,6 +39,7 @@ Home: http://github.com/apache/arrow Package license: Apache-2.0 Summary: Python libraries for Apache Arrow + About pyarrow-tests ------------------- @@ -55,7 +60,7 @@ Current build status
- + @@ -64,70 +69,70 @@ Current build status linux_64_cuda_compiler_version10.2 - + variant linux_64_cuda_compiler_versionNone - + variant linux_aarch64_cuda_compiler_version11.2 - + variant linux_aarch64_cuda_compiler_versionNone - + variant linux_ppc64le_cuda_compiler_version11.2 - + variant linux_ppc64le_cuda_compiler_versionNone - + variant osx_64 - + variant osx_arm64 - + variant win_64_cuda_compiler_version10.2 - + variant win_64_cuda_compiler_versionNone - + variant From c6b2b877916415f8be594b1f30415bf4af449b63 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 10 Jul 2023 12:32:14 +0200 Subject: [PATCH 5/7] clean up between libarrow builds also on windows --- recipe/build-arrow.bat | 7 +++++-- recipe/build-arrow.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/recipe/build-arrow.bat b/recipe/build-arrow.bat index c75a30596..e3013d49d 100644 --- a/recipe/build-arrow.bat +++ b/recipe/build-arrow.bat @@ -1,7 +1,7 @@ @echo on -mkdir "%SRC_DIR%"\cpp\build -pushd "%SRC_DIR%"\cpp\build +mkdir cpp\build +pushd cpp\build :: Enable CUDA support if "%cuda_compiler_version%"=="None" ( @@ -58,3 +58,6 @@ cmake --build . --target install --config Release if %ERRORLEVEL% neq 0 exit 1 popd + +:: clean up between builds (and to save space) +rmdir /s /q cpp\build diff --git a/recipe/build-arrow.sh b/recipe/build-arrow.sh index ecff827ed..4b9f4f03b 100644 --- a/recipe/build-arrow.sh +++ b/recipe/build-arrow.sh @@ -116,5 +116,5 @@ cmake --build . --target install --config Release popd -# clean up artefacts afterwards to save space +# clean up between builds (and to save space) rm -rf cpp/build From db22f140fbbd9a15305c6e0a5a16896a8fd47feb Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 10 Jul 2023 12:35:20 +0200 Subject: [PATCH 6/7] run test suite against libarrow for both protobufs --- recipe/meta.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c77b02b4d..3385ee6ee 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -354,6 +354,9 @@ outputs: # CUDA builds for aarch/ppc consistently run out of disk space on azure for some reason test: requires: + # vary protobuf version in test suite (historically, test failures only have a very + # weak dependency on python version, so we don't lose coverage by doing half & half) + - libprotobuf <4 # [py % 2 == 0] # temporary pin due to missing fixture - pytest <7.4.0 - pytest-lazy-fixture From 6cb2c7aeb08a502f18ee6dffb2d8d426e7aaeeca Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 10 Jul 2023 14:28:11 +0200 Subject: [PATCH 7/7] backport patch to disable useless pkgconfig search --- recipe/meta.yaml | 2 + ...on-PyArrow-C-header-files-no-longer-.patch | 5 +- ...-instantiation-of-gcs_server-gcfs-fi.patch | 5 +- ...elocatable-CMAKE_INSTALL_FULL_LIBDIR.patch | 5 +- ...Relax-condition-in-flaky-Flight-test.patch | 5 +- ...-find-.pc-files-with-ARROW_BUILD_STA.patch | 129 ++++++++++++++++++ 6 files changed, 135 insertions(+), 16 deletions(-) create mode 100644 recipe/patches/0005-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3385ee6ee..f3140551e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -29,6 +29,8 @@ source: - patches/0003-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch # backport apache/arrow#34747 for compatibility with grpc 1.54 - patches/0004-GH-34743-Python-Relax-condition-in-flaky-Flight-test.patch + # backport apache/arrow#34019 to disable useless pkgconfig search that takes ~15-60min + - patches/0005-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 diff --git a/recipe/patches/0001-ARROW-18340-Python-PyArrow-C-header-files-no-longer-.patch b/recipe/patches/0001-ARROW-18340-Python-PyArrow-C-header-files-no-longer-.patch index 7c91a509d..7414a73e7 100644 --- a/recipe/patches/0001-ARROW-18340-Python-PyArrow-C-header-files-no-longer-.patch +++ b/recipe/patches/0001-ARROW-18340-Python-PyArrow-C-header-files-no-longer-.patch @@ -1,7 +1,7 @@ From 984b9c8cf0b72e24e8917900862b37964fb27e58 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Tue, 22 Nov 2022 22:01:32 +0100 -Subject: [PATCH 1/4] ARROW-18340: [Python] PyArrow C++ header files no longer +Subject: [PATCH 1/5] ARROW-18340: [Python] PyArrow C++ header files no longer always included in installed pyarrow (#14656) This PR adds code to `_run_cmake` to always copy PyArrow C++ header files to `pyarrow/iclude`. @@ -81,6 +81,3 @@ index 2a7e5f7a3..528d9537f 100755 # Move the built C-extension to the place expected by the Python # build --- -2.40.1.windows.1 - diff --git a/recipe/patches/0002-properly-skip-if-instantiation-of-gcs_server-gcfs-fi.patch b/recipe/patches/0002-properly-skip-if-instantiation-of-gcs_server-gcfs-fi.patch index 02e8ca9c3..a11f40c35 100644 --- a/recipe/patches/0002-properly-skip-if-instantiation-of-gcs_server-gcfs-fi.patch +++ b/recipe/patches/0002-properly-skip-if-instantiation-of-gcs_server-gcfs-fi.patch @@ -1,7 +1,7 @@ From 652c929e80cb53425027d225d3a858266b54360b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 5 Dec 2022 20:15:58 +1100 -Subject: [PATCH 2/4] properly skip if instantiation of gcs_server/gcfs fixture +Subject: [PATCH 2/5] properly skip if instantiation of gcs_server/gcfs fixture fails --- @@ -56,6 +56,3 @@ index 945114454..7380711b3 100644 yield dict( fs=fs, --- -2.40.1.windows.1 - diff --git a/recipe/patches/0003-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch b/recipe/patches/0003-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch index e8601c201..572894f92 100644 --- a/recipe/patches/0003-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch +++ b/recipe/patches/0003-don-t-bake-non-relocatable-CMAKE_INSTALL_FULL_LIBDIR.patch @@ -1,7 +1,7 @@ From 7b0b770b7c35218de9e68e9c5fd2f2212cf56e07 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 26 Jan 2023 12:37:02 +1100 -Subject: [PATCH 3/4] don't bake non-relocatable CMAKE_INSTALL_FULL_LIBDIR into +Subject: [PATCH 3/5] don't bake non-relocatable CMAKE_INSTALL_FULL_LIBDIR into gdb-integration --- @@ -21,6 +21,3 @@ index 099a86237..cd6d15e8b 100644 set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL TRUE) endif() if(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL) --- -2.40.1.windows.1 - diff --git a/recipe/patches/0004-GH-34743-Python-Relax-condition-in-flaky-Flight-test.patch b/recipe/patches/0004-GH-34743-Python-Relax-condition-in-flaky-Flight-test.patch index da71562dd..90c3a2b7c 100644 --- a/recipe/patches/0004-GH-34743-Python-Relax-condition-in-flaky-Flight-test.patch +++ b/recipe/patches/0004-GH-34743-Python-Relax-condition-in-flaky-Flight-test.patch @@ -1,7 +1,7 @@ From 1156ace4091cbc504e535bda1dc2969aae088e97 Mon Sep 17 00:00:00 2001 From: David Li Date: Fri, 31 Mar 2023 11:57:35 -0400 -Subject: [PATCH 4/4] GH-34743: [Python] Relax condition in flaky Flight test +Subject: [PATCH 4/5] GH-34743: [Python] Relax condition in flaky Flight test (#34747) ### Rationale for this change @@ -38,6 +38,3 @@ index 69318a553..a42681678 100644 client.do_get(flight.Ticket(b'ints')) client.close() --- -2.40.1.windows.1 - diff --git a/recipe/patches/0005-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch b/recipe/patches/0005-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch new file mode 100644 index 000000000..7c9644b9b --- /dev/null +++ b/recipe/patches/0005-GH-33882-C-Don-t-find-.pc-files-with-ARROW_BUILD_STA.patch @@ -0,0 +1,129 @@ +From 8089cbe67164e7188dfb8dfade4a3ea490c6b33f Mon Sep 17 00:00:00 2001 +From: Sutou Kouhei +Date: Sat, 4 Feb 2023 22:08:54 +0900 +Subject: [PATCH 5/5] 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 | 72 +++++++++++---------- + 1 file changed, 37 insertions(+), 35 deletions(-) + +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index b44521e0c..9b71a6182 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() + +@@ -1157,18 +1159,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() +@@ -2469,17 +2465,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) +@@ -2545,6 +2534,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)