Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-08 Thread via GitHub


conbench-apache-arrow[bot] commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3050023460

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have 
been run so far on merge-commit f12356adaaabea86638407e995e73215dbb58bb2.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/45585897525) 
has more details. It also includes information about 14 possible false 
positives for unstable benchmarks that are known to sometimes produce them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-08 Thread via GitHub


kou commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3047755491

   Let's add this to 21.0.0 to reduce CI failures. It'll reduce 21.0.0 release 
costs. (We don't need to re-run jobs several times...)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-08 Thread via GitHub


raulcd commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3047751377

   This just missed the 21.0.0 release, @kou do you think that's ok or should 
we cherry-pick? Thinking about the thrift download related failures.
   cc @amoeba 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-08 Thread via GitHub


raulcd merged PR #46912:
URL: https://github.com/apache/arrow/pull/46912


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


zhjwpku commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3047286571

   > FYI: This will reduce Apache Thrift download related CI failures because 
this uses the latest Apache Thrift.
   
   The iceberg-cpp project is seeing frequent CI failures due to issues 
downloading Apache Thrift as part of Arrow's setup. So +1.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


kou commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3046921717

   FYI: This will reduce Apache Thrift download related CI failures because 
this uses the latest Apache Thrift.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


kou commented on code in PR #46912:
URL: https://github.com/apache/arrow/pull/46912#discussion_r2191229151


##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -1052,119 +1045,130 @@ endif()
 # --
 # Add Boost dependencies (code adapted from Apache Kudu)
 
-macro(build_boost)
-  set(BOOST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/boost_ep-prefix/src/boost_ep")
+function(build_boost)
+  list(APPEND CMAKE_MESSAGE_INDENT "Boost: ")
+  message(STATUS "Building from source")
 
-  # This is needed by the thrift_ep build
-  set(BOOST_ROOT ${BOOST_PREFIX})
-  set(Boost_INCLUDE_DIR "${BOOST_PREFIX}")
+  fetchcontent_declare(boost
+   ${FC_DECLARE_COMMON_OPTIONS} OVERRIDE_FIND_PACKAGE
+   URL ${BOOST_SOURCE_URL}
+   URL_HASH "SHA256=${ARROW_BOOST_BUILD_SHA256_CHECKSUM}")
 
-  if(ARROW_BOOST_REQUIRE_LIBRARY)
-set(BOOST_LIB_DIR "${BOOST_PREFIX}/stage/lib")
-set(BOOST_BUILD_LINK "static")
-if("${UPPERCASE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_BUILD_VARIANT "debug")
-else()
-  set(BOOST_BUILD_VARIANT "release")
+  prepare_fetchcontent()
+  set(BOOST_ENABLE_COMPATIBILITY_TARGETS ON)
+  set(BOOST_EXCLUDE_LIBRARIES)
+  set(BOOST_INCLUDE_LIBRARIES
+  ${ARROW_BOOST_COMPONENTS}
+  ${ARROW_BOOST_OPTIONAL_COMPONENTS}
+  algorithm
+  crc
+  numeric/conversion
+  scope_exit
+  throw_exception
+  tokenizer)
+  if(ARROW_TESTING
+ OR ARROW_GANDIVA
+ OR (NOT ARROW_USE_NATIVE_INT128))
+set(ARROW_BOOST_NEED_MULTIPRECISION TRUE)
+  else()
+set(ARROW_BOOST_NEED_MULTIPRECISION FALSE)
+  endif()
+  if(ARROW_ENABLE_THREADING)
+if(ARROW_WITH_THRIFT OR (ARROW_FLIGHT_SQL_ODBC AND MSVC))
+  list(APPEND BOOST_INCLUDE_LIBRARIES locale)
 endif()
-if(MSVC)
-  set(BOOST_CONFIGURE_COMMAND ".bootstrap.bat")
-else()
-  set(BOOST_CONFIGURE_COMMAND "./bootstrap.sh")
+if(ARROW_BOOST_NEED_MULTIPRECISION)
+  list(APPEND BOOST_INCLUDE_LIBRARIES multiprecision)
 endif()
+list(APPEND BOOST_INCLUDE_LIBRARIES thread)
+  else()
+list(APPEND
+ BOOST_EXCLUDE_LIBRARIES
+ asio
+ container
+ date_time
+ lexical_cast
+ locale
+ lockfree
+ math
+ thread)
+  endif()
+  if(ARROW_WITH_THRIFT)
+list(APPEND BOOST_INCLUDE_LIBRARIES uuid)
+  endif()

Review Comment:
   It worked.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


github-actions[bot] commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3044007021

   Revision: 3e7126e727c1cac1a8e284960d2e4ad45c07530d
   
   Submitted crossbow builds: [ursacomputing/crossbow @ 
actions-73cd498af8](https://github.com/ursacomputing/crossbow/branches/all?query=actions-73cd498af8)
   
   |Task|Status|
   ||--|
   |almalinux-10-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-almalinux-10-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112103162/job/45457736959)|
   |almalinux-10-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-almalinux-10-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112103329/job/45457737550)|
   |almalinux-8-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112103295/job/45457737374)|
   |almalinux-8-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-almalinux-8-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112102207/job/45457734402)|
   |almalinux-9-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-almalinux-9-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112101011/job/45457730206)|
   |almalinux-9-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-almalinux-9-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112103085/job/45457736731)|
   |amazon-linux-2023-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-amazon-linux-2023-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112102080/job/45457733530)|
   |amazon-linux-2023-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-amazon-linux-2023-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112100764/job/45457729273)|
   |centos-7-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-centos-7-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112101906/job/45457732857)|
   |centos-9-stream-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-centos-9-stream-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112100943/job/45457730019)|
   |centos-9-stream-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-centos-9-stream-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112102116/job/45457733549)|
   |debian-bookworm-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-debian-bookworm-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112101172/job/45457730744)|
   |debian-bookworm-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-debian-bookworm-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112102405/job/45457734571)|
   |debian-trixie-amd64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-debian-trixie-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/16112103221/job/45457738328)|
   |debian-trixie-arm64|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-debian-trixie-arm64)](https://github.com/ursacomputing/crossbow/actions/runs/16112102326/job/45457734334)|
   |example-cpp-minimal-build-static|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-example-cpp-minimal-build-static)](https://github.com/ursacomputing/crossbow/actions/runs/16112103099/job/45457736801)|
   |example-cpp-minimal-build-static-system-dependency|[![GitHub 
Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-73cd498af8-github-example-cpp-minimal-build-static-system-dependency)](https://github.com/ursacomputing/crossbow/actions/runs/16112102749/job/45457735927

Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


kou commented on PR #46912:
URL: https://github.com/apache/arrow/pull/46912#issuecomment-3043993692

   @github-actions crossbow submit -g cpp -g r -g python -g linux


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


kou commented on code in PR #46912:
URL: https://github.com/apache/arrow/pull/46912#discussion_r2189371987


##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -1052,119 +1045,130 @@ endif()
 # --
 # Add Boost dependencies (code adapted from Apache Kudu)
 
-macro(build_boost)
-  set(BOOST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/boost_ep-prefix/src/boost_ep")
+function(build_boost)
+  list(APPEND CMAKE_MESSAGE_INDENT "Boost: ")
+  message(STATUS "Building from source")
 
-  # This is needed by the thrift_ep build
-  set(BOOST_ROOT ${BOOST_PREFIX})
-  set(Boost_INCLUDE_DIR "${BOOST_PREFIX}")
+  fetchcontent_declare(boost
+   ${FC_DECLARE_COMMON_OPTIONS} OVERRIDE_FIND_PACKAGE
+   URL ${BOOST_SOURCE_URL}
+   URL_HASH "SHA256=${ARROW_BOOST_BUILD_SHA256_CHECKSUM}")
 
-  if(ARROW_BOOST_REQUIRE_LIBRARY)
-set(BOOST_LIB_DIR "${BOOST_PREFIX}/stage/lib")
-set(BOOST_BUILD_LINK "static")
-if("${UPPERCASE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_BUILD_VARIANT "debug")
-else()
-  set(BOOST_BUILD_VARIANT "release")
+  prepare_fetchcontent()
+  set(BOOST_ENABLE_COMPATIBILITY_TARGETS ON)
+  set(BOOST_EXCLUDE_LIBRARIES)
+  set(BOOST_INCLUDE_LIBRARIES
+  ${ARROW_BOOST_COMPONENTS}
+  ${ARROW_BOOST_OPTIONAL_COMPONENTS}
+  algorithm
+  crc
+  numeric/conversion
+  scope_exit
+  throw_exception
+  tokenizer)
+  if(ARROW_TESTING
+ OR ARROW_GANDIVA
+ OR (NOT ARROW_USE_NATIVE_INT128))
+set(ARROW_BOOST_NEED_MULTIPRECISION TRUE)
+  else()
+set(ARROW_BOOST_NEED_MULTIPRECISION FALSE)
+  endif()
+  if(ARROW_ENABLE_THREADING)
+if(ARROW_WITH_THRIFT OR (ARROW_FLIGHT_SQL_ODBC AND MSVC))
+  list(APPEND BOOST_INCLUDE_LIBRARIES locale)
 endif()
-if(MSVC)
-  set(BOOST_CONFIGURE_COMMAND ".bootstrap.bat")
-else()
-  set(BOOST_CONFIGURE_COMMAND "./bootstrap.sh")
+if(ARROW_BOOST_NEED_MULTIPRECISION)
+  list(APPEND BOOST_INCLUDE_LIBRARIES multiprecision)
 endif()
+list(APPEND BOOST_INCLUDE_LIBRARIES thread)
+  else()
+list(APPEND
+ BOOST_EXCLUDE_LIBRARIES
+ asio
+ container
+ date_time
+ lexical_cast
+ locale
+ lockfree
+ math
+ thread)
+  endif()
+  if(ARROW_WITH_THRIFT)
+list(APPEND BOOST_INCLUDE_LIBRARIES uuid)
+  endif()

Review Comment:
   We can do it but we don't need to do it.
   
   `uuid` is a header only library and it depends on only less problematic 
dependencies:
   
   
https://github.com/boostorg/uuid/blob/689f3d2c152626b833a2fb2d636516ef126fa300/CMakeLists.txt#L15-L21
   
   `uuid` will not cause a problem.
   
   Anyway, let's try excluding explicitly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


kou commented on code in PR #46912:
URL: https://github.com/apache/arrow/pull/46912#discussion_r2189343840


##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -1747,102 +1729,77 @@ endif()
 # --
 # Thrift
 
-macro(build_thrift)
-  message(STATUS "Building Apache Thrift from source")
-  set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-install")
-  set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include")
-  set(THRIFT_CMAKE_ARGS
-  ${EP_COMMON_CMAKE_ARGS}
-  "-DCMAKE_INSTALL_PREFIX=${THRIFT_PREFIX}"
-  "-DCMAKE_INSTALL_RPATH=${THRIFT_PREFIX}/lib"
-  # Work around https://gitlab.kitware.com/cmake/cmake/issues/18865
-  -DBoost_NO_BOOST_CMAKE=ON
-  -DBUILD_COMPILER=OFF
-  -DBUILD_EXAMPLES=OFF
-  -DBUILD_TUTORIALS=OFF
-  -DCMAKE_DEBUG_POSTFIX=
-  -DWITH_AS3=OFF
-  -DWITH_CPP=ON
-  -DWITH_C_GLIB=OFF
-  -DWITH_JAVA=OFF
-  -DWITH_JAVASCRIPT=OFF
-  -DWITH_LIBEVENT=OFF
-  -DWITH_NODEJS=OFF
-  -DWITH_PYTHON=OFF
-  -DWITH_QT5=OFF
-  -DWITH_ZLIB=OFF)
-
-  # Thrift also uses boost. Forward important boost settings if there were 
ones passed.
-  if(DEFINED BOOST_ROOT)
-list(APPEND THRIFT_CMAKE_ARGS "-DBOOST_ROOT=${BOOST_ROOT}")
-  endif()
-  list(APPEND
-   THRIFT_CMAKE_ARGS
-   
"-DBoost_INCLUDE_DIR=$"
-  )
-  if(DEFINED Boost_NAMESPACE)
-list(APPEND THRIFT_CMAKE_ARGS "-DBoost_NAMESPACE=${Boost_NAMESPACE}")
+function(build_thrift)
+  list(APPEND CMAKE_MESSAGE_INDENT "Thrift: ")
+  message(STATUS "Building from source")
+
+  if(CMAKE_VERSION VERSION_LESS 3.26)
+message(FATAL_ERROR "Require CMake 3.26 or later for building bundled 
Apache Thrift")
   endif()
+  fetchcontent_declare(thrift
+   ${FC_DECLARE_COMMON_OPTIONS}
+   URL ${THRIFT_SOURCE_URL}
+   URL_HASH "SHA256=${ARROW_THRIFT_BUILD_SHA256_CHECKSUM}")
 
+  prepare_fetchcontent()
+  set(BUILD_COMPILER OFF)
+  set(BUILD_EXAMPLES OFF)
+  set(BUILD_TUTORIALS OFF)
+  set(CMAKE_UNITY_BUILD OFF)
+  set(WITH_AS3 OFF)
+  set(WITH_CPP ON)
+  set(WITH_C_GLIB OFF)
+  set(WITH_JAVA OFF)
+  set(WITH_JAVASCRIPT OFF)
+  set(WITH_LIBEVENT OFF)
   if(MSVC)
 if(ARROW_USE_STATIC_CRT)
-  set(THRIFT_LIB_SUFFIX "mt")
-  list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=ON")
+  set(WITH_MT ON)
 else()
-  set(THRIFT_LIB_SUFFIX "md")
-  list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=OFF")
+  set(WITH_MT OFF)
 endif()
-# NOTE(amoeba): When you bump Thrift to >=0.21.0, change bin to lib
-set(THRIFT_LIB
-
"${THRIFT_PREFIX}/bin/${CMAKE_IMPORT_LIBRARY_PREFIX}thrift${THRIFT_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
-)
-  else()
-set(THRIFT_LIB
-
"${THRIFT_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}"
-)
   endif()
+  set(WITH_NODEJS OFF)
+  set(WITH_PYTHON OFF)
+  set(WITH_QT5 OFF)
+  set(WITH_ZLIB OFF)
 
-  if(BOOST_VENDORED)
-set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} boost_ep)
-  endif()
+  # Remove Apache Arrow's CMAKE_MODULE_PATH to ensure using Apache
+  # Thrift's cmake_modules/.
+  #
+  # We can remove this once https://github.com/apache/thrift/pull/3176
+  # is merged.
+  list(POP_FRONT CMAKE_MODULE_PATH)

Review Comment:
   We don't need it because the original `CMAKE_MODULE_PATH` value is restored 
when this function is exited.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-07 Thread via GitHub


raulcd commented on code in PR #46912:
URL: https://github.com/apache/arrow/pull/46912#discussion_r2189295651


##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -1052,119 +1045,130 @@ endif()
 # --
 # Add Boost dependencies (code adapted from Apache Kudu)
 
-macro(build_boost)
-  set(BOOST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/boost_ep-prefix/src/boost_ep")
+function(build_boost)
+  list(APPEND CMAKE_MESSAGE_INDENT "Boost: ")
+  message(STATUS "Building from source")
 
-  # This is needed by the thrift_ep build
-  set(BOOST_ROOT ${BOOST_PREFIX})
-  set(Boost_INCLUDE_DIR "${BOOST_PREFIX}")
+  fetchcontent_declare(boost
+   ${FC_DECLARE_COMMON_OPTIONS} OVERRIDE_FIND_PACKAGE
+   URL ${BOOST_SOURCE_URL}
+   URL_HASH "SHA256=${ARROW_BOOST_BUILD_SHA256_CHECKSUM}")
 
-  if(ARROW_BOOST_REQUIRE_LIBRARY)
-set(BOOST_LIB_DIR "${BOOST_PREFIX}/stage/lib")
-set(BOOST_BUILD_LINK "static")
-if("${UPPERCASE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_BUILD_VARIANT "debug")
-else()
-  set(BOOST_BUILD_VARIANT "release")
+  prepare_fetchcontent()
+  set(BOOST_ENABLE_COMPATIBILITY_TARGETS ON)
+  set(BOOST_EXCLUDE_LIBRARIES)
+  set(BOOST_INCLUDE_LIBRARIES
+  ${ARROW_BOOST_COMPONENTS}
+  ${ARROW_BOOST_OPTIONAL_COMPONENTS}
+  algorithm
+  crc
+  numeric/conversion
+  scope_exit
+  throw_exception
+  tokenizer)
+  if(ARROW_TESTING
+ OR ARROW_GANDIVA
+ OR (NOT ARROW_USE_NATIVE_INT128))
+set(ARROW_BOOST_NEED_MULTIPRECISION TRUE)
+  else()
+set(ARROW_BOOST_NEED_MULTIPRECISION FALSE)
+  endif()
+  if(ARROW_ENABLE_THREADING)
+if(ARROW_WITH_THRIFT OR (ARROW_FLIGHT_SQL_ODBC AND MSVC))
+  list(APPEND BOOST_INCLUDE_LIBRARIES locale)
 endif()
-if(MSVC)
-  set(BOOST_CONFIGURE_COMMAND ".bootstrap.bat")
-else()
-  set(BOOST_CONFIGURE_COMMAND "./bootstrap.sh")
+if(ARROW_BOOST_NEED_MULTIPRECISION)
+  list(APPEND BOOST_INCLUDE_LIBRARIES multiprecision)
 endif()
+list(APPEND BOOST_INCLUDE_LIBRARIES thread)
+  else()
+list(APPEND
+ BOOST_EXCLUDE_LIBRARIES
+ asio
+ container
+ date_time
+ lexical_cast
+ locale
+ lockfree
+ math
+ thread)
+  endif()
+  if(ARROW_WITH_THRIFT)
+list(APPEND BOOST_INCLUDE_LIBRARIES uuid)
+  endif()

Review Comment:
   Should we add `uuid` to `BOOST_EXCLUDE_LIBRARIES` otherwise?



##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -1747,102 +1729,77 @@ endif()
 # --
 # Thrift
 
-macro(build_thrift)
-  message(STATUS "Building Apache Thrift from source")
-  set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-install")
-  set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include")
-  set(THRIFT_CMAKE_ARGS
-  ${EP_COMMON_CMAKE_ARGS}
-  "-DCMAKE_INSTALL_PREFIX=${THRIFT_PREFIX}"
-  "-DCMAKE_INSTALL_RPATH=${THRIFT_PREFIX}/lib"
-  # Work around https://gitlab.kitware.com/cmake/cmake/issues/18865
-  -DBoost_NO_BOOST_CMAKE=ON
-  -DBUILD_COMPILER=OFF
-  -DBUILD_EXAMPLES=OFF
-  -DBUILD_TUTORIALS=OFF
-  -DCMAKE_DEBUG_POSTFIX=
-  -DWITH_AS3=OFF
-  -DWITH_CPP=ON
-  -DWITH_C_GLIB=OFF
-  -DWITH_JAVA=OFF
-  -DWITH_JAVASCRIPT=OFF
-  -DWITH_LIBEVENT=OFF
-  -DWITH_NODEJS=OFF
-  -DWITH_PYTHON=OFF
-  -DWITH_QT5=OFF
-  -DWITH_ZLIB=OFF)
-
-  # Thrift also uses boost. Forward important boost settings if there were 
ones passed.
-  if(DEFINED BOOST_ROOT)
-list(APPEND THRIFT_CMAKE_ARGS "-DBOOST_ROOT=${BOOST_ROOT}")
-  endif()
-  list(APPEND
-   THRIFT_CMAKE_ARGS
-   
"-DBoost_INCLUDE_DIR=$"
-  )
-  if(DEFINED Boost_NAMESPACE)
-list(APPEND THRIFT_CMAKE_ARGS "-DBoost_NAMESPACE=${Boost_NAMESPACE}")
+function(build_thrift)
+  list(APPEND CMAKE_MESSAGE_INDENT "Thrift: ")
+  message(STATUS "Building from source")
+
+  if(CMAKE_VERSION VERSION_LESS 3.26)
+message(FATAL_ERROR "Require CMake 3.26 or later for building bundled 
Apache Thrift")
   endif()
+  fetchcontent_declare(thrift
+   ${FC_DECLARE_COMMON_OPTIONS}
+   URL ${THRIFT_SOURCE_URL}
+   URL_HASH "SHA256=${ARROW_THRIFT_BUILD_SHA256_CHECKSUM}")
 
+  prepare_fetchcontent()
+  set(BUILD_COMPILER OFF)
+  set(BUILD_EXAMPLES OFF)
+  set(BUILD_TUTORIALS OFF)
+  set(CMAKE_UNITY_BUILD OFF)
+  set(WITH_AS3 OFF)
+  set(WITH_CPP ON)
+  set(WITH_C_GLIB OFF)
+  set(WITH_JAVA OFF)
+  set(WITH_JAVASCRIPT OFF)
+  set(WITH_LIBEVENT OFF)
   if(MSVC)
 if(ARROW_USE_STATIC_CRT)
-  set(THRIFT_LIB_SUFFIX "mt")
-  list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=ON")
+  set(WITH_MT ON)
 else()
-  set(THRIFT_LIB_SUFFIX "md")
-  list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=OFF")
+  set(WITH_MT OFF)
 endif()
-# NOTE(amoe

Re: [PR] GH-46745: [C++] Update bundled Boost to 1.88.0 and Apache Thrift to 0.22.0 [arrow]

2025-07-06 Thread via GitHub


kou commented on code in PR #46912:
URL: https://github.com/apache/arrow/pull/46912#discussion_r2188895627


##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -1747,102 +1729,74 @@ endif()
 # --
 # Thrift
 
-macro(build_thrift)
-  message(STATUS "Building Apache Thrift from source")
-  set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-install")
-  set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include")
-  set(THRIFT_CMAKE_ARGS
-  ${EP_COMMON_CMAKE_ARGS}
-  "-DCMAKE_INSTALL_PREFIX=${THRIFT_PREFIX}"
-  "-DCMAKE_INSTALL_RPATH=${THRIFT_PREFIX}/lib"
-  # Work around https://gitlab.kitware.com/cmake/cmake/issues/18865
-  -DBoost_NO_BOOST_CMAKE=ON
-  -DBUILD_COMPILER=OFF
-  -DBUILD_EXAMPLES=OFF
-  -DBUILD_TUTORIALS=OFF
-  -DCMAKE_DEBUG_POSTFIX=
-  -DWITH_AS3=OFF
-  -DWITH_CPP=ON
-  -DWITH_C_GLIB=OFF
-  -DWITH_JAVA=OFF
-  -DWITH_JAVASCRIPT=OFF
-  -DWITH_LIBEVENT=OFF
-  -DWITH_NODEJS=OFF
-  -DWITH_PYTHON=OFF
-  -DWITH_QT5=OFF
-  -DWITH_ZLIB=OFF)
-
-  # Thrift also uses boost. Forward important boost settings if there were 
ones passed.
-  if(DEFINED BOOST_ROOT)
-list(APPEND THRIFT_CMAKE_ARGS "-DBOOST_ROOT=${BOOST_ROOT}")
-  endif()
-  list(APPEND
-   THRIFT_CMAKE_ARGS
-   
"-DBoost_INCLUDE_DIR=$"
-  )
-  if(DEFINED Boost_NAMESPACE)
-list(APPEND THRIFT_CMAKE_ARGS "-DBoost_NAMESPACE=${Boost_NAMESPACE}")
+function(build_thrift)
+  list(APPEND CMAKE_MESSAGE_INDENT "Thrift: ")
+  message(STATUS "Building from source")
+
+  if(CMAKE_VERSION VERSION_LESS 3.26)
+message(FATAL_ERROR "Require CMake 3.26 or later for building bundled 
Apache Thrift")
   endif()
+  fetchcontent_declare(thrift
+   ${FC_DECLARE_COMMON_OPTIONS}
+   URL ${THRIFT_SOURCE_URL}
+   URL_HASH "SHA256=${ARROW_THRIFT_BUILD_SHA256_CHECKSUM}")
 
+  prepare_fetchcontent()
+  set(BUILD_COMPILER OFF)
+  set(BUILD_EXAMPLES OFF)
+  set(BUILD_TUTORIALS OFF)
+  set(CMAKE_UNITY_BUILD OFF)
+  set(WITH_AS3 OFF)
+  set(WITH_CPP ON)
+  set(WITH_C_GLIB OFF)
+  set(WITH_JAVA OFF)
+  set(WITH_JAVASCRIPT OFF)
+  set(WITH_LIBEVENT OFF)
   if(MSVC)
 if(ARROW_USE_STATIC_CRT)
-  set(THRIFT_LIB_SUFFIX "mt")
-  list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=ON")
+  set(WITH_MT ON)
 else()
-  set(THRIFT_LIB_SUFFIX "md")
-  list(APPEND THRIFT_CMAKE_ARGS "-DWITH_MT=OFF")
+  set(WITH_MT OFF)
 endif()
-# NOTE(amoeba): When you bump Thrift to >=0.21.0, change bin to lib
-set(THRIFT_LIB
-
"${THRIFT_PREFIX}/bin/${CMAKE_IMPORT_LIBRARY_PREFIX}thrift${THRIFT_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
-)
-  else()
-set(THRIFT_LIB
-
"${THRIFT_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}"
-)
   endif()
+  set(WITH_NODEJS OFF)
+  set(WITH_PYTHON OFF)
+  set(WITH_QT5 OFF)
+  set(WITH_ZLIB OFF)
 
-  if(BOOST_VENDORED)
-set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} boost_ep)
-  endif()
+  # Remove Apache Arrow's CMAKE_MODULE_PATH to ensure using Apache
+  # Thrift's cmake_modules/.
+  list(POP_FRONT CMAKE_MODULE_PATH)
+  fetchcontent_makeavailable(thrift)
 
-  set(THRIFT_PATCH_COMMAND)
-  if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION 
VERSION_GREATER_EQUAL 15.0)
-# Thrift 0.21.0 doesn't support GCC 15.
-# https://github.com/apache/arrow/issues/45096
-# https://github.com/apache/thrift/pull/3078
-find_program(PATCH patch REQUIRED)
-list(APPEND
- THRIFT_PATCH_COMMAND
- ${PATCH}
- -p1
- -i
- ${CMAKE_CURRENT_LIST_DIR}/thrift-cstdint.patch)
+  if(CMAKE_VERSION VERSION_LESS 3.28)
+set_property(DIRECTORY ${thrift_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
   endif()
 
-  externalproject_add(thrift_ep
-  ${EP_COMMON_OPTIONS}
-  URL ${THRIFT_SOURCE_URL}
-  URL_HASH "SHA256=${ARROW_THRIFT_BUILD_SHA256_CHECKSUM}"
-  BUILD_BYPRODUCTS "${THRIFT_LIB}"
-  CMAKE_ARGS ${THRIFT_CMAKE_ARGS}
-  DEPENDS ${THRIFT_DEPENDENCIES}
-  PATCH_COMMAND ${THRIFT_PATCH_COMMAND})
-
-  add_library(thrift::thrift STATIC IMPORTED)
-  # The include directory must exist before it is referenced by a target.
-  file(MAKE_DIRECTORY "${THRIFT_INCLUDE_DIR}")
-  set_target_properties(thrift::thrift PROPERTIES IMPORTED_LOCATION 
"${THRIFT_LIB}")
-  target_include_directories(thrift::thrift BEFORE INTERFACE 
"${THRIFT_INCLUDE_DIR}")
-  if(ARROW_USE_BOOST)
-target_link_libraries(thrift::thrift INTERFACE Boost::headers)
+  target_include_directories(thrift
+ INTERFACE 
$

Review Comment:
   `BUILD_LOCAL_INTERFACE` requires CMake 3.26.



##
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##
@@ -2697,9 +2651,8 @@ function(build_lz4)
 
   # Ad